diff --git a/MANIFEST.in b/MANIFEST.in index d03ee569..030d46e8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -3,4 +3,4 @@ graft tests graft fastjet-core graft pybind11 global-exclude .git .gitmodules -include LICENSE README.md pyproject.toml setup.py setup.cfg +include LICENSE README.md pyproject.toml setup.py setup.cfg patch.txt diff --git a/fastjet-core b/fastjet-core index 017d9316..da603d0a 160000 --- a/fastjet-core +++ b/fastjet-core @@ -1 +1 @@ -Subproject commit 017d931624efc44234dcd248619a0c4122762ee5 +Subproject commit da603d0af9f8b99f9908316054ee27d52471dc3e diff --git a/patch.txt b/patch.txt new file mode 100644 index 00000000..49b13bd6 --- /dev/null +++ b/patch.txt @@ -0,0 +1,14 @@ +--- fastjet-core/pyinterface/fastjet.i 2022-10-25 23:22:36.000000000 +0200 ++++ fastjet-core/pyinterface/fastjet_p.i 2022-10-26 16:25:20.000000000 +0200 +@@ -138,7 +138,10 @@ + + // include FastJetError in python module + %pythoncode { +- from _fastjet import FastJetError ++ if __package__ or "." in __name__: ++ from ._fastjet import FastJetError ++ else: ++ from _fastjet import FastJetError + } + + FASTJET_ERRORS_AS_PYTHON_EXCEPTIONS(fastjet) diff --git a/setup.py b/setup.py index d32497e5..816da77f 100644 --- a/setup.py +++ b/setup.py @@ -53,6 +53,13 @@ def build_extensions(self): cgal_dir = DIR / zip_obj.namelist()[0] zip_obj.extractall(DIR) + # Patch for FastJet core version 3.4.0 + # To be removed when https://gitlab.com/fastjet/fastjet/-/merge_requests/1 is merged upstream + subprocess.run( + ["patch", "pyinterface/fastjet.i", DIR / "patch.txt"], + cwd=FASTJET, + ) + env = os.environ.copy() env["PYTHON"] = sys.executable env["PYTHON_INCLUDE"] = f'-I{sysconfig.get_path("include")}' diff --git a/src/fastjet/version.py b/src/fastjet/version.py index 0bf69b1a..67d21c45 100644 --- a/src/fastjet/version.py +++ b/src/fastjet/version.py @@ -2,7 +2,7 @@ import re -__version__ = "3.3.4.0rc10" +__version__ = "3.4.0.0rc1" version = __version__ version_info = tuple(re.split(r"[-\.]", __version__))