-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
203 lines (177 loc) · 6.45 KB
/
pyproject.toml
File metadata and controls
203 lines (177 loc) · 6.45 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
[project]
name = "pleiades"
description = "PLEIADES - Python Libraries Extensions for Isotopic Analysis via Detailed Examination of SAMMY"
dynamic = ["version"]
requires-python = ">=3.10,<4.0"
license = { text = "MIT" }
keywords = ["neutron", "resonance", "cross-section"]
authors = [
{name = "Alex M. Long", email = "alexlong@lanl.gov"},
{name = "Tsviki Hirsh", email = "tsviki.hirsh@gmail.com"},
{name = "Chen Zhang", email = "zhangc@ornl.gov"},
{name = "Jean Bilheux", email = "bilheuxjm@ornl.gov"},
]
dependencies = [
"numpy",
"scipy",
"pandas",
"astropy",
"matplotlib",
"tifffile",
"jupyterlab",
"dxchange",
"pyyaml",
"scikit-image",
"pydantic",
"loguru",
"nova-galaxy>=0.7.4,<0.8",
]
[project.urls]
homepage = "https://github.com/lanl/PLEIADES"
repository = "https://github.com/lanl/PLEIADES"
documentation = "https://pleiades-sammy.readthedocs.io"
issues = "https://github.com/lanl/PLEIADES/issues"
[project.scripts]
pleiades = "pleiades:main" # Console script entry point
post_install_check = "pleiades.post_install:check_sammy_installed"
[build-system]
requires = [
"setuptools >= 40.6.0",
"wheel",
"toml",
"versioningit"
]
build-backend = "setuptools.build_meta"
# -------------------------------------- #
# ----- Versioningit configuration ----- #
# -------------------------------------- #
[tool.versioningit.vcs]
method = "git"
default-tag = "1.0.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/pleiades/_version.py"
# ------------------------------------ #
# ----- Setuptools configuration ----- #
# ------------------------------------ #
[tool.setuptools]
include-package-data = true
[tool.setuptools.packages.find]
where = ["src"]
exclude = ["tests*", "docs*", "notebooks*"]
[tool.setuptools.package-data]
"*" = ["*.yml","*.yaml","*.ini","**/*.ui","**/*.json", "**/icons/*"]
# -------------------------------- #
# ----- Pytest configuration ----- #
# -------------------------------- #
[tool.pytest.ini_options]
pythonpath = [
".", "src",
]
testpaths = ["tests"]
python_files = ["test*.py"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__", "*dataset*", "*data_set*"]
markers = [
"unit: unit tests",
"integration: integration tests",
"slow: tests that are slow to run",
"gui: tests for the GUI components"
]
# ------------------------------ #
# ----- Ruff configuration ----- #
# ------------------------------ #
[tool.ruff]
target-version = "py311"
line-length = 120
exclude = ["notebooks/**", "**/*.ipynb"]
[tool.ruff.lint]
select = ["E", "F", "I"]
ignore = [
"E501", # Line too Long
"F841", # Local variable is assigned to but never used
]
[tool.ruff.lint.isort]
known-first-party = ["pleiades"]
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
line-ending = "auto"
# ------------------------------ #
# ----- Pixi configuration ----- #
# ------------------------------ #
[tool.pixi.workspace]
channels = ["conda-forge"]
platforms = ["linux-64", "osx-arm64"]
[tool.pixi.pypi-dependencies]
pleiades = { path = ".", editable = true }
[tool.pixi.dependencies]
numpy = ">=2.2.5,<3"
scipy = ">=1.15.2,<2"
pandas = ">=2.2.3,<3"
matplotlib = ">=3.10.1,<4"
jupyterlab = ">=4.4.1,<5"
pyyaml = ">=6.0.2,<7"
pydantic = ">=2.11.3,<3"
loguru = ">=0.7.2,<0.8"
dxchange = ">=0.1.8,<0.2"
h5py = ">=3.13.0,<4"
tomopy = ">=1.14.4,<2"
[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 conda.recipe/noarch/*/*.tar.bz2", description = "Publish the package to conda", 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 tests --cov-branch --cov=src/pleiades --cov-report=term --cov-report=xml", description = "Run the tests" } # pytest config above takes care of the arguments
clean-test = { cmd = "rm -rf .pytest_cache .coverage coverage.xml", description = "Clean the test cache" }
# Development tasks
lint = { cmd = "ruff check .", description = "Run linting checks" }
format = { cmd = "ruff format .", description = "Format code with ruff" }
pre-commit-install = { cmd = "pre-commit install", description = "Install pre-commit hooks" }
pre-commit-run = { cmd = "pre-commit run --all-files", description = "Run pre-commit on all files" }
# Clean all
clean-all = { description = "Clean all build artifacts", depends-on = ["clean-pypi", "clean-conda", "clean-docs", "clean-test"] }
[tool.pixi.feature.test.dependencies]
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
pytest-repeat = "*"
[tool.pixi.feature.package.dependencies]
boa = "*"
anaconda-client = ">=1.13.0,<2"
conda-build = "*"
conda-verify = "*"
python-build = "*"
twine = ">=6.1.0,<7"
[tool.pixi.feature.developer.dependencies]
pip = "*"
versioningit = "*"
pre-commit = "*"
conda-tree = "*"
ruff = "*"
viztracer = ">=1.0.4,<2"
[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"]}
jupyter = {features = ["developer", "jupyter"]}