2015-01-27 16:53:17 +00:00
|
|
|
[tox]
|
2023-06-12 05:48:55 +00:00
|
|
|
min_version = 4
|
|
|
|
env_list =
|
|
|
|
pre-commit,
|
2023-10-17 03:48:35 +00:00
|
|
|
py3{7,8,9,10,11,12}-tests,
|
|
|
|
py3{8,9,10,11,12}-mypy,
|
2023-06-12 05:48:55 +00:00
|
|
|
pypy3,
|
|
|
|
pyright,
|
|
|
|
docs,
|
|
|
|
changelog,
|
|
|
|
coverage-report
|
2021-11-19 13:51:46 +00:00
|
|
|
|
2023-01-11 15:50:27 +00:00
|
|
|
|
2023-06-26 14:18:30 +00:00
|
|
|
[testenv:.pkg]
|
2023-06-26 14:58:39 +00:00
|
|
|
pass_env = SETUPTOOLS_SCM_PRETEND_VERSION
|
2023-06-26 14:18:30 +00:00
|
|
|
|
|
|
|
|
2015-01-27 16:53:17 +00:00
|
|
|
[testenv]
|
2023-06-26 14:18:30 +00:00
|
|
|
package = wheel
|
|
|
|
wheel_build_env = .pkg
|
2023-08-17 07:33:55 +00:00
|
|
|
extras =
|
|
|
|
tests: tests
|
2023-10-17 03:48:35 +00:00
|
|
|
mypy: tests-mypy
|
2023-08-17 07:33:55 +00:00
|
|
|
commands =
|
|
|
|
tests: pytest {posargs:-n auto}
|
|
|
|
mypy: mypy tests/typing_example.py
|
|
|
|
mypy: 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
|
2016-09-12 05:54:22 +00:00
|
|
|
|
2023-12-30 12:06:22 +00:00
|
|
|
[testenv:py3{7,10,12}-tests]
|
2022-09-28 07:49:28 +00:00
|
|
|
extras = cov
|
2021-05-18 09:28:21 +00:00
|
|
|
# Python 3.6+ has a number of compile-time warnings on invalid string escapes.
|
2023-06-12 05:48:55 +00:00
|
|
|
# PYTHONWARNINGS=d and --no-compile below make them visible during the tox run.
|
|
|
|
set_env =
|
2023-01-11 15:50:27 +00:00
|
|
|
COVERAGE_PROCESS_START={toxinidir}/pyproject.toml
|
2021-05-18 09:28:21 +00:00
|
|
|
PYTHONWARNINGS=d
|
2023-08-17 07:33:55 +00:00
|
|
|
install_command = python -Im pip install --no-compile {opts} {packages}
|
2023-06-26 16:09:43 +00:00
|
|
|
commands_pre = python -c 'import pathlib; pathlib.Path("{env_site_packages_dir}/cov.pth").write_text("import coverage; coverage.process_startup()")'
|
|
|
|
commands = coverage run -m pytest {posargs:-n auto}
|
2021-05-18 09:28:21 +00:00
|
|
|
|
|
|
|
|
2017-11-26 21:18:07 +00:00
|
|
|
[testenv:coverage-report]
|
2023-06-13 07:40:14 +00:00
|
|
|
# Keep base_python in-sync with .python-version-default
|
2023-12-30 12:06:22 +00:00
|
|
|
base_python = py312
|
2023-02-03 08:36:01 +00:00
|
|
|
depends = py3{7,10,11}
|
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
|
|
|
|
2023-06-12 05:48:55 +00:00
|
|
|
[testenv:docs]
|
|
|
|
# Keep base_python in-sync with ci.yml/docs and .readthedocs.yaml.
|
2023-11-28 12:16:17 +00:00
|
|
|
base_python = py312
|
2023-06-12 05:48:55 +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
|
|
|
|
|
|
|
|
|
2023-08-15 07:47:24 +00:00
|
|
|
[testenv:docs-watch]
|
2023-07-09 09:39:04 +00:00
|
|
|
package = editable
|
|
|
|
base_python = {[testenv:docs]base_python}
|
|
|
|
extras = {[testenv:docs]extras}
|
|
|
|
deps = watchfiles
|
|
|
|
commands =
|
|
|
|
watchfiles \
|
|
|
|
--ignore-paths docs/_build/ \
|
|
|
|
'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
|
|
|
|
src \
|
|
|
|
docs
|
|
|
|
|
|
|
|
|
|
|
|
[testenv:docs-linkcheck]
|
|
|
|
package = editable
|
|
|
|
base_python = {[testenv:docs]base_python}
|
|
|
|
extras = {[testenv:docs]extras}
|
|
|
|
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
|
|
|
|
|
|
|
|
|
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
|
2023-02-03 08:36:01 +00:00
|
|
|
commands = pre-commit run --all-files
|
2017-11-26 21:18:07 +00:00
|
|
|
|
|
|
|
|
2017-08-20 05:58:08 +00:00
|
|
|
[testenv:changelog]
|
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
|
|
|
|
2021-05-05 08:24:53 +00:00
|
|
|
[testenv:pyright]
|
2023-08-17 07:20:45 +00:00
|
|
|
extras = tests
|
|
|
|
deps = pyright
|
2023-07-09 13:48:58 +00:00
|
|
|
commands = 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
|