-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtox.ini
More file actions
52 lines (45 loc) · 2.01 KB
/
Copy pathtox.ini
File metadata and controls
52 lines (45 loc) · 2.01 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
# tox (https://tox.readthedocs.io/) is a tool for running tests
# in multiple virtualenvs. This configuration file will run the
# test suite on all supported python versions. To use it, "pip install tox"
# and then run "tox" from this directory.
# Python 3.6 was the version deployed on Ubuntu 18.04
# Python 3.8 was the version deployed on Ubuntu 20.04 servers such as triscotte
# Python 3.10 is the version deployed on the Ubuntu 22.04 master
# Python 3.12 is the version deployed on the Ubuntu 24.04 master
# Python 3.13 will be the version deployed on the Ubuntu 26.04 master
[tox]
envlist = py310, py312, cov, codestyle
[gh-actions]
python =
3.10: py310, codestyle, cov
3.12: py312
[testenv]
deps =
pip-tools
-crequirements/py{py_dot_ver}-production.txt
-crequirements/py{py_dot_ver}-test.txt
# 'python -m piptools sync' guarantees that the test environment only contains
# pinned dependencies (it will uninstall dependencies that are not in
# requirements/*.txt). We have to first install pip-tools, then use it to
# install the dependencies, and finally install the neurospin-to-bids package.
# Passing multiple commands as part of install_command does not seem to work,
# neither does substitution of {opts} and {packages}, so I had to resort to an
# ugly hack using sh -c... (YL 2025-03-05 using tox 4.24.1)
allowlist_externals = sh
install_command =
sh -c 'python -I -m pip install -U pip pip-tools && python -m piptools sync requirements/py{py_dot_ver}-production.txt requirements/py{py_dot_ver}-test.txt && python -I -m pip install "$@"' -
commands = pytest {posargs}
[testenv:cov]
commands = pytest --cov --cov-config=pyproject.toml \
--cov-report=term --cov-report=xml {posargs}
deps =
{[testenv]deps}
pytest-cov
[testenv:codestyle]
# pre-commit needs to clone Git repositories over https
passenv = http_proxy,https_proxy,no_proxy
# do not inherit the piptools command
install_command = python -I -m pip install {opts} {packages}
commands = pre-commit run --all-files
deps =
pre-commit