-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpixi.toml
More file actions
206 lines (161 loc) · 7.28 KB
/
pixi.toml
File metadata and controls
206 lines (161 loc) · 7.28 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
#######################
# 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}}"
PATH = "$HOME/Qt/6.9.1/macos/bin${PATH:+:${PATH}}"
# 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)
gsl = '*' # GNU Scientific Library; required for pdffit2.
[pypi-dependencies] # == [feature.default.pypi-dependencies]
pip = '*' # Native package installer
easyshapes_app = { path = ".", editable = true, extras = ['dev'] }
# Specific features: Set specific Python versions
[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.
# 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'
py-lint-check-pre = "python -m ruff check"
py-lint-check = 'pixi run py-lint-check-pre .'
py-format-check-pre = "python -m ruff format --check"
py-format-check = "pixi run py-format-check-pre ."
nonpy-format-check-pre = "npx prettier --list-different --config=prettierrc.toml"
nonpy-format-check-modified = "pixi run nonpy-format-check-pre $(git diff --diff-filter=d --name-only HEAD | grep -E '\\.(json|ya?ml|toml|md|css|html)$' || echo .)"
nonpy-format-check = "pixi run nonpy-format-check-pre ."
notebook-format-check = 'nbqa ruff docs/docs/tutorials/'
docs-format-check = 'docformatter src/ docs/docs/tutorials/ --check'
check = { depends-on = [
'docs-format-check',
'py-format-check',
'py-lint-check',
'nonpy-format-check-modified',
] }
# 🛠️ Fixes
py-lint-fix = 'pixi run py-lint-check --fix'
#py-format-fix = "python -m ruff format $(git diff --cached --name-only -- '*.py')"
py-format-fix = "python -m ruff format"
nonpy-format-fix = 'pixi run nonpy-format-check --write'
nonpy-format-fix-modified = "pixi run nonpy-format-check-modified --write"
notebook-format-fix = 'pixi run notebook-format-check --fix'
docs-format-fix = 'docformatter src/ docs/docs/tutorials/ --in-place'
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',
'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/easyshapes_app --cov-report=term-missing'
integration-tests-coverage = 'pixi run integration-tests --cov=src/easyshapes_app --cov-report=term-missing'
docstring-coverage = 'interrogate -c pyproject.toml src/easyshapes_app'
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 = 'pixi run python tools/update_docs_assets.py'
# 📦 Template Management Tasks
copier-copy = "pixi run copier copy gh:easyscience/templates . --data-file ../shapes/.copier-answers.yml --data template_type=app"
copier-recopy = "pixi run copier recopy --data-file ../shapes/.copier-answers.yml --data template_type=app"
copier-update = "pixi run copier update --data-file ../shapes/.copier-answers.yml --data template_type=app"
# 🚀 Development & Build Tasks
freeze = 'pixi run pyinstaller src/easyshapes_app/main.py --name=easyshapes --log-level WARN --noconfirm --clean --windowed --onedir --add-data=src/easyshapes_app:. --collect-all EasyApp'
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'
# Run like a real commit: staged files only (almost)
pre-commit-check = 'pre-commit run --hook-stage pre-commit'
# CI check: lint/format everything
pre-commit-check-all = 'pre-commit run --all-files --hook-stage pre-commit'
# Pre-push check: lint/format everything
pre-push-check = 'pre-commit run --all-files --hook-stage pre-push'
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',
] }
post-install = { depends-on = [
'npm-config',
'prettier-install',
'pre-commit-setup',
] }
# 🔗 Main Package Shortcut
easyshapes-py = 'python src/easyshapes_app/main.py'
easyshapes-qml = 'qml -I ../EasyApp/src/ -I src/easyshapes_app/ src/easyshapes_app/main.qml'