2019-10-17 10:46:22 +00:00
|
|
|
[pytest]
|
|
|
|
addopts = -ra
|
|
|
|
testpaths = tests
|
2020-09-05 07:46:06 +00:00
|
|
|
xfail_strict = true
|
2019-10-17 10:46:22 +00:00
|
|
|
filterwarnings =
|
|
|
|
once::Warning
|
|
|
|
ignore:::pympler[.*]
|
|
|
|
|
|
|
|
|
2020-03-13 10:07:31 +00:00
|
|
|
# Keep docs in sync with docs env and .readthedocs.yml.
|
|
|
|
[gh-actions]
|
|
|
|
python =
|
|
|
|
2.7: py27
|
|
|
|
3.5: py35
|
|
|
|
3.6: py36
|
2021-11-11 04:58:46 +00:00
|
|
|
3.7: py37
|
2021-11-29 08:03:39 +00:00
|
|
|
3.8: py38, changelog
|
2021-05-05 08:24:53 +00:00
|
|
|
3.9: py39, pyright
|
2021-11-29 08:03:39 +00:00
|
|
|
3.10: py310, manifest, typing, docs
|
2021-11-19 13:51:46 +00:00
|
|
|
pypy-2: pypy
|
|
|
|
pypy-3: pypy3
|
2020-03-13 10:07:31 +00:00
|
|
|
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[tox]
|
2021-11-20 15:20:07 +00:00
|
|
|
envlist = typing,pre-commit,py27,py35,py36,py37,py38,py39,py310,pypy,pypy3,pyright,manifest,docs,pypi-description,changelog,coverage-report
|
2019-02-09 17:36:30 +00:00
|
|
|
isolated_build = True
|
2015-12-08 14:47:03 +00:00
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
|
2021-11-19 13:51:46 +00:00
|
|
|
[testenv:docs]
|
|
|
|
# Keep basepython in sync with gh-actions and .readthedocs.yml.
|
2021-11-29 08:03:39 +00:00
|
|
|
basepython = python3.10
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = docs
|
|
|
|
commands =
|
|
|
|
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
|
|
|
|
sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
|
|
|
|
python -m doctest README.rst
|
|
|
|
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[testenv]
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = tests
|
2016-09-12 05:54:22 +00:00
|
|
|
commands = python -m pytest {posargs}
|
|
|
|
|
|
|
|
|
|
|
|
[testenv:py27]
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = tests
|
2020-01-08 21:02:39 +00:00
|
|
|
commands = coverage run -m pytest {posargs}
|
2016-09-05 12:50:08 +00:00
|
|
|
|
|
|
|
|
2018-07-05 05:39:16 +00:00
|
|
|
[testenv:py37]
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = tests
|
2020-01-08 21:02:39 +00:00
|
|
|
commands = coverage run -m pytest {posargs}
|
2019-06-04 08:38:57 +00:00
|
|
|
|
|
|
|
|
2021-05-18 09:28:21 +00:00
|
|
|
[testenv:py310]
|
|
|
|
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
|
|
|
|
# PYTHONWARNINGS=d and --no-compile below make them visible during the Tox run.
|
|
|
|
basepython = python3.10
|
|
|
|
install_command = pip install --no-compile {opts} {packages}
|
|
|
|
setenv =
|
|
|
|
PYTHONWARNINGS=d
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = tests
|
2021-05-18 09:28:21 +00:00
|
|
|
commands = coverage run -m pytest {posargs}
|
|
|
|
|
|
|
|
|
2017-11-26 21:18:07 +00:00
|
|
|
[testenv:coverage-report]
|
2021-05-18 09:28:21 +00:00
|
|
|
basepython = python3.10
|
2021-11-19 13:51:46 +00:00
|
|
|
depends = py27,py37,py310
|
2017-11-26 21:18:07 +00:00
|
|
|
skip_install = true
|
2021-05-18 09:28:21 +00:00
|
|
|
deps = coverage[toml]>=5.4
|
2017-11-26 21:18:07 +00:00
|
|
|
commands =
|
|
|
|
coverage combine
|
|
|
|
coverage report
|
|
|
|
|
|
|
|
|
2021-11-20 15:20:07 +00:00
|
|
|
[testenv:pre-commit]
|
2021-05-18 05:02:06 +00:00
|
|
|
basepython = python3.10
|
2018-06-10 17:40:07 +00:00
|
|
|
skip_install = true
|
2020-05-03 10:24:28 +00:00
|
|
|
deps =
|
|
|
|
pre-commit
|
2018-06-10 17:40:07 +00:00
|
|
|
passenv = HOMEPATH # needed on Windows
|
2020-05-03 10:24:28 +00:00
|
|
|
commands =
|
|
|
|
pre-commit run --all-files
|
2017-11-26 21:18:07 +00:00
|
|
|
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[testenv:manifest]
|
2021-11-23 08:49:41 +00:00
|
|
|
basepython = python3.10
|
2015-12-08 14:47:03 +00:00
|
|
|
deps = check-manifest
|
2015-12-08 15:00:06 +00:00
|
|
|
skip_install = true
|
2015-12-08 14:47:03 +00:00
|
|
|
commands = check-manifest
|
|
|
|
|
2015-10-16 13:09:28 +00:00
|
|
|
|
2018-11-26 16:30:27 +00:00
|
|
|
[testenv:pypi-description]
|
2020-03-13 10:07:31 +00:00
|
|
|
basepython = python3.8
|
2015-12-19 12:04:01 +00:00
|
|
|
skip_install = true
|
2018-11-26 16:30:27 +00:00
|
|
|
deps =
|
|
|
|
twine
|
|
|
|
pip >= 18.0.0
|
|
|
|
commands =
|
|
|
|
pip wheel -w {envtmpdir}/build --no-deps .
|
|
|
|
twine check {envtmpdir}/build/*
|
2015-12-19 12:04:01 +00:00
|
|
|
|
2017-11-26 21:18:07 +00:00
|
|
|
|
2017-08-20 05:58:08 +00:00
|
|
|
[testenv:changelog]
|
2020-03-13 10:07:31 +00:00
|
|
|
basepython = python3.8
|
2021-05-06 08:15:03 +00:00
|
|
|
deps = towncrier<21.3
|
2017-08-20 05:58:08 +00:00
|
|
|
skip_install = true
|
|
|
|
commands = towncrier --draft
|
2018-07-12 10:19:24 +00:00
|
|
|
|
2018-11-26 11:58:39 +00:00
|
|
|
|
2018-07-12 10:19:24 +00:00
|
|
|
[testenv:typing]
|
2021-11-19 13:51:46 +00:00
|
|
|
basepython = python3.10
|
2021-06-14 17:58:33 +00:00
|
|
|
deps = mypy>=0.902
|
2019-09-26 04:49:15 +00:00
|
|
|
commands =
|
2020-07-20 10:43:10 +00:00
|
|
|
mypy src/attr/__init__.pyi src/attr/_version_info.pyi src/attr/converters.pyi src/attr/exceptions.pyi src/attr/filters.pyi src/attr/setters.pyi src/attr/validators.pyi
|
2019-09-26 04:49:15 +00:00
|
|
|
mypy tests/typing_example.py
|
2021-05-05 08:24:53 +00:00
|
|
|
|
|
|
|
|
|
|
|
[testenv:pyright]
|
|
|
|
# Install and configure node and pyright
|
|
|
|
# This *could* be folded into a custom install_command
|
|
|
|
# Use nodeenv to configure node in the running tox virtual environment
|
|
|
|
# Seeing errors using "nodeenv -p"
|
|
|
|
# Use npm install -g to install "globally" into the virtual environment
|
|
|
|
basepython = python3.9
|
|
|
|
deps = nodeenv
|
|
|
|
commands =
|
|
|
|
nodeenv --prebuilt --node=lts --force {envdir}
|
2021-05-05 14:06:09 +00:00
|
|
|
npm install -g --no-package-lock --no-save pyright
|
2021-05-05 08:24:53 +00:00
|
|
|
pytest tests/test_pyright.py -vv
|