-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
207 lines (178 loc) · 6.49 KB
/
pyproject.toml
File metadata and controls
207 lines (178 loc) · 6.49 KB
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
[project]
name = "rhizotools"
description = "Python package for root processing images at MARS@ORNL"
authors = [
{name = "Jean Bilheux", email = "bilheuxjm@ornl.gov"},
{name = "Chen Zhang", email = "zhangc@ornl.gov"},
{name = "Keita DeCarlo", email = "decarlokd@ornl.gov"},
]
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Topic :: Scientific/Engineering :: Physics",
"Intended Audience :: Science/Research"
]
dynamic = ["version"]
requires-python = ">=3.11"
license = { text = "MIT" }
keywords = ["root processing", "neutron", "biology", "ORNL", "MARS"]
readme = "README.md"
dependencies = [
"numpy",
"astropy",
"scipy",
"pillow",
"scikit-image"
]
[project.urls]
homepage = "https://github.com/ornlneutronimaging/RootPlantProcessing"
repository = "https://github.com/ornlneutronimaging/RootPlantProcessing"
issues = "https://github.com/ornlneutronimaging/RootPlantProcessing/issues"
# documentation = "link_to_readthedocs"
[project.optional-dependencies]
dev = ["pytest>=7.0.0", "pytest-cov", "pre-commit", "ruff"]
docs = ["sphinx>=8.2.1", "sphinx_rtd_theme>=3.0.1"]
jupyter = ["jupyterlab", "ipympl", "ipywidgets"]
all = ["rhizotools[dev,docs,jupyter]"]
# [project.scripts]
# rhizo = "rhizotools.cli:main" # re-enable this line when the CLI is ready
# -------------------------------- #
# -- Build system configuration -- #
# -------------------------------- #
[build-system]
requires = [
"setuptools>= 42",
"wheel",
"toml",
"versioningit"
]
build-backend = "setuptools.build_meta"
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*", "scripts*", "docs*", "notebooks*"]
[tool.setuptools.package-data]
"*" = ["*.yml","*.yaml","*.ini"]
# -------------------------------- #
# -- VersioningIt configuration -- #
# -------------------------------- #
[tool.versioningit.vcs]
method = "git"
default-tag = "0.1.0"
[tool.versioningit.next-version]
method = "minor"
[tool.versioningit.format]
distance = "{next_version}.dev{distance}"
dirty = "{version}+d{build_date:%Y%m%d}"
distance-dirty = "{next_version}.dev{distance}+d{build_date:%Y%m%d%H%M}"
[tool.versioningit.write]
file = "src/rhizotools/_version.py"
# -------------------------------- #
# ----- PyTest configuration ----- #
# -------------------------------- #
[tool.pytest.ini_options]
addopts = "-v --cov=rhizotools --cov-report=term-missing"
pythonpath = [
".", "src", "scripts"
]
testpaths = ["tests"]
python_files = ["test*.py"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__", "*dataset*", "*data_set*"]
markers = [
"mymarker: example markers goes here"
]
# -------------------------------- #
# ------ Ruff configuration ------ #
# -------------------------------- #
[tool.ruff]
target-version = "py311"
line-length = 120
exclude = ["notebooks/**", "**/*.ipynb"]
[tool.ruff.lint]
select = ["A", "ARG","ASYNC","BLE","C90", "E", "F", "I", "UP032", "W"]
ignore = [
"E741" # ambiguous variable name, such as L, E, etc.
]
[tool.ruff.lint.isort]
known-first-party = ["rhizotools"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# -------------------------------- #
# ------ Pixi configuration ------ #
# -------------------------------- #
[tool.pixi.project]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[tool.pixi.pypi-dependencies]
rhizotools = { path = ".", editable = true }
# The dependencies listed below will be prioritized over the ones
# listed in the [project] section.
[tool.pixi.dependencies]
numpy = ">=2.2.3,<3"
astropy = ">=7.0.1,<8"
scipy = ">=1.15.2,<2"
pillow = ">=11.1.0,<12"
scikit-image = ">=0.25.2,<0.26"
[tool.pixi.tasks]
# PyPi packaging tasks
build-pypi = { cmd = "python -m build", description = "Build the package for PyPI" }
publish-pypi = { cmd = "twine upload dist/*", description = "Publish the package to PyPI", depends-on = ["build-pypi"] }
clean-pypi = { cmd = "rm -rf dist", description = "Clean the PyPI build artifacts" }
# Conda packaging tasks
# NOTE: for build-conda to work locally, you need to set pixi to use detached-environments, i.e. pixi config set detached-environments true
# this is because the conda build will complain about build environment in source and refuse to build.
build-conda = { cmd = "cd conda.recipe && VERSION=$(versioningit ../) conda mambabuild --channel conda-forge --output-folder . .", description = "Build the package for conda" }
verify-conda = { cmd = "conda verify conda.recipe/noarch/*.tar.bz2", description = "Verify the conda package", depends-on = ["build-conda"] }
publish-conda = { cmd = "anaconda upload --user neutronimaging conda.recipe/noarch/*/*.tar.bz2", description = "Publish to neutronimaging channel", depends-on = ["verify-conda"] }
clean-conda = { cmd = "sh -c \"find conda.recipe/* ! -name 'meta.yaml' -exec rm -rf {} +\"", description = "Clean the conda build artifacts" }
# Documentation tasks
build-docs = { cmd = "sphinx-build -b html docs docs/_build", description = "Build the documentation" }
clean-docs = { cmd = "rm -rf docs/_build", description = "Clean the documentation build artifacts" }
# Testing tasks
test = { cmd = "pytest", description = "Run the tests" } # pytest config above takes care of the arguments
# Clean all
clean-all = { description = "Clean all build artifacts", depends-on = ["clean-pypi", "clean-conda", "clean-docs"] }
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
pytest-repeat = "*"
[tool.pixi.feature.package.dependencies]
boa = "*"
anaconda-client = ">=1.12.3,<2" # For manual upload to anaconda
conda-build = "*"
conda-verify = "*"
python-build = "*"
twine = ">=6.1.0,<7"
[tool.pixi.feature.developer.dependencies]
pip = "*"
versioningit = "*"
pre-commit = "*"
conda-tree = "*"
ruff = "*"
[tool.pixi.feature.docs.dependencies]
sphinx = ">=8.2.1,<9"
sphinx_rtd_theme = ">=3.0.1,<4"
[tool.pixi.feature.jupyter.dependencies]
jupyterlab = "*"
ipympl = "*"
ipywidgets = "*"
[tool.pixi.environments]
default = {features = ["test", "package", "docs", "developer"], solve-group = "default"}
jupyter = {features = ["developer", "jupyter"], solve-group = "jupyter"}
# -------------------------------- #
# ------ Mypy configuration ------ #
# -------------------------------- #
[tool.mypy]
python_version = "3.11"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = true
disallow_incomplete_defs = true
[[tool.mypy.overrides]]
module = ["tests.*"]
disallow_untyped_defs = false