CI: prevent virtualenv redirect from occupying .venv - #26167
Merged
Eleanor Boyd (eleanorjboyd) merged 3 commits intoSep 25, 2026
Merged
Eleanor Boyd (eleanorjboyd) merged 3 commits into
Eleanor Boyd (eleanorjboyd) merged 3 commits into
Conversation
The venv matrix failed on both Windows and Linux when .venv was already occupied. Give the venv test interpreter a distinct path and log .venv state around setup so the producer of the collision can be identified in the next CI run.\n\nCo-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
virtualenv 21.12 writes a .venv redirect file next to .virtualenv when a pyproject.toml exists. Disable that redirect so the following stdlib venv step can create its intended .venv directory. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep the virtualenv redirect opt-out and explicit venv creation failure check; the path logging is no longer needed now that the collision is confirmed. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eleanor Boyd (eleanorjboyd)
marked this pull request as ready for review
September 25, 2026 15:10
Eleanor Boyd (eleanorjboyd)
enabled auto-merge (squash)
September 25, 2026 16:23
Raymond Zhao (rzhao271)
approved these changes
Sep 25, 2026
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.
Why
The virtualenv 21.12.0 update introduced a PEP 832
.venvredirect: when a project has apyproject.toml, creating.virtualenvcan also write a.venvfile pointing to it. Our CI workflow copies in apyproject.toml, creates.virtualenvfor virtualenv tests, then runspython -m venv .venvfor separate stdlib venv tests. Once virtualenv started writing that file, the latter command could no longer create its.venvdirectory. The passing run installed virtualenv 21.11.1; the failing release-branch runs installed 21.12.1.Change
Pass
--no-venv-redirectwhen creating.virtualenv. This opts out of the newly added side effect while keeping the two existing test environments at their original paths:.virtualenvfor virtualenv and.venvfor stdlib venv. Stop immediately if stdlib venv creation fails rather than reporting the subsequent missing executable as the primary error.Related to #26164. The release branch still needs this fix and a passing Build workflow before release.