forked from danse-inelastic/multiphonon
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpyproject.toml
More file actions
233 lines (204 loc) · 8.05 KB
/
pyproject.toml
File metadata and controls
233 lines (204 loc) · 8.05 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
[project]
name = "multiphonon"
description="Multiphonon scattering and multiple scattering correction for powder data"
dynamic = ["version"]
requires-python = ">=3.10"
dependencies = [
]
license = { text = "GPL-3.0-or-later" }
keywords= ["neutron, inelastic neutron scattering, powder, phonon"]
[project.urls]
homepage = "https://github.com/neutrons/multiphonon" # if no homepage, use repo url
[build-system]
requires = [
"hatchling",
"versioningit"
]
build-backend = "hatchling.build"
[tool.hatch.version]
source = "versioningit"
[tool.hatch.build]
artifacts = ["*.yml", "*.yaml", "*.json"]
[tool.hatch.build.hooks.versioningit-onbuild]
source-file = "src/multiphonon/_version.py"
build-file = "multiphonon/_version.py"
[tool.hatch.build.targets.wheel]
packages = ["src/multiphonon"]
[tool.versioningit.write]
file = "src/multiphonon/_version.py"
[tool.versioningit.vcs]
method = "git"
default-tag = "4.0.0"
[tool.versioningit.next-version]
method = "minor"
[tool.versioningit.format]
distance = "{next_version}.dev{distance}"
dirty = "{version}"
distance-dirty = "{next_version}.dev{distance}"
[tool.pytest.ini_options]
pythonpath = [
".","src",
]
testpaths = ["tests"]
python_files = ["test*.py", "*TestCase*.py"]
norecursedirs = [".git", "tmp*", "_tmp*", "__pycache__", "*dataset*", "*data_set*"]
markers = [
"needs_mantid: mark a test that needs mantid",
"needs_ipywe: mark a test that needs ipywe",
"creates_extra_files: mark a test that creates additional temporary files"
]
[tool.ruff]
line-length = 124
[tool.ruff.lint]
select = ["A", "ARG","ASYNC","BLE","C90", "D", "E", "F", "I", "N", "UP032", "W"]
ignore = ["D203", # 1 blank line required before class docstring, conflict with D211
"D213", # Multi-line docstring summary should start at the second line, conflict with D212
"D205", # 1 blank line required between summary line and description, conflict
# Unnecessary
"ANN201", # Missing return type annotation for public function
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood
"D404", # First word of the docstring should not be "This"
"D415", #First line should end with a period, question mark, or exclamation point
"F821", # Undefined name
# For Future to be included
"ARG001", # Unused function argument
"ARG002", # Unused method argument
"BLE001", # Do not catch blind exception
"N802", # Function name should be lowercase
"N803", # Argument name should be lowercase
"N806", # Variable {name} in function should be lowercase
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"D107", # Missing docstring in __init__
"D417", # Missing argument description in the docstring for {definition}: {name}
"N812", # Lowercase {name} imported as non-lowercase {asname}
"N815", # Variable in class scope should not be mixedCase
"N816", # Variable in global scope should not be mixedCase
"N818", # Exception name should be named with an Error suffix
"N999", # Invalid module name
"E731", # Do not assign a lambda expression, use a def
"E741", # Ambiguous variable name
"C901", # {name} is too complex ({complexity} > {max_complexity})
"F841", # Local variable is assigned to but never used
"E722", # Do not use bare except
]
exclude = ["docs/conf.py","tests/data/*"]
# ------------------ #
# Pixi configuration #
# ------------------ #
[tool.pixi.workspace]
preview = ["pixi-build"] # Need this to access pixi-build feature
platforms = ["linux-64"]
channels = [
"conda-forge",
"https://prefix.dev/pixi-build-backends",
"mantid-ornl",
"mantid",
"neutrons",
"neutrons/label/rc",
]
[tool.pixi.package]
name = "multiphonon"
version = "0.0.0" # placeholder, can be updated by task sync-version
[tool.pixi.package.build]
backend = { name = "pixi-build-python", version = "0.4.*" }
[tool.pixi.package.host-dependencies]
hatchling = "*"
versioningit = "*"
[tool.pixi.package.run-dependencies]
#dependencies for the conda package - for multiphonon to run
histogram = ">=0.4.3rc3"
pyside6 = ">=6.8.1"
numpy = ">=1.26.4"
scipy = ">=1.14.1"
mantid = ">=6.12.0.2"
ipywidgets = ">=8.1.7"
[tool.pixi.dependencies]
# Conda package dependencies for the local environment though pixi
histogram = ">=0.4.3rc3"
pyside6 = ">=6.8.1"
numpy = ">=1.26.4"
scipy = ">=1.14.1"
mantid = ">=6.12.0.2"
git-lfs = ">=3.7.0"
ipywidgets = ">=8.1.7"
[tool.pixi.pypi-dependencies]
# PyPI dependencies for the local environment though pixi
#including this package to allow local editable installs
multiphonon = { path = ".", editable = true }
[tool.pixi.environments]
#environment definitions with feature dependencies
default = { features = ["package", "developer","docs","test",], solve-group = "default" }
[tool.pixi.feature.package.dependencies]
#conda package
anaconda-client = ">=1.13.0"
check-wheel-contents = ">=0.6.2"
versioningit = ">=3.2.0"
hatch = "*"
#python package
pip = ">=26.0"
[tool.pixi.feature.package.pypi-dependencies]
toml-cli = "*"
#code analysis tools
[tool.pixi.feature.developer.dependencies]
pip = ">=26.0"
pip-audit = ">=2.9.0"
pre-commit = ">=4.2.0"
codecov = ">=2.1.13"
#readthedocs
[tool.pixi.feature.docs.dependencies]
sphinx = ">=8"
sphinx_rtd_theme = ">=3.0.1"
sphinxcontrib-mermaid = ">=1.0.0"
numpydoc = ">=1.9.0"
#pytest
[tool.pixi.feature.test.dependencies]
pytest = ">=8.4.1"
pytest-qt = ">=4.4.0"
pytest-cov = ">=6.2.1"
pytest-mock = ">=3.14.1"
pytest-xvfb = ">=3.1.1"
[tool.pixi.tasks]
# Documentation
build-docs = { cmd = 'sphinx-build -b html docs/ docs/_build/html', description = "Build documentation" }
test-docs = { cmd = "sphinx-build -M doctest docs/ docs/_build/html", description = "Test building the documentation" }
# Testing
test = { description = "Run the test suite", cmd = "pytest" }
# Packaging
pypi-sdist = { cmd = "hatch build -t sdist", description = "Build the source distribution (tar.gz)" }
pypi-wheel = { cmd = "hatch build -t wheel", description = "Build the wheel distribution" }
pypi-build = { description = "Build the packages for PyPI", depends-on = [
"pypi-sdist",
"pypi-wheel",
] }
pypi-publish = { cmd = "twine upload dist/*", description = "Publish the package to PyPI", depends-on = [
"pypi-build",
] }
pypi-publish-test = { cmd = "twine upload --repository testpypi dist/*", description = "Publish the package to TestPyPI", depends-on = [
"pypi-build",
] }
conda-build-command = { cmd = "pixi build", description = "Wrapper for building the conda package - used by `conda-build`" }
conda-build = { description = "Build the conda package", depends-on = [
"sync-version",
"conda-build-command",
"reset-version",
] }
conda-publish = { cmd = "anaconda upload *.conda", description = "Publish the .conda package to anaconda.org", depends-on = [
"conda-build",
] }
# Misc
audit-deps = { cmd = "pip-audit --local -s osv --ignore-vuln CVE-2026-34073", description = "Audit the package dependencies for vulnerabilities" }
clean = { cmd = 'rm -rf .pytest_cache .ruff_cache **/*.egg-info **/dist **/__pycache__ **/_version.py', description = "Clean up various caches and build artifacts" }
clean-conda = { cmd = "rm -f *.conda", description = "Clean the local .conda build artifacts" }
clean-docs = { cmd = "rm -rf docs/_build", description = "Clean up documentation build artifacts" }
clean-all = { description = "Clean all artifacts", depends-on = [
"clean",
"clean-conda",
"clean-docs",
] }
sync-version = { cmd = 'version=$(python -m versioningit); toml set tool.pixi.package.version "$version" --toml-path pyproject.toml', description = "Sync pyproject.toml version with Git version" }
reset-version = { cmd = "toml set tool.pixi.package.version \"0.0.0\" --toml-path pyproject.toml", description = "Reset the package version to 0.0.0" }