Skip to content

Commit d227e3c

Browse files
committed
Merge branch 'master' into update_dev_instructions
2 parents 482a640 + f3612d7 commit d227e3c

File tree

6 files changed

+15
-19
lines changed

6 files changed

+15
-19
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
/build*
22
__pycache__/
3-
/Wrappers/Python/cil/version.py
43
/Wrappers/Python/cil-*.dist-info/
54
/Wrappers/Python/cil/include/
65
/Wrappers/Python/cil/lib/

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
- Bug fixes:
55
- `CentreOfRotationCorrector.image_sharpness` data is now correctly smoothed to reduce aliasing artefacts and improve robustness. (#2202)
66
- `PaganinProcessor` now correctly applies scaling with magnification for cone-beam geometry (#2225)
7+
- `cilacc` path lookup no longer broken for editable installations (#2257)
8+
- update `version.py` to use `importlib` & fix tagless installation #2255 (#2269)
79
- Dependencies:
810
- olefile and dxchange are optional dependencies, instead of required (#2209)
911
- improve `tqdm` notebook support (#2241)

NOTICE.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Francis M Watson (2025) - 3
8181
Hussam Alhassan (2025) - 1
8282
Adam Doherty (2025) - 5
8383
Evan Kiely (2025) - 10
84+
Jeppe Klitgaard (2026) - 2
8485

8586
CIL Advisory Board:
8687
Llion Evans - 9

Wrappers/Python/cil/framework/cilacc.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
# CIL Developers, listed at: https://github.com/TomographicImaging/CIL/blob/master/NOTICE.txt
1818
# Joshua DM Hellier (University of Manchester) [refactorer]
1919
import ctypes
20-
from pathlib import Path
20+
from importlib.metadata import distribution
2121

2222
try:
23-
cilacc_path = next((Path(__file__).parent.parent / 'lib').resolve().glob("*cilacc.*"))
23+
dist = distribution("cil").locate_file("cil/lib")
24+
cilacc_path = next(dist.glob("*cilacc.*"))
2425
except StopIteration:
2526
raise FileNotFoundError("cilacc library not found")
2627
cilacc = ctypes.cdll.LoadLibrary(str(cilacc_path))

Wrappers/Python/cil/version.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import importlib.metadata
2+
from packaging.version import Version
3+
version = importlib.metadata.version("cil")
4+
5+
__v = Version(version)
6+
major, minor, patch = __v.major, __v.minor, __v.micro
7+
commit_hash = "" if __v.local is None else __v.local.split(".", 1)[0]
8+
num_commit = __v.dev or 9_999

pyproject.toml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,6 @@ sdist.exclude = ["scripts", "docs", "Wrappers/Python/data", "Wrappers/Python/tes
1616
[tool.scikit-build.wheel.packages]
1717
cil = "Wrappers/Python/cil"
1818

19-
[tool.setuptools_scm]
20-
version_file = "Wrappers/Python/cil/version.py"
21-
version_file_template = """
22-
version = '{version}'
23-
major = {version_tuple[0]}
24-
minor = {version_tuple[1]}
25-
patch = {version_tuple[2]}
26-
commit_hash = '{scm_version.node}'
27-
num_commit = {scm_version.distance}
28-
# work-around for https://github.com/pypa/setuptools_scm/issues/1059
29-
if (commit_hash, num_commit) == ('None', 0):
30-
import re
31-
if (_v := re.search(r'\\.dev(\\d+)\\+(\\w+)', version)):
32-
num_commit, commit_hash = int(_v.group(1)), _v.group(2)
33-
"""
34-
3519
[tool.setuptools]
3620
package-dir = {"" = "Wrappers/Python"}
3721

@@ -68,6 +52,7 @@ dependencies = [
6852
"pywavelets",
6953
"scipy>=1.4.0",
7054
"tqdm",
55+
"packaging",
7156
]
7257
[project.optional-dependencies]
7358
plugins = [

0 commit comments

Comments
 (0)