Skip to content

Add the UV_PYTHON_ARCH environment variable - #2213

Draft
zaniebot wants to merge 4 commits into
zb/windows-arm64-python-default-20260930from
zb/python-arch-20260930
Draft

zaniebot wants to merge 4 commits into
zb/windows-arm64-python-default-20260930from
zb/python-arch-20260930

Conversation

@zaniebot

@zaniebot zaniebot commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Selecting a Python architecture currently requires including it in each interpreter request, which is awkward with version-only project pins. Add UV_PYTHON_ARCH to select the architecture independently of the Python version. The environment variable constrains interpreter discovery and managed downloads, while requests with an explicit architecture or interpreter path take precedence. This provides a persistent x86_64 selection on Windows ARM64.

Stacked on #2207.

@astral-automations-bot astral-automations-bot Bot added area:configuration Settings and such enhancement New feature or request labels Sep 30, 2026
@zaniebot zaniebot changed the title Add a default Python architecture setting Add the UV_PYTHON_ARCH environment variable Sep 30, 2026
@codspeed

codspeed Bot commented Sep 30, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 72 untouched benchmarks
⏩ 16 skipped benchmarks1


Comparing zb/python-arch-20260930 (ed94ba2) with zb/windows-arm64-python-default-20260930 (7e9a17b)

Open in CodSpeed

Footnotes

  1. 16 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩

zanieb added a commit to astral-sh/uv that referenced this pull request Oct 1, 2026
Selecting a Python architecture currently requires including it in each
interpreter request, which is awkward with version-only project pins and
requires users to specify a Python key instead. Add `UV_PYTHON_ARCH` to
constrain interpreter discovery and managed downloads independently of
the Python version. Explicit architecture requests and interpreter paths
take precedence; `uv python list --all-arches` and `--all-platforms`
still enumerate all requested platforms.

Ports astral-sh#2213. This allows users to select `x86_64` to
recover the current behavior after we the Windows ARM64 default changes
in #22100.
@astral-automations-bot
astral-automations-bot Bot force-pushed the zb/windows-arm64-python-default-20260930 branch 3 times, most recently from 5179990 to 2c802ca Compare October 9, 2026 18:08

This branch has not been deployed

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

Labels

area:configuration Settings and such enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants