Today, rye build uses the bootstrapped (or "self") environment, which means built wheels reflect the version from the bootstrapped environment, rather than the user's Python preference.
This PR changes build to instead create an ephemeral build environment based on the requested Python version (then install and run build in that environment).
Creating and populating that ephemeral build environment is extremely fast with uv; there's virtually no overhead.
Summary
Today,
rye build
uses the bootstrapped (or "self") environment, which means built wheels reflect the version from the bootstrapped environment, rather than the user's Python preference.This PR changes
build
to instead create an ephemeral build environment based on the requested Python version (then install and runbuild
in that environment).Creating and populating that ephemeral build environment is extremely fast with uv; there's virtually no overhead.
Closes https://github.com/astral-sh/rye/issues/1152. Closes https://github.com/astral-sh/rye/issues/1248.
Test Plan
../rye/target/debug/rye build
from a directory with.python-version
of3.11
.