Conversation
…tuptools-scm-pretend-env-var 📦 Pass desired release to PEP 517 tox env (cherry picked from commit ce8b8a7)
Closed
bluetech
approved these changes
Nov 11, 2025
There was a problem hiding this comment.
Pull Request Overview
This PR is a backport of #13933 that fixes the release automation process by ensuring the SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST environment variable is passed to the PEP 517 build environment (managed by tox) rather than just to test environments. This allows setuptools-scm to access the desired version during wheel assembly.
Key Changes:
- Moved
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTESTfrom test environments to the[pkgenv]section for PEP 517 build environment - Added comprehensive documentation explaining the configuration and workarounds for tox v4.14.1 regression
- Removed redundant
passenvconfigurations from[testenv]and[testenv:regen]sections
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tox.ini | Added [pkgenv] section to pass version environment variable to PEP 517 build environment; removed the variable from test environment configurations where it's no longer needed |
| changelog/13933.packaging.rst | Contains incorrect content - references another changelog file instead of actual content |
| changelog/13933.contrib.rst | Documents the tox configuration change for contributors |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a backport of PR #13933 as merged into main (ce8b8a7).
This patch fixes passing the release version string from the release automation script to the tox's PEP 517 frontend, so that the backend machinery bits (namely,
setuptools-scm) could access the environment variable; as indentified in the attempt to release pytest v9.0.1 [1].The solution uses the
[pkgenv]section oftox.inithat corresponds to the PEP 517 build env tox manages internally.