| 1 | [tox] |
| 2 | envlist = lint,typing,py310,py311,py312,py313,py314,pypy3,minimal |
| 3 | skip_missing_interpreters = True |
| 4 | isolated_build = True |
| 5 | minversion = 3.3.0 |
| 6 | |
| 7 | [testenv] |
| 8 | deps = |
| 9 | pytest |
| 10 | pytest-cov |
| 11 | pytest-rerunfailures |
| 12 | -e .[all] |
| 13 | commands = |
| 14 | pytest {posargs} test |
| 15 | passenv = USER |
| 16 | |
| 17 | [testenv:lint] |
| 18 | deps = |
| 19 | flake8 |
| 20 | flake8-bugbear |
| 21 | flake8-builtins |
| 22 | flake8-unused-arguments |
| 23 | commands = |
| 24 | flake8 src test |
| 25 | |
| 26 | [testenv:typing] |
| 27 | deps = |
| 28 | mypy |
| 29 | data-science-types # TODO replace archived, https://github.com/wearepal/data-science-types |
| 30 | types-PyYAML |
| 31 | {[testenv]deps} |
| 32 | commands = |
| 33 | mypy src test |
| 34 | |
| 35 | [testenv:minimal] |
| 36 | description = Test with minimal dependencies (no optional extras) |
| 37 | deps = |
| 38 | pytest |
| 39 | pytest-cov |
| 40 | pytest-rerunfailures |
| 41 | -e . |
| 42 | commands = |
| 43 | pytest {posargs} test |
| 44 | |
| 45 | [testenv:oldestdeps] |
| 46 | description = Test with oldest compatible dependency versions |
| 47 | basepython = python3.10 |
| 48 | allowlist_externals = uv |
| 49 | deps = |
| 50 | pytest |
| 51 | pytest-cov |
| 52 | pytest-rerunfailures |
| 53 | commands = |
| 54 | # numpy<2 required because matplotlib 3.5 was compiled against numpy 1.x |
| 55 | # numpy>=1.21.3 is first with Python 3.10 wheels |
| 56 | uv pip install --resolution lowest-direct -e .[all] "numpy>=1.21.3,<2" |
| 57 | pytest {posargs} test |
| 58 | |
| 59 | |
| 60 | [flake8] |
| 61 | doctests = True |
| 62 | exclude = .*/,build/,dist/,test/data,venv/ |
| 63 | max-line-length = 100 |
| 64 | unused-arguments-ignore-stub-functions = True |
| 65 | select = A,B,B902,B950,C,E,E242,F,U100,W |
| 66 | ignore = A003,B005,E203,E262,E266,E501,W503 |