-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpixi.toml
More file actions
160 lines (130 loc) · 5.24 KB
/
pixi.toml
File metadata and controls
160 lines (130 loc) · 5.24 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
[workspace]
channels = [
"https://prefix.dev/pixi-build-backends",
"https://prefix.dev/conda-forge",
]
platforms = ["linux-64", "linux-aarch64", "osx-64", "osx-arm64", "win-64"]
preview = ["pixi-build"]
[workspace.build-variants]
python = ["3.12.*", "3.13.*", "3.14.*"]
[dependencies]
pkoffee = { path = "." }
[package]
name = "pkoffee"
version = "0.1.0"
authors = [
"Thomas Vuillaume <thomas.vuillaume@lapp.in2p3.fr>",
"Vincent Pollet <vincent.pollet@lapp.in2p3.fr>",
]
description = "S3School Pkoffe example package"
license = "MIT"
homepage = "https://github.com/s3-school/pkoffee-solution"
repository = "https://github.com/s3-school/pkoffee-solution"
documentation = "https://github.com/s3-school/pkoffee-solution/blob/main/README.md"
[package.build]
backend = { name = "pixi-build-python", version = ">=0.4.1,<5.0.0" }
[package.build.config]
[package.build-dependencies]
[package.host-dependencies]
# pixi build back-end calls uv or pip with "no-build-isolation" so build tools need to be available
# setuptools and other build tools should be host dependencies for now, see https://pixi.sh/latest/build/dependency_types/#python-code
uv = ">=0.9.9,<0.10.0"
uv-build = ">=0.9.9,<0.10.0"
[package.run-dependencies]
bidict = ">=0.23.1,<1"
python = "*"
numpy = ">=2.3.5,<3"
matplotlib-base = ">=3.10.8,<4"
pandas = ">=2.3.3,<3"
scipy = ">=1.16.3,<2"
seaborn = ">=0.13.2,<0.14"
tomlkit = ">=0.13.3,<1"
# A feature per-python version to test the build-variants
[feature.py312.dependencies]
python=">=3.12,<3.13"
[feature.py313.dependencies]
python=">=3.13,<3.14"
[feature.py314.dependencies]
python=">=3.14,<3.15"
[feature.test.dependencies]
# example task converts notebooks to markdown to include so they can be included in documentation
nbconvert = ">=7.16.6,<8"
pytest = ">=9,<10"
pytest-cov = ">=7,<8"
[feature.test.tasks.test]
args = [
{ "arg" = "coverage_dir", "default" = "htmlcov" },
{ "arg" = "cobertura_report", "default" = "cobertura_report.xml" },
{ "arg" = "junit_report", "default" = "junit_report.xml"}
]
cmd = "pytest -vv --cov-report=html:{{ coverage_dir }} --cov-report=xml:{{ cobertura_report }} --junitxml={{ junit_report }}"
[feature.test.tasks.run_on_snippets]
args = [{ "arg" = "name_match" }, { "arg" = "run_cmd" }, { "arg" = "snippets_dir" }]
cmd = "cd {{ snippets_dir }} && find . -maxdepth 1 -type f -name {{ name_match }} -exec {{ run_cmd }} '{}' ';'"
[feature.test.tasks.example]
args = [{ "arg" = "snippets_dir", "default" = "doc/doc_src/snippets" }]
depends-on = [{"task" = "run_on_snippets", "args" = ["*.ipynb", "jupyter nbconvert --to markdown --execute", "{{ snippets_dir }}",]},
{"task" = "run_on_snippets", "args" = ["*.py", "python", "{{ snippets_dir }}",]},
]
[feature.dev.dependencies]
jupyterlab = ">=4.4.3,<5"
ruff = ">=0.14,<0.15"
ty = ">=0.0.12,<0.0.13"
[feature.dev.tasks]
format = "ruff format"
lint = "ruff check"
type-check = "ty check src"
[feature.sphinx-doc.dependencies]
sphinx = ">=9.1.0,<10"
nbsphinx = ">=0.9.8,<0.10"
myst-parser = ">=5.0.0"
jupyter = ">=1.0.0,<2"
ipykernel = ">=6.0.0,<7"
[feature.sphinx-doc.pypi-dependencies]
sphinx-rtd-theme = ">=3.1.0, <4"
[feature.sphinx-doc.tasks]
sphinx-html = { cmd = "sphinx-build -b html docs build_docs", cwd = "." }
sphinx-clean = "rm -rf build_docs"
[tasks]
build-package = "python -m build"
[feature.paper.tasks]
outdir = { cmd = ["mkdir", "-p", "build"], outputs = ["build"] }
model-tex = { cmd = ["python", "paper/model_to_latex.py"], inputs = ["build/model.json", "model_to_latex.py"], depends-on = ["analyze"], outputs = ["build/model.tex"]}
[feature.paper.tasks.analyze]
cmd = ["pkoffee", "analyze", "-d", "analysis/coffee_productivity.csv", "-o", "build/model.json"]
inputs = ["analysis/coffee_productivity.csv"]
depends-on = ["outdir"]
outputs = ["build/model.json"]
[feature.paper.tasks.plots]
cmd = [
"pkoffee", "plot",
"-d", "analysis/coffee_productivity.csv",
"-m", "build/model.json",
"-o", "build/plot.pdf",
"--comparison", "build/comparison.pdf",
]
inputs = ["analysis/coffee_productivity.csv", "build/model.json"]
outputs = ["build/plot.pdf", "build/comparison.pdf"]
depends-on = ["analyze"]
[feature.paper.tasks.paper]
cmd = ["latexmk", "-norc", "-r", "paper/latexmkrc", "paper/paper.tex", "--output-directory=build"]
depends-on = ["plots", "model-tex"]
env = {TEXINPUTS = "paper:", BIBINPUTS="paper:"}
[environments]
prod = { features = ["py313", "paper"], solve-group = "prod" }
test = { features = ["test", "py313"], solve-group = "prod" }
# use default for the dev environment so tasks are resolved in this environment (avoids having to specify env)
# no need to include doc: pixi will figure the environment to use from the task if it is unique
default = { features = ["dev", "test", "py313"], solve-group = "prod" }
build = { solve-group = "prod" }
# python 3.14 environments for testing
prod314 = { features = ["py314"], solve-group = "prod314" }
testpy314 = { features = ["test", "py314"] }
# python 3.12 environments for testing
prod312 = { features = ["py312"], solve-group = "prod312" }
testpy312 = {features = ["test", "py312"] }
# Doc environment only contains documentation tools, not the package dependencies
sphinx-doc = { features = ["sphinx-doc", "py313"], solve-group = "prod" }
[pypi-dependencies]
build = ">=1.4.0, <2"
twine = ">=6.2.0, <7"