GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — CI: prevent virtualenv redirect from occupying .venv by eleanorjboyd · Pull Request #26167 · microsoft/vscode-python

Conversation

@eleanorjboyd

@eleanorjboyd Eleanor Boyd (eleanorjboyd) commented Sep 24, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

All reactions
@eleanorjboyd
Fix CI venv setup collision and log existing paths
d148dc0
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]>
@eleanorjboyd Eleanor Boyd (eleanorjboyd) added the no-changelog No news entry required label Sep 24, 2026
@eleanorjboyd
Prevent virtualenv from redirecting .venv in CI
55789be
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]>
@eleanorjboyd Eleanor Boyd (eleanorjboyd) changed the title CI: diagnose and avoid venv setup path collision CI: prevent virtualenv redirect from occupying .venv Sep 24, 2026
@eleanorjboyd
Remove temporary venv path diagnostics
c3b184c
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]>
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) marked this pull request as ready for review September 25, 2026 15:10
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) enabled auto-merge (squash) September 25, 2026 16:23
rzhao271
Raymond Zhao (rzhao271) approved these changes Sep 25, 2026
View reviewed changes
@eleanorjboyd
Eleanor Boyd (eleanorjboyd) merged commit 70f695e into microsoft:main Sep 25, 2026
49 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@eleanorjboyd Eleanor Boyd (eleanorjboyd) mentioned this pull request Sep 25, 2026
release: Prevent virtualenv redirect from occupying .venv #26168
Merged
Eleanor Boyd (eleanorjboyd) added a commit that referenced this pull request Sep 28, 2026
@eleanorjboyd
release: Prevent virtualenv redirect from occupying .venv (#26168)
09cb321
## 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]>
@vs-code-engineering vs-code-engineering Bot mentioned this pull request Sep 28, 2026
[cherry-pick] release: Prevent virtualenv redirect from occupying .venv #26170
Merged
Eleanor Boyd (eleanorjboyd) pushed a commit that referenced this pull request Sep 29, 2026
@vs-code-engineering @Yoyokrazy
[cherry-pick] release: Prevent virtualenv redirect from occupying .ve…
0f81e0e
…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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@rzhao271 Raymond Zhao (rzhao271) rzhao271 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

no-changelog No news entry required

Projects

None yet

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.

2 participants

@eleanorjboyd @rzhao271
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.