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
|
[tox]
env_list =
py39
py310
py311
py312
py313
py314
pytest_earliest
coverage
lint
mypy
skip_missing_interpreters = true
[testenv]
commands = pytest {posargs}
description = Run pytest
package = wheel
wheel_build_env = .pkg
[testenv:coverage]
deps = coverage
base_python = python3.13
commands =
coverage run --source={envsitepackagesdir}/pytest_check,tests -m pytest
coverage report --fail-under=100 --show-missing
description = Run pytest, with coverage
[testenv:pytest_earliest]
deps = pytest==7.0.0
base_python = python3.11
commands = pytest {posargs}
description = Run earliest supported pytest
[testenv:lint]
skip_install = true
deps = ruff
base_python = python3.13
commands = ruff check src tests examples
description = Run ruff over src, test, examples
[testenv:mypy]
deps =
mypy
httpx
numpy
# pluggy added type checking support in version 1.3.0
pluggy>=1.3,<2
base_python = python3.14
commands =
# want strict for src so users can use strict if they want
mypy --strict src
# don't need strict for internal tests
mypy tests
# tests that support --strict
mypy --strict examples/test_example_mypy.py
# considering ways to make sure this fails
# mypy --strict examples/test_example_mypy_fail.py
# for most examples, I'd like to not use all type hints to aid in readability
; --strict # mostly strict
; --allow-untyped-defs # don't require "-> None" type hints
; --disable-error-code=comparison-overlap # allow assert 1 == 2
; --disable-error-code=no-untyped-call # allow calls to helper functions with no type hints
mypy --pretty --strict \
--allow-untyped-defs \
--disable-error-code=comparison-overlap \
--disable-error-code=no-untyped-call \
examples --exclude examples/test_example_mypy_fail.py
description = Run mypy over src, test, examples
[pytest]
addopts =
--color=yes
--strict-markers
--strict-config
-ra
testpaths = tests
|