Skip to content

Commit

Permalink
Bump FastJet version to 3.4.0 from 3.3.4 using a patch (#122)
Browse files Browse the repository at this point in the history
* Update fastjet-core to 3.4.0 with patch

* fix typo

* fix typo

* fix typo

* fix patch

* final changes for update

* Fix last issues

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
chrispap95 and pre-commit-ci[bot] committed Oct 26, 2022
1 parent 800f647 commit f12e4ea
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 3 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion fastjet-core
Submodule fastjet-core updated from 017d93 to da603d
14 changes: 14 additions & 0 deletions patch.txt
Original file line number Diff line number Diff line change
@@ -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)
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")}'
Expand Down
2 changes: 1 addition & 1 deletion src/fastjet/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))

Expand Down

0 comments on commit f12e4ea

Please sign in to comment.