-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathpixi.toml
243 lines (230 loc) · 8.71 KB
/
pixi.toml
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
[project]
name = "Ribasim"
version = "2024.11.0"
description = "Water resources modeling"
authors = ["Deltares and contributors <[email protected]>"]
channels = ["conda-forge"]
platforms = ["win-64", "linux-64", "osx-arm64"]
readme = "README.md"
license = "MIT"
license-file = "LICENSE"
homepage = "https://ribasim.org/"
documentation = "https://ribasim.org/"
repository = "https://github.com/Deltares/Ribasim"
[tasks]
# Tests
test-ribasim-python = "pytest --numprocesses=4 -m 'not regression' python/ribasim/tests"
test-ribasim-python-cov = "pytest --numprocesses=4 --cov=ribasim --cov-report=xml -m 'not regression' python/ribasim/tests"
test-ribasim-api = "pytest --basetemp=python/ribasim_api/tests/temp --junitxml=report.xml python/ribasim_api/tests"
[feature.dev.tasks]
# Installation
install-julia = "juliaup add 1.10.7 && juliaup override set 1.10.7"
install-pre-commit = "pre-commit install"
# Note that this has a Windows specific override
install-ci = { depends-on = ["install-julia", "update-registry-julia"] }
install = { depends-on = [
"install-ci",
"install-qgis-plugins",
"install-pre-commit",
] }
# Julia
# Clear SSL_CERT_DIR to avoid Julia warnings, see https://github.com/JuliaLang/Downloads.jl/issues/244
update-registry-julia = { cmd = "julia --eval='using Pkg; Registry.update()'", env = { SSL_CERT_DIR = "" } }
update-manifest-julia = { cmd = "julia --project --eval='using Pkg; Pkg.update()'", env = { SSL_CERT_DIR = "" } }
instantiate-julia = { cmd = "julia --project --eval='using Pkg; Pkg.instantiate()'", env = { SSL_CERT_DIR = "" } }
initialize-julia = { depends-on = [
"update-registry-julia",
"instantiate-julia",
] }
# Docs
quartodoc-build = { cmd = "quartodoc build && rm objects.json", cwd = "docs", inputs = [
"docs/_quarto.yml",
"python/ribasim",
], outputs = [
"docs/reference/python",
] }
quarto-preview = { cmd = "quarto preview docs", depends-on = [
"quartodoc-build",
"generate-testmodels",
] }
quarto-check = { cmd = "quarto check all", depends-on = ["quartodoc-build"] }
quarto-render = { cmd = "julia --project --eval 'using Pkg; Pkg.build(\"IJulia\")' && quarto render docs --to html --execute", depends-on = [
"quartodoc-build",
"generate-testmodels",
] }
docs = { depends-on = ["quarto-preview"] }
# Lint
mypy-ribasim-python = "mypy python/ribasim/ribasim"
mypy-ribasim-testmodels = "mypy python/ribasim_testmodels/ribasim_testmodels"
mypy-ribasim-api = "mypy python/ribasim_api/ribasim_api"
pre-commit = "pre-commit run --all-files"
lint = { depends-on = [
"pre-commit",
"mypy-ribasim-python",
"mypy-ribasim-testmodels",
"mypy-ribasim-api",
"mypy-ribasim-qgis",
] }
# Build
build = { "cmd" = "julia --project build.jl", cwd = "build", depends-on = [
"generate-testmodels",
"initialize-julia",
], env = { SSL_CERT_DIR = "", JULIA_SSL_CA_ROOTS_PATH = "" } }
remove-artifacts = "julia --eval 'rm(joinpath(Base.DEPOT_PATH[1], \"artifacts\"), force=true, recursive=true)'"
# Tests
test-ribasim-cli = "pytest --numprocesses=4 --basetemp=build/tests/temp --junitxml=report.xml build/tests"
test-ribasim-core = { cmd = "julia --project=core --eval 'using Pkg; Pkg.test()'", depends-on = [
"generate-testmodels",
] }
test-ribasim-migration = { cmd = "pytest --numprocesses=4 -m regression python/ribasim/tests" }
test-ribasim-core-cov = { cmd = "julia --project=core --eval 'using Pkg; Pkg.test(coverage=true, julia_args=[\"--check-bounds=yes\"])'", depends-on = [
"generate-testmodels",
] }
test-ribasim-regression = { cmd = "julia --project=core --eval 'using Pkg; Pkg.test(julia_args=[\"--check-bounds=yes\"], test_args=[\"regression\"])'", depends-on = [
"generate-testmodels",
"test-ribasim-migration",
] }
generate-testmodels = { cmd = "python utils/generate-testmodels.py", inputs = [
"python/ribasim",
"python/ribasim_testmodels",
"utils/generate-testmodels.py",
], outputs = [
"generated_testmodels",
] }
tests = { depends-on = ["lint", "test-ribasim-python", "test-ribasim-core"] }
delwaq = { cmd = "pytest python/ribasim/tests/test_delwaq.py" }
gen-delwaq = { cmd = "python python/ribasim/ribasim/delwaq/generate.py" }
model-integration-test = { cmd = "julia --project=core --eval 'using Pkg; Pkg.test(test_args=[\"integration\"])'" }
# Codegen
codegen = { cmd = "julia --project utils/gen_python.jl && ruff format python/ribasim/ribasim/schemas.py python/ribasim/ribasim/validation.py", depends-on = [
"initialize-julia",
], inputs = [
"core",
"utils",
], outputs = [
"python/ribasim/ribasim/schemas.py",
"python/ribasim/ribasim/validation.py",
] }
# Publish
add-ribasim-icon = { cmd = "rcedit build/ribasim/ribasim.exe --set-icon docs/assets/ribasim.ico" }
build-ribasim-python-wheel = { cmd = "rm --recursive --force dist && hatch build && twine check dist/*", cwd = "python/ribasim" }
build-ribasim-api-wheel = { cmd = "rm --recursive --force dist && hatch build && twine check dist/*", cwd = "python/ribasim_api" }
build-wheels = { depends-on = [
"build-ribasim-python-wheel",
"build-ribasim-api-wheel",
] }
publish-ribasim-python = { cmd = "twine upload dist/*", cwd = "python/ribasim", depends-on = [
"build-ribasim-python-wheel",
] }
publish-ribasim-api = { cmd = "twine upload dist/*", cwd = "python/ribasim_api", depends-on = [
"build-ribasim-api-wheel",
] }
# QGIS
qgis = "qgis --profiles-path .pixi/qgis_env"
install-ribasim-qgis = "python ribasim_qgis/scripts/install_ribasim_qgis.py"
install-imod-qgis = "python ribasim_qgis/scripts/install_qgis_plugin.py iMOD && python ribasim_qgis/scripts/enable_plugin.py imodqgis"
install-plugin-reloader-qgis = "python ribasim_qgis/scripts/install_qgis_plugin.py \"Plugin Reloader\" && python ribasim_qgis/scripts/enable_plugin.py plugin_reloader"
install-debugvs-qgis = "python ribasim_qgis/scripts/install_qgis_plugin.py debugvs==0.7 && python ribasim_qgis/scripts/enable_plugin.py debug_vs"
test-ribasim-qgis-docker = { cmd = "sh ./start.sh; sh ./test.sh; sh ./stop.sh", cwd = ".docker" }
install-qgis-plugins = { depends-on = [
"install-plugin-reloader-qgis",
"install-ribasim-qgis",
"install-imod-qgis",
"install-debugvs-qgis",
] }
test-ribasim-qgis-ui = { cmd = "python ribasim_qgis/scripts/run_qgis_ui_tests.py", depends-on = [
"install-ribasim-qgis",
] }
test-ribasim-qgis = { cmd = "pytest --numprocesses=auto ribasim_qgis/tests/core", depends-on = [
"install-ribasim-qgis",
] }
test-ribasim-qgis-cov = { cmd = "pytest --numprocesses=auto --cov=ribasim_qgis --cov-report=xml --cov-config=ribasim_qgis/.coveragerc ribasim_qgis/tests/core", depends-on = [
"install-ribasim-qgis",
] }
mypy-ribasim-qgis = "mypy ribasim_qgis"
# Run
ribasim-core = { cmd = "julia --project=core -e 'using Ribasim; Ribasim.main(ARGS)'", depends-on = [
"initialize-julia",
] }
ribasim-core-testmodels = { cmd = "julia --project --threads=4 utils/testmodelrun.jl", depends-on = [
"generate-testmodels",
"initialize-julia",
] }
# Release
github-release = "python utils/github-release.py"
[feature.dev.target.win.tasks]
# Workaround rare issue on Windows where the permissions of the artifacts directory are incorrect
# Upstream issue: https://github.com/JuliaLang/julia/issues/52272
reset-artifact-permissions = "icacls $homedrive/$homepath/.julia/artifacts /q /c /t /reset"
install-ci = { depends-on = [
# "reset-artifact-permissions", # see #1972
"install-julia",
"update-registry-julia",
] }
[dependencies]
geopandas = "*"
hatchling = "*"
ipykernel = ">=6.29"
ipywidgets = ">=8.1.3,<8.2"
jinja2 = "*"
matplotlib = "*"
minio = "*"
netcdf4 = "*"
networkx = ">=3.3"
numpy = "*"
pandas = "*"
pandas-stubs = "*"
pandera = ">=0.20"
pip = "*"
pyarrow = "*"
pydantic = ">=2"
pyogrio = "*"
pytest = "*"
pytest-cov = "*"
pytest-xdist = "*"
python = ">=3.10"
shapely = ">=2.0"
teamcity-messages = "*"
tomli = "*"
tomli-w = "*"
xarray = "*"
xmipy = "*"
xugrid = "*"
[pypi-dependencies]
ribasim = { path = "python/ribasim", editable = true }
ribasim_api = { path = "python/ribasim_api", editable = true }
ribasim_testmodels = { path = "python/ribasim_testmodels", editable = true }
[feature.dev.dependencies]
gh = "*"
hatch = "*"
juliaup = "*"
jupyterlab = "*"
libgdal-arrow-parquet = "*"
mypy = "*"
pre-commit = "*"
pyqt-stubs = "*"
qgis = ">=3.34"
qgis-plugin-manager = "*"
quarto = "*"
quartodoc = "*"
ruff = "*"
rust = "*"
twine = "*"
[feature.dev.pypi-dependencies]
ptvsd = "*"
[feature.py312.dependencies]
python = "3.12.*"
[feature.py311.dependencies]
python = "3.11.*"
[feature.py310.dependencies]
python = "3.10.*"
[target.win-64.dependencies]
rcedit = "*"
[environments]
default = { features = ["py312"], solve-group = "py312" }
dev = { features = ["py312", "dev"], solve-group = "py312" }
py312 = { features = ["py312"], solve-group = "py312" }
py311 = ["py311"]
py310 = ["py310"]
[system-requirements]
linux = "3.10.0"