| 1 |
# Tox (https://tox.readthedocs.io/) is a tool for running tests |
| 2 |
# in multiple virtualenvs. This configuration file will run the |
| 3 |
# test suite on all supported python versions. To use it, "pip install tox" |
| 4 |
# and then run "tox -e [envname]" from this directory. |
| 5 |
|
| 6 |
[tox] |
| 7 |
requires = pip >= 22.0 |
| 8 |
|
| 9 |
[testenv] |
| 10 |
download = True |
| 11 |
setenv = |
| 12 |
PYTHONDONTWRITEBYTECODE = 1 |
| 13 |
VIRTUALENV_PIP = 23.3.1 |
| 14 |
recreate = |
| 15 |
pinned, minimum, upgraded, prerelease: False |
| 16 |
build, wheelinstall: True # good practice to recreate the environment |
| 17 |
skip_install = |
| 18 |
pinned, minimum, upgraded, prerelease, wheelinstall: False |
| 19 |
build: True # no need to install anything when building |
| 20 |
install_command = |
| 21 |
# when using [testenv:wheelinstall] and --installpkg, the wheel and its dependencies |
| 22 |
# are installed, instead of the package in the current directory |
| 23 |
pinned, minimum, wheelinstall: python -I -m pip install {opts} {packages} |
| 24 |
upgraded: python -I -m pip install -U {opts} {packages} |
| 25 |
prerelease: python -I -m pip install -U --pre {opts} {packages} |
| 26 |
deps = |
| 27 |
# use pinned, minimum, or neither (use dependencies in pyproject.toml) |
| 28 |
pytest, gallery: -rrequirements-dev.txt |
| 29 |
gallery: -rrequirements-doc.txt |
| 30 |
optional: -rrequirements-opt.txt |
| 31 |
pinned: -rrequirements.txt |
| 32 |
minimum: -rrequirements-min.txt |
| 33 |
commands = |
| 34 |
python --version # print python version for debugging |
| 35 |
python -m pip check # check for conflicting packages |
| 36 |
python -m pip list # list installed packages for debugging |
| 37 |
pytest: pytest -v |
| 38 |
gallery: python test_gallery.py |
| 39 |
build: python -m pip install -U build |
| 40 |
build: python -m build |
| 41 |
wheelinstall: python -c "import hdmf; import hdmf.common" |
| 42 |
|
| 43 |
# list of pre-defined environments. (Technically environments not listed here |
| 44 |
# like build-py312 can also be used.) |
| 45 |
[testenv:pytest-py312-upgraded] |
| 46 |
[testenv:pytest-py312-prerelease] |
| 47 |
[testenv:pytest-py311-optional-pinned] # some optional reqs not compatible with py312 yet |
| 48 |
[testenv:pytest-py{38,39,310,311,312}-pinned] |
| 49 |
[testenv:pytest-py38-minimum] |
| 50 |
|
| 51 |
[testenv:gallery-py312-upgraded] |
| 52 |
[testenv:gallery-py312-prerelease] |
| 53 |
[testenv:gallery-py311-optional-pinned] |
| 54 |
[testenv:gallery-py{38,39,310,311,312}-pinned] |
| 55 |
[testenv:gallery-py38-minimum] |
| 56 |
|
| 57 |
[testenv:build] # using tox for this so that we can have a clean build environment |
| 58 |
[testenv:wheelinstall] # use with `--installpkg dist/*-none-any.whl` |