-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpixi.toml
More file actions
294 lines (230 loc) ยท 9.91 KB
/
pixi.toml
File metadata and controls
294 lines (230 loc) ยท 9.91 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
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
#######################
# ENVIRONMENT VARIABLES
#######################
# Platform-independent
[activation.env]
PYTHONIOENCODING = 'utf-8'
# Platform-specific
# Ensures the main package is used from the source code during
# development, even if main package is installed in editable mode
# via uv. This is important because `pixi update` might replace
# the installed version with the latest released version.
# Unix/macOS
[target.unix.activation.env]
PYTHONPATH = "${PIXI_PROJECT_ROOT}/src${PYTHONPATH:+:${PYTHONPATH}}"
# Windows
[target.win.activation.env]
PYTHONPATH = "${PIXI_PROJECT_ROOT}/src;%PYTHONPATH%"
###########
# WORKSPACE
###########
[workspace]
# Supported platforms for the lock file (pixi.lock)
platforms = ['win-64', 'linux-64', 'osx-arm64']
# Channels for fetching packages
channels = ['conda-forge']
#####################
# SYSTEM REQUIREMENTS
#####################
[system-requirements]
# Set minimum supported version for macOS to be 14.0 to ensure packages
# like `skipp` that only have wheels for macOS 14.0+ (macosx_14_0_arm64)
# are used instead of building from source. This is a workaround for
# Pixi, see https://github.com/prefix-dev/pixi/issues/5667
macos = '14.0'
# Set minimum supported version for glibc to be 2.35 to ensure packages
# like `crysfml` that only have wheels for glibc 2.35+
# (manylinux_2_35_x86_64) are used.
#libc = { family = 'glibc', version = '2.35' }
libc = '2.35'
##########
# FEATURES
##########
# Default feature configuration
[dependencies]
nodejs = '*' # Required for Prettier (non-Python formatting)
jupyterlab = '*' # Jupyter notebooks
pixi-kernel = '*' # Pixi Jupyter kernel
gsl = '*' # GNU Scientific Library; required for diffpy.pdffit2
[pypi-dependencies] # == [feature.default.pypi-dependencies]
pip = '*' # Native package installer
#pycrysfml = { version = ">=0.4.0", index = "https://easyscience.github.io/pypi/" }
easydiffraction = { path = '.', editable = true, extras = ['dev'] }
# Specific features: Set specific Python versions
[feature.py-min.dependencies]
python = '3.12.*'
[feature.py-max.dependencies]
python = '3.14.*'
##############
# ENVIRONMENTS
##############
[environments]
# The `default` feature is always included in all environments.
# Additional features can be specified per environment.
py-312-env = { features = ['py-min'] }
py-314-env = { features = ['py-max'] }
# The `default` environment is always created and includes the `default` feature.
# It does not need to be specified explicitly unless non-default features are included.
default = { features = ['py-max'] }
#######
# TASKS
#######
[tasks]
##################
# ๐งช Testing Tasks
##################
unit-tests = 'python -m pytest tests/unit/ --color=yes -v'
functional-tests = 'python -m pytest tests/functional/ --color=yes -v'
integration-tests = 'python -m pytest tests/integration/ --color=yes -n auto -v'
script-tests = 'python -m pytest tools/test_scripts.py --color=yes -n auto -v'
notebook-tests = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=1200 --color=yes -n auto -v'
test = { depends-on = ['unit-tests', 'functional-tests'] }
test-all = { depends-on = [
'unit-tests',
'functional-tests',
'integration-tests',
'script-tests',
] }
###########
# โ๏ธ Checks
###########
pyproject-check = 'python -m validate_pyproject pyproject.toml'
docstring-lint-check = 'pydoclint --quiet src/'
notebook-lint-check = 'nbqa ruff docs/docs/tutorials/'
py-lint-check = 'ruff check src/ tests/ docs/docs/tutorials/'
py-format-check = 'ruff format --check src/ tests/ docs/docs/tutorials/'
nonpy-format-check = 'npx prettier --list-different --config=prettierrc.toml --ignore-unknown .'
nonpy-format-check-modified = 'python tools/nonpy_prettier_modified.py'
test-structure-check = 'python tools/test_structure_check.py'
check = 'pre-commit run --hook-stage manual --all-files'
##########
# ๐ ๏ธ Fixes
##########
docstring-transform = 'pixi run docstripy src/ -s=numpy -w'
docstring-format-fix = 'format-docstring src/'
notebook-lint-fix = 'nbqa ruff --fix docs/docs/tutorials/'
py-lint-fix = 'ruff check --fix src/ tests/ docs/docs/tutorials/'
py-lint-fix-unsafe = 'ruff check --fix --unsafe-fixes src/ tests/ docs/docs/tutorials/'
py-format-fix = 'ruff format src/ tests/ docs/docs/tutorials/'
nonpy-format-fix = 'npx prettier --write --list-different --config=prettierrc.toml --ignore-unknown .'
nonpy-format-fix-modified = 'python tools/nonpy_prettier_modified.py --write'
update-package-diagrams = 'python tools/generate_package_docs.py'
success-message = 'echo "โ
All auto-formatting steps completed successfully!"'
fix = { depends-on = [
#'param-docstring-fix', # ED only
'docstring-format-fix',
'py-format-fix',
'py-lint-fix',
'nonpy-format-fix',
'notebook-lint-fix',
'update-package-diagrams',
'success-message',
] }
####################
# ๐งฎ Code Complexity
####################
complexity-check = 'radon cc -s src/'
complexity-check-json = 'radon cc -s -j src/'
maintainability-check = 'radon mi src/'
maintainability-check-json = 'radon mi -j src/'
raw-metrics = 'radon raw -s src/'
raw-metrics-json = 'radon raw -s -j src/'
#############
# ๐ Coverage
#############
unit-tests-coverage = 'pixi run unit-tests --cov=src/easydiffraction --cov-report=term-missing'
functional-tests-coverage = 'pixi run functional-tests --cov=src/easydiffraction --cov-report=term-missing'
integration-tests-coverage = 'pixi run integration-tests --cov=src/easydiffraction --cov-report=term-missing'
docstring-coverage = 'interrogate -c pyproject.toml src/easydiffraction'
cov = { depends-on = [
'docstring-coverage',
'unit-tests-coverage',
'integration-tests-coverage',
] }
########################
# ๐ Notebook Management
########################
notebook-convert = 'jupytext docs/docs/tutorials/*.py --from py:percent --to ipynb'
notebook-strip = 'nbstripout docs/docs/tutorials/*.ipynb'
notebook-tweak = 'python tools/tweak_notebooks.py docs/docs/tutorials/'
notebook-exec = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=1200 --overwrite --color=yes -n auto -v'
notebook-prepare = { depends-on = [
'notebook-convert',
'notebook-tweak',
'notebook-strip',
] }
########################
# ๐ Documentation Tasks
########################
docs-vars = "JUPYTER_PLATFORM_DIRS=1 PYTHONWARNINGS='ignore::RuntimeWarning'"
docs-pre = 'pixi run docs-vars python -m mkdocs'
docs-serve = 'pixi run docs-pre serve -f docs/mkdocs.yml'
docs-serve-dirty = 'pixi run docs-serve --dirty'
docs-build = 'pixi run docs-pre build -f docs/mkdocs.yml'
docs-build-local = 'pixi run docs-build --no-directory-urls'
docs-deploy-pre = 'mike deploy -F docs/mkdocs.yml --push --branch gh-pages --update-aliases --alias-type redirect'
docs-set-default-pre = 'mike set-default -F docs/mkdocs.yml --push --branch gh-pages'
docs-update-assets = 'python tools/update_docs_assets.py'
##############################
# ๐ฆ Template Management Tasks
##############################
copier-copy = 'copier copy gh:easyscience/templates . --data-file ../diffraction/.copier-answers.yml --data template_type=lib'
copier-recopy = 'copier recopy --data-file ../diffraction/.copier-answers.yml --data template_type=lib'
copier-update = 'copier update --data-file ../diffraction/.copier-answers.yml --data template_type=lib'
#####################
# ๐ช Pre-commit Hooks
#####################
pre-commit-clean = 'pre-commit clean'
pre-commit-install = 'pre-commit install --hook-type pre-commit --hook-type pre-push --overwrite'
pre-commit-uninstall = 'pre-commit uninstall --hook-type pre-commit --hook-type pre-push'
pre-commit-setup = { depends-on = [
'pre-commit-clean',
'pre-commit-uninstall',
'pre-commit-install',
] }
#################
# ๐๏ธ GitHub Tasks
#################
repo-wiki = 'gh api -X PATCH repos/easyscience/diffraction-lib -f has_wiki=false'
repo-discussions = 'gh api -X PATCH repos/easyscience/diffraction-lib -f has_discussions=true'
repo-description = "gh api -X PATCH repos/easyscience/diffraction-lib -f description='Diffraction data analysis'"
repo-homepage = "gh api -X PATCH repos/easyscience/diffraction-lib -f homepage='https://easyscience.github.io/diffraction-lib'"
repo-config = { depends-on = [
'repo-wiki',
'repo-discussions',
'repo-description',
'repo-homepage',
] }
master-protection = 'gh api -X POST repos/easyscience/diffraction-lib/rulesets --input .github/configs/rulesets-master.json'
develop-protection = 'gh api -X POST repos/easyscience/diffraction-lib/rulesets --input .github/configs/rulesets-develop.json'
gh-pages-protection = 'gh api -X POST repos/easyscience/diffraction-lib/rulesets --input .github/configs/rulesets-gh-pages.json'
branch-protection = { depends-on = [
'master-protection',
'develop-protection',
'gh-pages-protection',
] }
pages-deployment = 'gh api -X POST repos/easyscience/diffraction-lib/pages --input .github/configs/pages-deployment.json'
github-labels = 'python tools/update_github_labels.py'
#########################
# โ๏ธ SPDX License Headers
#########################
license-remove = 'python tools/license_headers.py remove src/ tests/ --exclude-from-pyproject-toml tool.ruff.exclude'
license-add = 'python tools/license_headers.py add src/ tests/ --exclude-from-pyproject-toml tool.ruff.exclude'
license-check = 'python tools/license_headers.py check src/ tests/ --exclude-from-pyproject-toml tool.ruff.exclude'
####################################
# ๐ Other Development & Build Tasks
####################################
default-build = 'python -m build'
dist-build = 'python -m build --wheel --outdir dist'
npm-config = 'npm config set registry https://registry.npmjs.org/'
prettier-install = 'npm install --no-save --no-audit --no-fund prettier prettier-plugin-toml'
clean-pycache = "find . -type d -name '__pycache__' -prune -exec rm -rf '{}' +"
post-install = { depends-on = [
'npm-config',
'prettier-install',
#'pre-commit-setup',
] }
##########################
# ๐ Main Package Shortcut
##########################
easydiffraction = 'python -m easydiffraction'