Repository navigation
Share environment-marker parsing across URL types - #2753
Draft
charliermarsh wants to merge 1 commit into
Draft
charliermarsh wants to merge 1 commit into
charliermarsh wants to merge 1 commit into
Conversation
Merging this PR will not alter performance
|
konstin
pushed a commit
to astral-sh/uv
that referenced
this pull request
Oct 15, 2026
## Summary We decouple the build backend's parsing of `build-system.requires` from uv's supported installation sources. The build frontend resolves and installs these requirements before invoking the backend, so the backend should not enforce uv's Git transport or archive-format restrictions. We retain general requirement and URL parsing while removing distribution classification from this field, allowing the standalone `uv-build` binary to omit Git parsing and archive-extension inference. This intentionally broadens acceptance. The backend now accepts Mercurial references such as `hg+https://example.com/repo` and archive download URLs without a recognized filename extension. It also accepts strings such as `git+banana://example.com/repo` and `git+://example.com/repo` that parse as URLs but fail uv's Git URL validation. Acceptance by the backend does not establish that a requirement is installable; the frontend owns that check. uv's direct-build validation and project-dependency parsing retain their existing URL checks. In the Linux x86_64 comparison against `main` at `e37c1f0c6`, using Rust 1.99.0 and the stripped `minimal-size` profile, `uv-build` shrank from 3,075,808 to 3,029,232 bytes (46,576 bytes, 1.51%). This subsumes the standalone-binary size saving from astral-sh#2753; the two savings are not additive. Co-authored-by: Charlie Marsh <[email protected]>
astral-automations-bot
Bot
force-pushed
the
charlie/codex-uv-build-marker-parser
branch
from
October 18, 2026 03:30
9629d50 to
7e6a823
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Marker parsing never parses URLs, but its error type is generic over the requirement's URL representation. We use an internal marker syntax error and convert it into the public
Pep508Error<T>at the requirement boundary, so the parser is shared across URL types. Error messages and spans are unchanged.On Linux x86_64 with Rust 1.99.0 and the stripped
minimal-sizeprofile,uv-builddecreases from 3,075,808 to 3,069,248 bytes (6,560 bytes, 0.21%) againstmainate37c1f0c6.All 132 PEP 508 tests with all features, 67 backend tests, strict clippy, and formatting pass. A 756-case comparison covering valid and invalid markers in project and build-system requirements produces identical diagnostics and metadata. CLI and archive comparisons also match. Forty CPU-pinned paired runs on a project with 1,000 requirement markers found no statistically resolved runtime change.
For
uv-buildsize, this is an alternative to #2754: narrowing the build-system URL type removes the second marker-parser instantiation. Applying both adds 448 bytes to the combined build, so #2754 is preferable if its URL-validation change is acceptable.