Fix tox 4.0 support and docs

Also includes pre-commit autoupdate
This commit is contained in:
Bruno Oliveira 2022-12-14 08:57:07 -03:00 committed by GitHub
commit f6adebb990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 25 additions and 10 deletions

View File

@ -2,7 +2,7 @@ default_language_version:
python: "3.10" python: "3.10"
repos: repos:
- repo: https://github.com/psf/black - repo: https://github.com/psf/black
rev: 22.10.0 rev: 22.12.0
hooks: hooks:
- id: black - id: black
args: [--safe, --quiet] args: [--safe, --quiet]
@ -44,7 +44,7 @@ repos:
- id: reorder-python-imports - id: reorder-python-imports
args: ['--application-directories=.:src', --py37-plus] args: ['--application-directories=.:src', --py37-plus]
- repo: https://github.com/asottile/pyupgrade - repo: https://github.com/asottile/pyupgrade
rev: v3.3.0 rev: v3.3.1
hooks: hooks:
- id: pyupgrade - id: pyupgrade
args: [--py37-plus] args: [--py37-plus]

View File

@ -2,9 +2,12 @@ version: 2
python: python:
install: install:
- requirements: doc/en/requirements.txt # Install pytest first, then doc/en/requirements.txt.
- method: pip # This order is important to honor any pins in doc/en/requirements.txt
path: . # when the pinned library is also a dependency of pytest.
- method: pip
path: .
- requirements: doc/en/requirements.txt
build: build:
os: ubuntu-20.04 os: ubuntu-20.04

View File

@ -270,8 +270,8 @@ tox
Once you are done with your work and want to make sure that your actual Once you are done with your work and want to make sure that your actual
package passes all tests you may want to look into :doc:`tox <tox:index>`, the package passes all tests you may want to look into :doc:`tox <tox:index>`, the
virtualenv test automation tool and its :doc:`pytest support <tox:example/pytest>`. virtualenv test automation tool.
tox helps you to setup virtualenv environments with pre-defined ``tox`` helps you to setup virtualenv environments with pre-defined
dependencies and then executing a pre-configured test command with dependencies and then executing a pre-configured test command with
options. It will run tests against the installed package and not options. It will run tests against the installed package and not
against your source code checkout, helping to detect packaging against your source code checkout, helping to detect packaging

View File

@ -5,3 +5,7 @@ sphinx-removed-in>=0.2.0
sphinx>=5,<6 sphinx>=5,<6
sphinxcontrib-trio sphinxcontrib-trio
sphinxcontrib-svg2pdfconverter sphinxcontrib-svg2pdfconverter
# Pin packaging because it no longer handles 'latest' version, which
# is the version that is assigned to the docs.
# See https://github.com/pytest-dev/pytest/pull/10578#issuecomment-1348249045.
packaging <22

14
tox.ini
View File

@ -30,7 +30,11 @@ commands =
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
coverage: coverage combine coverage: coverage combine
coverage: coverage report -m coverage: coverage report -m
passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST passenv =
COVERAGE_*
PYTEST_ADDOPTS
TERM
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
setenv = setenv =
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:} _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
@ -93,7 +97,8 @@ commands =
[testenv:regen] [testenv:regen]
changedir = doc/en changedir = doc/en
basepython = python3 basepython = python3
passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST passenv =
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
deps = deps =
dataclasses dataclasses
PyYAML PyYAML
@ -161,7 +166,10 @@ commands = python scripts/prepare-release-pr.py {posargs}
description = create GitHub release after deployment description = create GitHub release after deployment
basepython = python3 basepython = python3
usedevelop = True usedevelop = True
passenv = GH_RELEASE_NOTES_TOKEN GITHUB_REF GITHUB_REPOSITORY passenv =
GH_RELEASE_NOTES_TOKEN
GITHUB_REF
GITHUB_REPOSITORY
deps = deps =
github3.py github3.py
pypandoc pypandoc