release: Prevent virtualenv redirect from occupying .venv - #26168
Open
Eleanor Boyd (eleanorjboyd) wants to merge 3 commits into
Open
Eleanor Boyd (eleanorjboyd) wants to merge 3 commits into
Eleanor Boyd (eleanorjboyd) wants to merge 3 commits into
Conversation
Backport microsoft#26167 to release/2026.6. virtualenv 21.12 creates a .venv redirect when the workflow sets up .virtualenv beside a pyproject.toml, blocking the separate stdlib venv test environment. Opt out of that side effect and report venv creation failures directly. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expose the existing Python Locator log in the failing Windows unit-test assertion so the release CI run can distinguish an empty discovery from a process or refresh error without weakening the assertion. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The constructor sent a configure request concurrently with the first refresh. On Windows Pet can process the refresh at generation 0 and then suppress its environment notifications when configure advances to generation 1. Let the first refresh perform and await configuration before sending its request. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Backport of #26167 for the 2026.6 release branch. virtualenv 21.12 began writing a
.venvredirect file when creating.virtualenvin a project withpyproject.toml. The followingpython -m venv .venvthen cannot create the separate stdlib venv directory, breaking the release branch's Windows and Linux venv jobs.Change
Pass
--no-venv-redirectwhen creating.virtualenvso the existing.virtualenvand.venvtests continue to use their original, separate paths. Exit immediately if stdlib venv creation fails.Windows unit-test investigation
The Windows
ts-unitjob also intermittently failed on the first Native Python Finder refresh while the subsequent refresh succeeded. The locator-output diagnostic reproduced the failure: Pet loggedSkipping refresh state sync for stale generation 0 because current generation is 1and 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.