Skip to content

Commit 034485b

Browse files
Group dependencies #10
This introduces sets of optional-dependencies to `pyproject.toml` that allow for reduced dependency installation. The `openlifu-test-app` project, for example, can package only the hardware-communication required dependencies by using the `[io]` option. The base application as used in Slicer should now be installed with the `[app]` option.
1 parent 9f17b94 commit 034485b

1 file changed

Lines changed: 46 additions & 16 deletions

File tree

pyproject.toml

Lines changed: 46 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,31 +31,52 @@ dynamic = ["version"]
3131
dependencies = [
3232
"xarray[io]",
3333
"numpy<2",
34-
"matplotlib",
3534
"pandas",
3635
"scipy",
36+
"watchdog"
37+
]
38+
39+
[project.optional-dependencies]
40+
jupyter = [
41+
"ipykernel",
42+
"matplotlib",
43+
]
44+
mesh = [
45+
"embreex; platform_machine=='x86_64' or platform_machine=='AMD64'",
46+
"trimesh",
47+
"scikit-image",
3748
"vtk",
38-
"h5py",
39-
"opencv-contrib-python",
40-
"crc",
49+
"Pillow",
50+
"OpenEXR"
51+
]
52+
db = [
4153
"nibabel",
42-
"sphinx",
43-
"ipykernel",
44-
"pyserial",
54+
"pydicom"
55+
]
56+
io = [
57+
"crc",
4558
"crcmod",
59+
"pyserial"
60+
]
61+
sim = [
4662
"k-wave-python==0.4.0",
47-
"nvidia-ml-py",
48-
"OpenEXR",
49-
"scikit-image",
50-
"trimesh",
51-
"embreex; platform_machine=='x86_64' or platform_machine=='AMD64'",
52-
"onnxruntime==1.18.0",
53-
"pydicom",
63+
"nvidia-ml-py"
64+
]
65+
cloud = [
66+
"requests",
5467
"watchdog",
5568
"python-socketio[client]"
5669
]
57-
58-
[project.optional-dependencies]
70+
photogrammetry = [
71+
"embreex; platform_machine=='x86_64' or platform_machine=='AMD64'",
72+
"opencv-contrib-python",
73+
"onnxruntime==1.18.0",
74+
"trimesh",
75+
"scikit-image",
76+
"vtk",
77+
"Pillow",
78+
"OpenEXR"
79+
]
5980
test = [
6081
"pytest >=6",
6182
"pytest-cov >=3",
@@ -74,6 +95,12 @@ docs = [
7495
"sphinx_autodoc_typehints",
7596
"furo>=2023.08.17",
7697
]
98+
all = [
99+
"openlifu[jupyter, mesh, db, io, sim, cloud, photogrammetry, test, dev, docs]",
100+
]
101+
app = [
102+
"openlifu[mesh, db, io, sim, cloud, photogrammetry]",
103+
]
77104

78105
[project.urls]
79106
Homepage = "https://github.com/OpenwaterHealth/OpenLIFU-python"
@@ -86,6 +113,9 @@ Changelog = "https://github.com/OpenwaterHealth/OpenLIFU-python/releases"
86113
version.source = "vcs"
87114
build.hooks.vcs.version-file = "src/openlifu/_version.py"
88115

116+
[tool.hatch.metadata]
117+
allow-direct-references = true
118+
89119
[tool.hatch.envs.default]
90120
features = ["test"]
91121
scripts.test = "pytest {args}"

0 commit comments

Comments
 (0)