Skip to content

Commit

Permalink
fix: update cppyy module
Browse files Browse the repository at this point in the history
  • Loading branch information
ianna committed Oct 8, 2023
1 parent c9aaacf commit a7a327d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/awkward/cppyy.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE

import awkward as ak
import packaging.version

_has_checked_version = False

Expand All @@ -25,7 +25,9 @@ def register_and_check():
) from err

if not _has_checked_version:
if ak._util.parse_version(cppyy.__version__) < ak._util.parse_version("3.0.1"):
if packaging.version.Version(cppyy.__version__) < packaging.version.Version(
"3.0.1"
):
raise ImportError(
"Awkward Array can only work with cppyy 3.0.1 or later "
f"(you have version {cppyy.__version__})"
Expand Down
4 changes: 3 additions & 1 deletion src/awkward/highlevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1548,10 +1548,12 @@ def cpp_type(self):
See [cppyy documentation](https://cppyy.readthedocs.io/en/latest/index.html)
on types and signatures.
"""
ak.cppyy.register_and_check()
ak.cppyy.register_and_check() # noqa: F823

import cppyy

import awkward._connect.cling # noqa: F401

if self._cpp_type is None:
self._generator = ak._connect.cling.togenerator(
self.layout.form, flatlist_as_rvec=False
Expand Down

0 comments on commit a7a327d

Please sign in to comment.