Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog/13841.contrib.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
``tox>=4`` is now required when contributing to pytest.
13 changes: 5 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
[tox]
isolated_build = True
minversion = 3.20.0
distshare = {homedir}/.tox/distshare
requires =
tox >= 4
envlist =
linting
py310
Expand Down Expand Up @@ -94,12 +93,14 @@ deps =
xdist: pytest-xdist>=2.1.0
xdist: -e .
{env:_PYTEST_TOX_EXTRA_DEP:}
# Can use the same wheel for all environments.
Copy link
Member

@nicoddemus nicoddemus Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is good, just to note that in CI we always test with the wheel built with hynek/build-and-inspect-python-package:

run: tox run -e ${{ matrix.tox_env }}-coverage --installpkg `find dist/*.tar.gz`

I understand the motivation of the change here in tox.ini is to speed up using tox locally.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's actually about skipping the sdist build that's significant here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Though, you probably want editable instead. Locally, that is. And for CI we should build the dists once like I do everywhere and pass that to tox..

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And for CI we should build the dists once like I do everywhere and pass that to tox..

I agree, and that what's done today already (unless I'm missing something).

Copy link
Member

@webknjaz webknjaz Oct 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, I was reviewing from mobile and didn't check. It is integrated indeed.

package = wheel
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
package = wheel
package = editable

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what are the implications of this myself, so I'll leave it out of this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The implications is as I described — tox will build a full project wheel when provisioning the env with wheel and a copy of the project will be installed in site-packages/. But with editable, a special PEP 660 slim wheel is built — only the metadata will go into site-packages/ and the source will be linked.

wheel_build_env = .pkg

[testenv:linting]
description =
run pre-commit-defined linters under `{basepython}`
skip_install = True
basepython = python3
deps = pre-commit>=2.9.3
commands = pre-commit run --all-files --show-diff-on-failure {posargs:}
setenv =
Expand Down Expand Up @@ -127,7 +128,6 @@ setenv =
[testenv:docs-checklinks]
description =
check the links in the documentation with `{basepython}`
basepython = python3
usedevelop = True
changedir = doc/en
deps = -r{toxinidir}/doc/en/requirements.txt
Expand All @@ -141,7 +141,6 @@ setenv =
description =
regenerate documentation examples under `{basepython}`
changedir = doc/en
basepython = python3
passenv =
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
deps =
Expand Down Expand Up @@ -194,7 +193,6 @@ commands =

[testenv:release]
description = do a release, required posarg of the version number
basepython = python3
usedevelop = True
passenv = *
deps =
Expand All @@ -212,7 +210,6 @@ commands = python scripts/prepare-release-pr.py {posargs}

[testenv:generate-gh-release-notes]
description = generate release notes that can be published as GitHub Release
basepython = python3
usedevelop = True
deps =
pypandoc
Expand Down