GeezerVison is showing github.com — CI: prevent virtualenv redirect from occupying .venv by eleanorjboyd · Pull Request #26167 · microsoft/vscode-python
Conversation
Why
The virtualenv 21.12.0 update introduced a PEP 832 .venv redirect: when a project has a pyproject.toml, creating .virtualenv can also write a .venv file pointing to it. Our CI workflow copies in a pyproject.toml, creates .virtualenv for virtualenv tests, then runs python -m venv .venv for separate stdlib venv tests. Once virtualenv started writing that file, the latter command could no longer create its .venv directory. The passing run installed virtualenv 21.11.1; the failing release-branch runs installed 21.12.1.
Change
Pass --no-venv-redirect when creating .virtualenv. This opts out of the newly added side effect while keeping the two existing test environments at their original paths: .virtualenv for virtualenv and .venv for 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.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Eleanor Boyd (eleanorjboyd)
added a commit
that referenced
this pull request
Sep 28, 2026
## Why
Backport of
[#26167](#26167) for the
2026.6 release branch. [virtualenv
21.12](https://github.com/pypa/virtualenv/releases/tag/21.12.0) began
writing a `.venv` redirect file when creating `.virtualenv` in a project
with `pyproject.toml`. The following `python -m venv .venv` then cannot
create the separate stdlib venv directory, breaking the release branch's
Windows and Linux venv jobs.
## Change
Pass `--no-venv-redirect` when creating `.virtualenv` so the existing
`.virtualenv` and `.venv` tests continue to use their original, separate
paths. Exit immediately if stdlib venv creation fails.
## Windows unit-test investigation
The Windows `ts-unit` job also intermittently failed on the first Native
Python Finder refresh while the subsequent refresh succeeded. The
locator-output diagnostic reproduced the failure: Pet logged `Skipping
refresh state sync for stale generation 0 because current generation is
1` and returned no environments. The finder had launched a configure
request in its constructor without awaiting it, while its first refresh
launched another configure and could start before the first completed.
Pet suppresses environment notifications from stale configuration
generations. Remove the redundant constructor configure; the first
refresh already configures and awaits completion before sending the
refresh request. The existing non-empty assertion is unchanged and still
includes the locator log on failure.
The release branch's Build workflow must pass after this lands before
releasing.
---------
Co-authored-by: Copilot <[email protected]>
Eleanor Boyd (eleanorjboyd)
pushed a commit
that referenced
this pull request
Sep 29, 2026
…nv (#26170)
Cherry-pick of #26168 from `release/2026.6`.
## Why
Backport of
[#26167](#26167) for the
2026.6 release branch. [virtualenv
21.12](https://github.com/pypa/virtualenv/releases/tag/21.12.0) began
writing a `.venv` redirect file when creating `.virtualenv` in a project
with `pyproject.toml`. The following `python -m venv .venv` then cannot
create the separate stdlib venv directory, breaking the release branch's
Windows and Linux venv jobs.
## Change
Pass `--no-venv-redirect` when creating `.virtualenv` so the existing
`.virtualenv` and `.venv` tests continue to use their original, separate
paths. Exit immediately if stdlib venv creation fails.
## Windows unit-test investigation
The Windows `ts-unit` job also intermittently failed on the first Native
Python Finder refresh while the subsequent refresh succeeded. The
locator-output diagnostic reproduced the failure: Pet logged `Skipping
refresh state sync for stale generation 0 because current generation is
1` and returned no environments. The finder had launched a configure
request in its constructor without awaiting it, while its first refresh
launched another configure and could start before the first completed.
Pet suppresses environment notifications from stale configuration
generations. Remove the redundant constructor configure; the first
refresh already configures and awaits completion before sending the
refresh request. The existing non-empty assertion is unchanged and still
includes the locator log on failure.
The release branch's Build workflow must pass after this lands before
releasing.
---------
Co-authored-by: vs-code-engineering[bot] <vs-code-engineering[bot]@users.noreply.github.com>
Co-authored-by: Michael Lively <[email protected]>
Co-authored-by: Copilot <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.