forked from napari/napari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
122 lines (109 loc) · 3.52 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
# 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.7"
# 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-async)
envlist = py{37,38,39}-{linux,macos,windows}-{pyqt,pyside}
toxworkdir=/tmp/.tox
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
3.9.0: py390
# 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]
PLATFORM =
ubuntu-latest: linux
ubuntu-16.04: linux
ubuntu-18.04: linux
ubuntu-20.04: linux
windows-latest: windows
macos-latest: macos
macos-11.0: macos
BACKEND =
pyqt: pyqt
pyside: pyside
headless: headless
# 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
# Set various environment variables, depending on the factors in
# the tox environment being run
setenv =
PYTHONPATH = {toxinidir}
async: NAPARI_ASYNC = 1
async: PYTEST_ADDOPTS = --async_only
async: PYTEST_PATH = napari
conda_deps =
# use conda to install numcodecs on mac py3.9
py39-macos: numcodecs
py390-macos: numcodecs
conda_channels =
conda-forge
deps =
pytest-xvfb ; sys_platform == 'linux'
pytest-cov
# use extras specified in setup.cfg for certain test envs
extras =
testing
pyqt: pyqt5
pyside: pyside2
commands_pre =
# strictly only need to uninstall pytest-qt (which will raise without a backend)
# the rest is for good measure
headless: pip uninstall -y pytest-qt qtpy pyqt5 pyside2
commands =
!headless: pytest {env:PYTEST_PATH:} --color=yes --basetemp={envtmpdir} --cov-report=xml --cov={env:PYTEST_PATH:napari} --ignore tools {posargs}
headless: pytest --color=yes --basetemp={envtmpdir} --ignore napari/_vispy --ignore napari/_qt --ignore napari/_tests --ignore tools {posargs}
[testenv:isort]
skip_install = True
deps = pre-commit
commands = pre-commit run isort --all-files
[testenv:flake8]
skip_install = True
deps = pre-commit
commands = pre-commit run flake8 --all-files
[testenv:black]
skip_install = True
deps = pre-commit
commands = pre-commit run black --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/*