Repository navigation
Report missing --find-links directories in requirements files - #22314
Open
astral-automations-bot[bot] wants to merge 6 commits into
Open
astral-automations-bot[bot] wants to merge 6 commits into
astral-automations-bot[bot] wants to merge 6 commits into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The new logic regresses previously accepted HTTP(S) URLs containing embedded control characters.
1 open finding
What changed in this PR
Improves errors for missing local --find-links directories referenced by requirements files.
Changes:
- Preserves missing entries as filesystem paths.
- Updates integration-test snapshots for clearer errors.
| File | Description |
|---|---|
crates/uv-requirements-txt/src/lib.rs |
Converts classified local inputs directly to file URLs. |
crates/uv/tests/pip_install/pip_install.rs |
Updates missing-directory error snapshots. |
🧠 Review effort: Balanced
Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.
Comment on lines
+809
to
+817
| let path = std::path::absolute(path).map_err(RequirementsTxtParserError::Io)?; | ||
| VerbatimUrl::from_absolute_path(path).map_err(|err| { | ||
| RequirementsTxtParserError::VerbatimUrl { | ||
| source: err, | ||
| url: given.to_string(), | ||
| start, | ||
| end: s.cursor(), | ||
| } | ||
| })? |
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.

A missing local
--find-linksdirectory in a requirements file is reparsed as a URL, producingrelative URL without a base. Keep inputs classified as local paths byRequirementsInputon the filesystem path so the error identifies the missing directory.The URL fallback was already present in #4838 and was retained inside
RequirementsInput::Localby #21787. That refactor classifies HTTP(S) URLs, including uppercase schemes, asRemoteand convertsfile://URLs to local paths before this branch. Existing local paths, including URL-like names such ashttps:links, still take precedence. Relative paths continue to resolve against the containing requirements file as in #20832.There is a narrow compatibility change:
split_schemedoes not discard embedded tabs, carriage returns, or line feeds in a scheme, while the full URL parser does. A literal tab can occur directly in the requirements file, and environment-variable expansion can introduce all three. For example,ht\ttp://example.com/links(where\tdenotes a literal tab) is classified as local, but the old fallback accepts it as an HTTP URL. This change instead treats it as a filesystem path. Preserving these accepted inputs requires aligning classification with URL parsing or retaining a successful URL fallback.