-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpixi.toml
More file actions
251 lines (193 loc) · 8.14 KB
/
pixi.toml
File metadata and controls
251 lines (193 loc) · 8.14 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
#######################
# 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-64', 'osx-arm64']
# Channels for fetching packages
channels = ['conda-forge']
##########
# FEATURES
##########
# Default feature configuration
[dependencies]
nodejs = '*' # Required for Prettier (non-Python formatting)
[pypi-dependencies] # == [feature.default.pypi-dependencies]
pip = '*' # Native package installer
easyutilities = { path = ".", editable = true, extras = ['dev'] }
# Specific features: Set specific Python versions
[feature.py-min.dependencies]
python = '3.11.*'
[feature.py-max.dependencies]
python = '3.13.*'
##############
# ENVIRONMENTS
##############
[environments]
# The `default` feature is always included in all environments.
# Additional features can be specified per environment.
py-311-env = { features = ['default', 'py-min'] }
py-313-env = { features = ['default', '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 = ['default', 'py-max'] }
#######
# TASKS
#######
[tasks]
##################
# 🧪 Testing Tasks
##################
unit-tests = 'python -m pytest tests/unit/ --color=yes -v'
integration-tests = 'python -m pytest tests/integration/ --color=yes -n auto -v'
notebook-tests = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=600 --color=yes -n auto -v'
script-tests = 'python -m pytest tools/test_scripts.py --color=yes -n auto -v'
test = { depends-on = ['unit-tests'] }
###########
# ✔️ Checks
###########
pyproject-check = 'python -m validate_pyproject pyproject.toml'
docs-format-check = 'docformatter --check src/ docs/docs/tutorials/'
notebook-format-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"
check = 'pre-commit run --hook-stage manual --all-files'
##########
# 🛠️ Fixes
##########
docs-format-fix = 'docformatter --in-place src/ docs/docs/tutorials/'
notebook-format-fix = 'nbqa ruff --fix docs/docs/tutorials/'
py-lint-fix = 'ruff check --fix 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"
success-message-fix = 'echo "✅ All code auto-formatting steps have been applied."'
fix = { depends-on = [
'py-format-fix',
'docs-format-fix',
'py-lint-fix',
'nonpy-format-fix',
'notebook-format-fix',
'success-message-fix',
] }
####################
# 🧮 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/easyutilities --cov-report=term-missing'
integration-tests-coverage = 'pixi run integration-tests --cov=src/easyutilities --cov-report=term-missing'
docstring-coverage = 'interrogate -c pyproject.toml src/easyutilities'
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 tutorials/'
notebook-exec = 'python -m pytest --nbmake docs/docs/tutorials/ --nbmake-timeout=600 --overwrite --color=yes -n auto -v'
notebook-prepare = { depends-on = [
#'notebook-convert',
'notebook-strip',
#'notebook-tweak',
] }
########################
# 📚 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 ../utils/.copier-answers.yml --data template_type=lib"
copier-recopy = "copier recopy --data-file ../utils/.copier-answers.yml --data template_type=lib"
copier-update = "copier update --data-file ../utils/.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/utils -f has_wiki=false'
repo-discussions = 'gh api -X PATCH repos/easyscience/utils -f has_discussions=true'
repo-description = "gh api -X PATCH repos/easyscience/utils -f description='Reusable utility classes and functions shared across EasyScience modules'"
repo-homepage = "gh api -X PATCH repos/easyscience/utils -f homepage='https://easyscience.github.io/utils'"
repo-config = { depends-on = [
'repo-wiki',
'repo-discussions',
'repo-description',
'repo-homepage',
] }
master-protection = 'gh api -X POST repos/easyscience/utils/rulesets --input .github/configs/rulesets-master.json'
develop-protection = 'gh api -X POST repos/easyscience/utils/rulesets --input .github/configs/rulesets-develop.json'
gh-pages-protection = 'gh api -X POST repos/easyscience/utils/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/utils/pages --input .github/configs/pages-deployment.json'
github-labels = 'python tools/update_github_labels.py'
####################################
# 🚀 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 '{}' +"
spdx-update = 'python tools/update_spdx.py'
post-install = { depends-on = [
'npm-config',
'prettier-install',
#'pre-commit-setup',
] }
##########################
# 🔗 Main Package Shortcut
##########################
easyutilities = 'python -m easyutilities'