2020-03-13 10:07:31 +00:00
|
|
|
# Keep docs in sync with docs env and .readthedocs.yml.
|
|
|
|
[gh-actions]
|
|
|
|
python =
|
2022-08-16 10:15:10 +00:00
|
|
|
3.6: py36, mypy
|
2021-11-11 04:58:46 +00:00
|
|
|
3.7: py37
|
2021-11-29 08:03:39 +00:00
|
|
|
3.8: py38, changelog
|
2022-09-29 07:36:19 +00:00
|
|
|
3.9: py39
|
2022-09-28 07:42:21 +00:00
|
|
|
3.10: py310, mypy
|
2022-06-24 09:37:40 +00:00
|
|
|
3.11: py311
|
2021-11-19 13:51:46 +00:00
|
|
|
pypy-3: pypy3
|
2020-03-13 10:07:31 +00:00
|
|
|
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[tox]
|
2022-08-16 10:15:10 +00:00
|
|
|
envlist = mypy,pre-commit,py36,py37,py38,py39,py310,py311,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]
|
2022-09-28 07:42:21 +00:00
|
|
|
# Keep basepython in sync with ci.yml/docs 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
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[testenv]
|
2021-11-19 13:51:46 +00:00
|
|
|
extras = tests
|
2022-08-21 07:38:37 +00:00
|
|
|
commands = python -m pytest {posargs:-n auto}
|
2016-09-12 05:54:22 +00:00
|
|
|
|
|
|
|
|
2022-08-05 07:48:00 +00:00
|
|
|
[testenv:py36]
|
2022-08-21 07:38:37 +00:00
|
|
|
extras = cov
|
|
|
|
setenv = COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
|
|
|
|
commands = coverage run -m pytest {posargs:-n auto}
|
2019-06-04 08:38:57 +00:00
|
|
|
|
|
|
|
|
2021-05-18 09:28:21 +00:00
|
|
|
[testenv:py310]
|
2022-08-21 07:38:37 +00:00
|
|
|
extras = cov
|
2022-09-28 07:49:28 +00:00
|
|
|
setenv =
|
|
|
|
PYTHONWARNINGS=d
|
|
|
|
{[testenv:py36]setenv}
|
|
|
|
commands = {[testenv:py36]commands}
|
|
|
|
|
|
|
|
|
|
|
|
[testenv:py311]
|
|
|
|
extras = cov
|
2021-05-18 09:28:21 +00:00
|
|
|
# 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.
|
2022-08-21 07:38:37 +00:00
|
|
|
install_command = python -m pip install --no-compile {opts} {packages}
|
2021-05-18 09:28:21 +00:00
|
|
|
setenv =
|
|
|
|
PYTHONWARNINGS=d
|
2022-08-21 07:38:37 +00:00
|
|
|
{[testenv:py36]setenv}
|
2022-09-28 07:49:28 +00:00
|
|
|
# xdist is currently broken on 3.11rc2
|
|
|
|
commands = coverage run -m pytest {posargs}
|
2021-05-18 09:28:21 +00:00
|
|
|
|
|
|
|
|
2017-11-26 21:18:07 +00:00
|
|
|
[testenv:coverage-report]
|
2021-05-18 09:28:21 +00:00
|
|
|
basepython = python3.10
|
2022-08-05 07:48:00 +00:00
|
|
|
depends = py36,py310
|
2017-11-26 21:18:07 +00:00
|
|
|
skip_install = true
|
2022-08-21 07:38:37 +00:00
|
|
|
deps = coverage[toml]>=5.3
|
2017-11-26 21:18:07 +00:00
|
|
|
commands =
|
|
|
|
coverage combine
|
|
|
|
coverage report
|
|
|
|
|
2022-08-21 07:42:03 +00:00
|
|
|
|
2021-11-20 15:20:07 +00:00
|
|
|
[testenv:pre-commit]
|
2018-06-10 17:40:07 +00:00
|
|
|
skip_install = true
|
2022-08-10 12:15:32 +00:00
|
|
|
deps = pre-commit
|
2018-06-10 17:40:07 +00:00
|
|
|
passenv = HOMEPATH # needed on Windows
|
2022-08-13 10:47:53 +00:00
|
|
|
commands = pre-commit run --all-files --show-diff-on-failure
|
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
|
2022-04-07 05:25:20 +00:00
|
|
|
deps = towncrier
|
2017-08-20 05:58:08 +00:00
|
|
|
skip_install = true
|
2022-12-07 08:15:46 +00:00
|
|
|
commands = towncrier build --version main --draft
|
2018-07-12 10:19:24 +00:00
|
|
|
|
2018-11-26 11:58:39 +00:00
|
|
|
|
2022-08-16 10:15:10 +00:00
|
|
|
[testenv:mypy]
|
2021-06-14 17:58:33 +00:00
|
|
|
deps = mypy>=0.902
|
2019-09-26 04:49:15 +00:00
|
|
|
commands =
|
2022-08-30 13:06:10 +00:00
|
|
|
mypy src/attrs/__init__.pyi src/attr/__init__.pyi src/attr/_typing_compat.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
|
|
|
|
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
|
2022-11-25 07:30:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
[testenv:docset]
|
|
|
|
deps = doc2dash
|
|
|
|
extras = docs
|
|
|
|
allowlist_externals =
|
|
|
|
rm
|
|
|
|
cp
|
|
|
|
tar
|
|
|
|
commands =
|
|
|
|
rm -rf attrs.docset attrs.tgz docs/_build
|
|
|
|
sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
|
|
|
|
doc2dash --index-page index.html --icon docs/_static/docset-icon.png --online-redirect-url https://www.attrs.org/en/latest/ docs/_build/html
|
|
|
|
cp docs/_static/docset-icon@2x.png attrs.docset/icon@2x.png
|
|
|
|
tar --exclude='.DS_Store' -cvzf attrs.tgz attrs.docset
|