forked from napari/napari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
168 lines (151 loc) · 4.84 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
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
# Tox (http://tox.testrun.org/) 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.
# NOTE: if you use conda for environments and an error like this:
# "ERROR: InterpreterNotFound: python3.8"
# then run `pip install tox-conda` to use conda to build environments
[tox]
# this is the list of tox "environments" that will run *by default*
# when you just run "tox" alone on the command line
# non-platform appropriate tests will be skipped
# to run a specific test, use the "tox -e" option, for instance:
# "tox -e py38-macos-pyqt" will test python3.8 with pyqt on macos
# (even if a combination of factors is not in the default envlist
# you can run it manually... like py39-linux-pyside2)
envlist = py{38,39,310,311}-{linux,macos,windows}-{pyqt5,pyside2,pyqt6,pyside6,headless}-{cov,no_cov},mypy
isolated_build = true
toxworkdir={env:TOX_WORK_DIR:/tmp/.tox}
[gh-actions]
python =
3.8: py38
3.9: py39
3.9.0: py390
3.10: py310
3.11: py311
fail_on_no_env = True
# This section turns environment variables from github actions
# into tox environment factors. This, combined with the [gh-actions]
# section above would mean that a test running python 3.9 on ubuntu-latest
# with an environment variable of BACKEND=pyqt would be converted to a
# tox env of `py39-linux-pyqt5`
[gh-actions:env]
RUNNER_OS =
Linux: linux
Windows: windows
macOS: macos
BACKEND =
pyqt5: pyqt5
pyqt6: pyqt6
pyside2: pyside2
pyside6: pyside6
headless: headless
COVERAGE =
cov: cov
no_cov: no_cov
# Settings defined in the top-level testenv section are automatically
# inherited by individual environments unless overridden.
[testenv]
platform =
macos: darwin
linux: linux
windows: win32
# These environment variables will be passed from the calling environment
# to the tox environment
passenv =
CI
GITHUB_ACTIONS
DISPLAY
XAUTHORITY
NUMPY_EXPERIMENTAL_ARRAY_FUNCTION
PYVISTA_OFF_SCREEN
MIN_REQ
CONDA_EXE
CONDA
FORCE_COLOR
QT_QPA_PLATFORM
NAPARI_TEST_SUBSET
COVERAGE_*
COVERAGE
# Set various environment variables, depending on the factors in
# the tox environment being run
setenv =
PYTHONPATH = {toxinidir}
# Avoid pyside6 6.4.3 due to issue described in:
# https://github.com/napari/napari/issues/5657
deps =
pyqt6: PyQt6
pyside6: PySide6 < 6.3.2 ; python_version < '3.10'
pyside6: PySide6 != 6.4.3, !=6.5.0 ; python_version >= '3.10'
pytest-json-report
pytest-pystack ; sys_platform == 'linux'
# use extras specified in setup.cfg for certain test envs
extras =
testing
{env:TOX_EXTRAS}
pyqt5: pyqt5
pyside2: pyside2
allowlist_externals =
echo
mypy
indexserver =
# we use Spec 4 index server that contain nightly wheel.
# this will be used only when using --pre with tox/pip as it only contains nightly.
extra = https://pypi.anaconda.org/scientific-python-nightly-wheels/simple
commands =
echo "COVERAGE: {env:COVERAGE:}"
cov: coverage run \
!cov: python \
-m pytest {env:PYTEST_PATH:} --color=yes --basetemp={envtmpdir} \
--ignore tools --maxfail=5 --json-report \
--json-report-file={toxinidir}/report-{envname}.json {posargs}
[testenv:py{38,39,310,311}-{linux,macos,windows}-headless-{cov,no_cov}]
commands_pre =
pip uninstall -y pyautogui pytest-qt qtpy pyqt5 pyside2 pyside6 pyqt6
commands =
cov: coverage run \
!cov: python \
-m pytest --color=yes --basetemp={envtmpdir} --ignore napari/_vispy \
--ignore napari/_qt --ignore napari/_tests --ignore tools \
--json-report --json-report-file={toxinidir}/report-{envname}.json {posargs}
[testenv:py{38,39,310,311}-{linux,macos,windows}-{pyqt5,pyside2,pyqt6,pyside6}-examples-{cov,no_cov}]
deps =
# For surface_timeseries_.py example
nilearn
# Due to nilearn incompatibility with numpy >=1.24 constraint numpy and add packaging for version check
numpy < 1.24
packaging
commands =
cov: coverage run \
!cov: python \
-m pytest napari/_tests/test_examples.py -v --color=yes --basetemp={envtmpdir} {posargs}
[testenv:ruff]
skip_install = True
deps = pre-commit
commands = pre-commit run ruff --all-files
[testenv:black]
skip_install = True
deps = pre-commit
commands = pre-commit run black --all-files
[testenv:import-lint]
skip_install = True
deps = pre-commit
commands = pre-commit run --hook-stage manual import-linter --all-files
[testenv:package]
isolated_build = true
skip_install = true
deps =
check_manifest
wheel
twine
build
commands =
check-manifest
python -m build
python -m twine check dist/*
[testenv:mypy]
deps =
-r resources/requirements_mypy.txt
commands =
mypy --config-file pyproject.toml
skip_install = true