Skip to content

✨ feat(create): sync with upstream CPython/PyPy venv - #3036

Merged
gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:sync
Feb 16, 2026
Merged

gaborbernat merged 1 commit into
pypa:mainfrom
gaborbernat:sync

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Feb 15, 2026 •

Copy link
Copy Markdown
Contributor

virtualenv's builtin creators replicate what CPython's Lib/venv/ and PyPy's lib-python/3/venv/ do, but have drifted since ~2020. This PR brings them back in sync by addressing the most impactful gaps identified from reviewing ~84 upstream CPython commits and PyPy's py3.9-3.11 evolution.

The highest-priority changes focus on correctness: pyvenv.cfg now includes the executable key (CPython 3.11+) that tools like uv and IDEs rely on, the include directory is created per PEP 405, and free-threaded Python 3.13+ builds get proper python3.Xt / pythonw3.Xt.exe executable names plus venvlaunchert.exe launcher handling on Windows. PyPy environments also improve — PYPY_PORTABLE_DEPS.txt is respected for portable builds, and Windows DLL coverage expands beyond the previous narrow libpypy*/libffi* globs.

Activation scripts receive targeted fixes: bash now uses uname-based detection to catch MinGW/Git Bash (matching upstream), fish preserves $status across the prompt function and drops Fish <3 compatibility, and PowerShell gains Get-PyVenvConfig with -VenvDir/-Prompt parameters. All major == 3 guards are removed since virtualenv requires Python 3.8+, and the single-use resign helper is inlined at its call site. The venv creator also learns to pass --without-scm-ignore-files on 3.13+ to avoid conflicts with virtualenv's own .gitignore handling.

Resolves #3021
Resolves #2090

@gaborbernat
gaborbernat force-pushed the sync branch 12 times, most recently from 31526e4 to ab1331c Compare February 15, 2026 20:42
@gaborbernat
gaborbernat marked this pull request as draft February 15, 2026 20:52
@gaborbernat
gaborbernat force-pushed the sync branch 4 times, most recently from 54be458 to 9714a3f Compare February 16, 2026 01:45
@gaborbernat
gaborbernat marked this pull request as ready for review February 16, 2026 01:49
@gaborbernat
gaborbernat enabled auto-merge (squash) February 16, 2026 01:49
gaborbernat pushed a commit that referenced this pull request Jun 8, 2026
Closes #3160. Sourcing activate.fish from fish run inside MSYS2 (or
similar) breaks the PATH because of a path style mismatch. This PR
applies the changes from #1970 as well as the change to using uname from
#3036 to the fish template as well.

### Thanks for contributing, make sure you address all the checklists
(for details on how see [development
documentation](https://virtualenv.pypa.io/en/latest/development.html#development))

- [ ] ran the linter to address style issues (`tox -e fix`)
- [x] wrote descriptive pull request text
- [ ] ensured there are test(s) validating the fix
- [x] added news fragment in `docs/changelog` folder
- [ ] updated/extended the documentation

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
@zanieb

zanieb commented Aug 13, 2026

Copy link
Copy Markdown

Just to avoid confusion, to my current understanding, uv does not read or rely on the executable field at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants