-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Allow Python requests with missing segments #14399
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
||
// Install an x86_64 version (assuming an aarch64 host) | ||
uv_snapshot!(context.filters(), context.python_install().arg("cpython-3.13-macos-x86_64"), @r" | ||
uv_snapshot!(context.filters(), context.python_install().arg("3.13-x86_64"), @r" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used these here as a PoC / integration test!
if let Some(err) = state.error { | ||
return Err(err); | ||
} | ||
state.next_part(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM. Once I figured out how to read one state transition (i.e., the differing behavior based on whether the value parsed or not), I found it easy to pattern match that understanding to the other transitions. So there's a fair bit of code, but it follows a nice repeatable structure that I find easy to digest.
So, nice job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3 I could document how the machine works a little
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [astral-sh/uv](https://github.com/astral-sh/uv) | patch | `0.8.9` -> `0.8.11` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>astral-sh/uv (astral-sh/uv)</summary> ### [`v0.8.11`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0811) [Compare Source](astral-sh/uv@0.8.10...0.8.11) ##### Python - Add Python 3.14.0rc2 - Update Pyodide to 0.28.1 ##### Enhancements - Add Debian 13 trixie to published Docker images ([#​15269](astral-sh/uv#15269)) - Add `extra-build-dependencies` hint for any missing module on build failure ([#​15252](astral-sh/uv#15252)) - Make 'v' prefix cyan in overlap warnings ([#​15259](astral-sh/uv#15259)) ##### Bug fixes - Fix missing uv version in extended Docker image tags ([#​15263](astral-sh/uv#15263)) - Persist cache info when re-installing cached wheels ([#​15274](astral-sh/uv#15274)) ##### Rust API - Allow passing custom `reqwest` clients to `RegistryClient` ([#​15281](astral-sh/uv#15281)) ### [`v0.8.10`](https://github.com/astral-sh/uv/blob/HEAD/CHANGELOG.md#0810) [Compare Source](astral-sh/uv@0.8.9...0.8.10) ##### Python - Add support for installing Pyodide versions ([#​14518](astral-sh/uv#14518)) ##### Enhancements - Allow Python requests with missing segments, e.g., just `aarch64` ([#​14399](astral-sh/uv#14399)) ##### Preview - Move warnings for conflicting modules into preview ([#​15253](astral-sh/uv#15253)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42Ni4yIiwidXBkYXRlZEluVmVyIjoiNDEuNzEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOlsiUmVub3ZhdGUgQm90Il19-->
This allows
PythonDownloadRequest
which is used for parsing general install key requests to have missing segments, which unblocks requests likewindows-aarch64
orcpython-linux
(whereas before those would requireany-any-windows-aarch64
andcpython-any-linux
respectively). We still require strict ordering of segments.Previously, we only allowed missing segments at the end of the key.
This uses a state machine for parsing, which is quite a bit more complicated.
I'm a little hesitant about the possibility that this regresses error messages and the complexity of the implementation, but
uv run -p aarch64
seems valuable following #13724. The alternative to this would probably be to make these explicit in various places? e.g., expose--python-arch
,--python-libc
, and--python-os
? Or make--python-platform
(which already exists) accept a subset of the keys?There is a possibility of regressions here, e.g., if something matches this parser it will not fallback to the
PythonRequest::ExecutableName
case and we've made this parser more permissive, but I think that should be quite rare?