Skip to content

release: Prevent virtualenv redirect from occupying .venv - #26168

Open
Eleanor Boyd (eleanorjboyd) wants to merge 3 commits into
microsoft:release/2026.6from
eleanorjboyd:agents/release-20266-venv-redirect
Open

Eleanor Boyd (eleanorjboyd) wants to merge 3 commits into
microsoft:release/2026.6from
eleanorjboyd:agents/release-20266-venv-redirect

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Why

Backport of #26167 for the 2026.6 release branch. virtualenv 21.12 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.

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>
@eleanorjboyd Eleanor Boyd (eleanorjboyd) added the no-changelog No news entry required label Sep 25, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-changelog No news entry required

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant