Skip to content

Commit

Permalink
Use a fully locked test environment
Browse files Browse the repository at this point in the history
  • Loading branch information
hynek committed Oct 10, 2024
1 parent d68f0cd commit f97daed
Show file tree
Hide file tree
Showing 3 changed files with 1,633 additions and 12 deletions.
8 changes: 6 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ cov = [
# Ensure coverage is new enough for `source_pkgs`.
"coverage[toml]>=5.3",
]
pyright = ["attrs[tests]", "pyright<1.1.380"]
benchmark = ["pytest-codspeed", "pytest-xdist[psutil]", "attrs[tests]"]
docs = [
"cogapp",
Expand All @@ -59,10 +60,13 @@ docs = [
"sphinx-notfound-page",
"sphinxcontrib-towncrier",
# See https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92
# Pin also present in tox.ini
"towncrier<24.7",
]
dev = ["attrs[tests]", "pre-commit"]
docs-watch = [
"attrs[docs]",
"watchfiles",
]
dev = ["attrs[tests]"]

[project.urls]
Documentation = "https://www.attrs.org/"
Expand Down
21 changes: 11 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ pass_env = SETUPTOOLS_SCM_PRETEND_VERSION


[testenv]
runner = uv-venv-lock-runner
package = wheel
wheel_build_env = .pkg
extras =
Expand Down Expand Up @@ -43,7 +44,7 @@ base_python = py313
# Keep depends in-sync with testenv above that has cov extra.
depends = py3{8,10,13}-tests
skip_install = true
deps = coverage[toml]>=5.3
extra = cov
commands =
coverage combine
coverage report
Expand All @@ -61,6 +62,7 @@ commands = pytest --codspeed -n auto bench/test_benchmarks.py


[testenv:docs]
runner = uv-venv-lock-runner
# Keep base_python in-sync with ci.yml/docs and .readthedocs.yaml.
base_python = py312
extras = docs
Expand All @@ -70,54 +72,53 @@ commands =


[testenv:docs-watch]
package = editable
base_python = {[testenv:docs]base_python}
extras = {[testenv:docs]extras}
deps = watchfiles
extras = docs-watch
commands =
watchfiles \
--ignore-paths docs/_build/ \
'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
README.md \
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


[testenv:docs-sponsors]
runner = uv-venv-runner
skip_install = true
description = Ensure sponsor logos are up to date.
deps = cogapp
commands = cog -rP README.md docs/index.md


[testenv:pre-commit]
runner = uv-venv-runner
skip_install = true
deps = pre-commit-uv
commands = pre-commit run --all-files


[testenv:changelog]
# See https://github.com/sphinx-contrib/sphinxcontrib-towncrier/issues/92
# Pin also present in pyproject.toml
deps = towncrier<24.7
extras = docs
skip_install = true
commands =
towncrier --version
towncrier build --version main --draft


[testenv:pyright]
extras = tests
deps = pyright<1.1.380
extras = pyright
commands = pytest tests/test_pyright.py -vv


[testenv:docset]
runner = uv-venv-runner
deps = doc2dash
extras = docs
allowlist_externals =
Expand Down
Loading

0 comments on commit f97daed

Please sign in to comment.