Skip to content

Conversation

@bluetech
Copy link
Member

Some things I noticed while looking at the tox file reviewing @sgaist's PR #13825. Please see the commits.

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided (automation) changelog entry is part of PR label Oct 23, 2025
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.

Copy link
Member

@webknjaz webknjaz left a comment

Choose a reason for hiding this comment

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

I like it but this can be improved a bit.

xdist: -e .
{env:_PYTEST_TOX_EXTRA_DEP:}
# Can use the same wheel for all environments.
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.

Tox 4.0.0 was released on Dec 7, 2022, should be OK to require it.

On the way, since `minversion` is deprecated, replace it with `require`.
https://tox.wiki/en/latest/config.html#min_version
As far as I can see this setting no longer exists in tox 4, and probably
not utilized before either, so should be safe to remove.
Since pytest wheel is "universal" (not different between Python versions
or implementations or anything), the same wheel can be reused. See:

https://tox.wiki/en/stable/config.html#wheel_build_env
https://tox.wiki/en/stable/upgrading.html#universal-wheels
I don't think they're needed.
@bluetech bluetech merged commit 68016f0 into pytest-dev:main Oct 24, 2025
33 checks passed
@bluetech bluetech deleted the tox-cleanups branch October 24, 2025 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:chronographer:provided (automation) changelog entry is part of PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants