-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
191 lines (157 loc) · 5.19 KB
/
pyproject.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
[project]
name = "readii"
version = "1.18.0"
description = "A package to extract radiomic features!"
authors = [{ name = "Katy Scott", email = "[email protected]" }]
license = "MIT"
readme = "README.md"
dependencies = [
"simpleitk>=2.3.1",
"matplotlib>=3.9.2,<4",
"med-imagetools>=1.9.2",
# "dicom-parser>=1.2.3,<2", # jjjermiah: removing for updated med-imagetools
"pydicom>=2.3.1",
"pyradiomics-bhklab>=3.1.4,<4",
]
requires-python = ">=3.10, <3.13"
classifiers = [
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
[project.scripts]
readii = "readii.pipeline:main"
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[tool.pixi.pypi-dependencies]
readii = { path = ".", editable = true }
[tool.pixi.environments]
dev = { features = ["test", "style", "docs", "dev"], solve-group = "default" }
publish = { features = ["build", "release"], solve-group = "default" }
py310 = ["py310", "test"]
py311 = ["py311", "test"]
py312 = ["py312", "test"]
############################################## python ###############################################
[tool.pixi.feature.py310.dependencies]
python = "3.10.*"
[tool.pixi.feature.py311.dependencies]
python = "3.11.*"
[tool.pixi.feature.py312.dependencies]
python = "3.12.*"
[tool.pixi.feature.dev.dependencies]
pip = "*"
############################################## TEST ################################################
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
[tool.pixi.feature.test.tasks.test]
cmd = [
"pytest",
"--numprocesses=auto",
"-s",
"--verbose",
"--cov=readii",
"--cov-report=xml:coverage-report/coverage.xml",
"--cov-config=config/coverage.toml",
]
inputs = ["src", "tests", "config/coverage.toml"]
outputs = ["coverage-report/coverage.xml"]
description = "Run pytest (Note: run `coverage` task to do both)"
[tool.pixi.feature.test.tasks.coverage]
cmd = "coverage report --rcfile=config/coverage.toml"
inputs = ["coverage-report/coverage.xml", "config/coverage.toml"]
depends-on = ["test"]
description = "Run pytest and generate coverage report"
############################################## DOCS ################################################
[tool.pixi.feature.docs.dependencies]
myst-nb = "*"
sphinx-autoapi = "*"
sphinx-rtd-theme = "*"
# TODO::add tasks to build documentation
############################################## STYLE ###############################################
# See config/ruff.toml for the configuration
[tool.pixi.feature.style.dependencies]
ruff = ">=0.4.4"
pre-commit = ">=3.7.1,<3.8"
[tool.pixi.feature.style.tasks]
[tool.pixi.feature.style.tasks.lint]
cmd = "ruff check --config=config/ruff.toml"
inputs = ["src", "config/ruff.toml"]
description = "Run ruff linter"
[tool.pixi.feature.style.tasks.format]
cmd = "ruff format --config=config/ruff.toml"
inputs = ["src", "config/ruff.toml"]
description = "Run ruff formatter, use `--diff` to see changes only"
#################################### RELEASE & BUILD ###############################################
[tool.pixi.feature.release.dependencies]
python-semantic-release = "*"
[tool.pixi.feature.release.tasks]
semver = 'echo "Next Version is: $(semantic-release version --print)"'
release = "semantic-release version"
[tool.semantic_release]
version_variables = ["src/readii/__init__.py:__version__"]
version_toml = ["pyproject.toml:project.version"] # version location
changelog_file = "CHANGELOG.md" # changelog file
dist_path = "dist/" # where to put dists
upload_to_release = true # auto-create GitHub release
remove_dist = false # don't remove dists
patch_without_tag = true # patch release by default
[tool.semantic_release.branches.main]
match = "(main|development)"
[tool.pixi.feature.build.dependencies]
hatch = "*"
[build-system]
build-backend = "hatchling.build"
requires = ["hatchling"]
[tool.hatch.build]
directory = "dist"
[tool.hatch.build.targets.wheel]
packages = ["src/readii"]
include = ["pyproject.toml", "README.md", "src/**", "config/hatch.toml"]
[tool.hatch.build.targets.sdist]
include = ["pyproject.toml", "README.md", "src/", "config/hatch.toml"]
exclude = ["tests/**"]
[tool.pixi.feature.build.tasks]
# Builds the package
build = { cmd = [
"hatch",
"build",
"--clean",
], inputs = [
"src",
"pyproject.toml",
], outputs = [
"dist/*",
], description = "Build the package" }
# Publishes the package to the main PYPI repository, depends on the build task
publish-pypi = { cmd = [
"hatch",
"publish",
"--yes",
"--repo",
"main",
], inputs = [
"dist/*",
], depends-on = [
"build",
], description = "Publish to main PyPI" }
publish-test = { cmd = [
"hatch",
"publish",
"--yes",
"--repo",
"test",
], inputs = [
"dist/*",
], depends-on = [
"build",
], description = "Publish to test PyPI" }
[tool.pixi.dependencies]
jupyterlab = ">=4.3.1,<5"
pixi-kernel = ">=0.5.1,<0.6"
ipykernel = ">=6.29.5,<7"