-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
77 lines (71 loc) · 2.99 KB
/
tox.ini
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
[tox]
min_version = 4
requires = tox-uv
[testenv]
package = editable
deps =
{env:TOX_TESTENV_DEPS:-r requirements/test-python{py_dot_ver}.txt}
extras = test
set_env =
# Workaround matplotlib on windows server 2012 and gitlab-runner,
# matplotlib cannot access a registry key and falls back to the WINDIR var
# https://matplotlib.org/stable/api/font_manager_api.html#matplotlib.font_manager.win32FontDirectory.
WINDIR = {env:WINDIR:C:\Windows}
# Use a non GUI rendering backend for matplotlib.
MPLBACKEND = AGG
# Define pytest options for using coverage.
coverage: __COVERAGE_POSARGS=--cov --cov-report=xml --cov-report=html --no-cov-on-fail
pass_env =
# See gemseo developers docs.
GEMSEO_KEEP_IMAGE_COMPARISONS
commands =
pytest {env:__COVERAGE_POSARGS:} {posargs}
[testenv:check]
description = run code formatting and checking
deps = -r requirements/check.txt
skip_install = true
allowlist_externals = pre-commit
commands =
pre-commit install
pre-commit run --all-files
[testenv:doc]
description = build documentation
basepython = python3.9
deps = -r requirements/doc.txt
extras = doc
commands =
mkdocs serve
[testenv:dist]
description = create and check the pypi distribution
deps = -r requirements/dist.txt
skip_install = true
allowlist_externals = rm
commands =
rm -rf dist build
python -m build --wheel
twine check dist/*
# W002: ignore duplicated files.
check-wheel-contents dist --ignore W002
[testenv:pypi-py{39,310,311,312}]
description = test the pypi distribution
deps = gemseo-mlearning[test]
skip_install = true
[testenv:update-deps-{test,doc,dist,check}]
description = update the envs dependencies
set_env =
pass_env =
deps =
uv
check: pre-commit
skip_install = true
commands =
# Passing a posargs will ignore using gemseo from the develop branch and will use a release from PyPI instead.
test: uv pip compile --upgrade --extra test {posargs:--constraint requirements/test-constraints.in} -o requirements/test-python3.9.txt --python-version 3.9 pyproject.toml
test: uv pip compile --upgrade --extra test {posargs:--constraint requirements/test-constraints.in} -o requirements/test-python3.10.txt --python-version 3.10 pyproject.toml
test: uv pip compile --upgrade --extra test {posargs:--constraint requirements/test-constraints.in} -o requirements/test-python3.11.txt --python-version 3.11 pyproject.toml
test: uv pip compile --upgrade --extra test {posargs:--constraint requirements/test-constraints.in} -o requirements/test-python3.12.txt --python-version 3.12 pyproject.toml
# Using Python 3.9 for the doc should work everywhere.
doc: uv pip compile --upgrade --extra doc {posargs:--constraint requirements/test-constraints.in} -o requirements/doc.txt --python-version 3.9 pyproject.toml
dist: uv pip compile --upgrade requirements/dist.in -o requirements/dist.txt
check: uv pip compile --upgrade requirements/check.in -o requirements/check.txt
check: pre-commit autoupdate