Skip to content

✨ feat(create): add RustPython support#3071

Merged
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:rustpython
Feb 23, 2026
Merged

✨ feat(create): add RustPython support#3071
gaborbernat merged 2 commits into
pypa:mainfrom
gaborbernat:rustpython

Conversation

@gaborbernat

@gaborbernat gaborbernat commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

virtualenv currently supports CPython, PyPy, and GraalPy as target interpreters for virtual environment creation. This PR adds RustPython as a fourth supported implementation, enabling virtualenv -p rustpython venv to work out of the box. 🦀

The implementation follows the same pattern as GraalPy — a builtin creator pair (RustPythonPosix / RustPythonWindows) inheriting from the shared ViaGlobalRefVirtualenvBuiltin base. RustPython is simpler than CPython/PyPy since it ships as a single monolithic binary with no shared libraries to copy. The creator registers rustpython as an executable stem alongside the standard python/python3 names, and the discovery layer learns to probe rustpython binaries as POSIX fallback candidates.

CI downloads pre-built RustPython binaries from their weekly GitHub releases for Linux x86_64, macOS aarch64, and Windows x86_64. Since RustPython cannot yet run pytest (parser limitation with set comprehension expressions), the rp tox environment uses CPython to execute tests while rustpython is available on PATH for integration testing. The tox requirement is bumped to >=4.45 which includes a fix for circular set_env resolution with lazy constants like {env_site_packages_dir}.

Closes #3010.

Co-Authored-By: elmjag <elmjag@users.noreply.github.com>
@gaborbernat gaborbernat enabled auto-merge (squash) February 23, 2026 20:24
@gaborbernat gaborbernat disabled auto-merge February 23, 2026 20:29
@gaborbernat gaborbernat merged commit 1d4a338 into pypa:main Feb 23, 2026
59 checks passed
This was referenced Mar 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant