Skip to content

Commit c16315f

Browse files
authored
Merge pull request #10586 from nicoddemus/backport-10578
[7.2.x] Fix tox 4.0 support and docs
2 parents 7d35baa + f198974 commit c16315f

File tree

5 files changed

+25
-10
lines changed

5 files changed

+25
-10
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ default_language_version:
22
python: "3.10"
33
repos:
44
- repo: https://github.com/psf/black
5-
rev: 22.10.0
5+
rev: 22.12.0
66
hooks:
77
- id: black
88
args: [--safe, --quiet]
@@ -44,7 +44,7 @@ repos:
4444
- id: reorder-python-imports
4545
args: ['--application-directories=.:src', --py37-plus]
4646
- repo: https://github.com/asottile/pyupgrade
47-
rev: v3.1.0
47+
rev: v3.3.1
4848
hooks:
4949
- id: pyupgrade
5050
args: [--py37-plus]

.readthedocs.yml

+6-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ version: 2
22

33
python:
44
install:
5-
- requirements: doc/en/requirements.txt
6-
- method: pip
7-
path: .
5+
# Install pytest first, then doc/en/requirements.txt.
6+
# This order is important to honor any pins in doc/en/requirements.txt
7+
# when the pinned library is also a dependency of pytest.
8+
- method: pip
9+
path: .
10+
- requirements: doc/en/requirements.txt
811

912
build:
1013
os: ubuntu-20.04

doc/en/explanation/goodpractices.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,8 @@ tox
270270

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

doc/en/requirements.txt

+4
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ sphinx-removed-in>=0.2.0
55
sphinx>=5,<6
66
sphinxcontrib-trio
77
sphinxcontrib-svg2pdfconverter
8+
# Pin packaging because it no longer handles 'latest' version, which
9+
# is the version that is assigned to the docs.
10+
# See https://github.com/pytest-dev/pytest/pull/10578#issuecomment-1348249045.
11+
packaging <22

tox.ini

+11-3
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ commands =
3030
doctesting: {env:_PYTEST_TOX_COVERAGE_RUN:} pytest --doctest-modules --pyargs _pytest
3131
coverage: coverage combine
3232
coverage: coverage report -m
33-
passenv = USER USERNAME COVERAGE_* PYTEST_ADDOPTS TERM SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
33+
passenv =
34+
COVERAGE_*
35+
PYTEST_ADDOPTS
36+
TERM
37+
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
3438
setenv =
3539
_PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
3640

@@ -93,7 +97,8 @@ commands =
9397
[testenv:regen]
9498
changedir = doc/en
9599
basepython = python3
96-
passenv = SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
100+
passenv =
101+
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
97102
deps =
98103
dataclasses
99104
PyYAML
@@ -161,7 +166,10 @@ commands = python scripts/prepare-release-pr.py {posargs}
161166
description = create GitHub release after deployment
162167
basepython = python3
163168
usedevelop = True
164-
passenv = GH_RELEASE_NOTES_TOKEN GITHUB_REF GITHUB_REPOSITORY
169+
passenv =
170+
GH_RELEASE_NOTES_TOKEN
171+
GITHUB_REF
172+
GITHUB_REPOSITORY
165173
deps =
166174
github3.py
167175
pypandoc

0 commit comments

Comments
 (0)