fix: avoid PYTHON_VERSION breaking uv if set (#2795)

* fix: avoid PYTHON_VERSION breaking uv if set

* fix: also keep UV_PYTHON out

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: specify the python version in the uv command more often

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* fix: revert env order change

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>

* Update windows.py

Co-authored-by: Joe Rickerby <joerick@mac.com>

---------

Signed-off-by: Henry Schreiner <henryfs@princeton.edu>
Co-authored-by: Joe Rickerby <joerick@mac.com>
This commit is contained in:
Henry Schreiner
2026-03-28 11:28:39 -04:00
committed by GitHub
co-authored by Joe Rickerby
parent fffe2ca07d
commit 643b30c796
2 changed files with 13 additions and 1 deletions
+5 -1
View File
@@ -293,7 +293,9 @@ def setup_python(
# set up environment variables for run_with_env
env["PYTHON_VERSION"] = python_configuration.version
env["PYTHON_ARCH"] = python_configuration.arch
env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
env.pop("UV_PYTHON", None)
if not use_uv:
env["PIP_DISABLE_PIP_VERSION_CHECK"] = "1"
# update env with results from CIBW_ENVIRONMENT
env = environment.as_dictionary(prev_environment=env)
@@ -334,6 +336,8 @@ def setup_python(
uv_path,
"pip",
"install",
"--python",
where_python,
"--upgrade",
"build[virtualenv]",
*constraint_flags(dependency_constraint),