Skip to content

Report missing --find-links directories in requirements files - #22314

Open
astral-automations-bot[bot] wants to merge 6 commits into
mainfrom
zb/find-links-missing-directory-error
Open

astral-automations-bot[bot] wants to merge 6 commits into
mainfrom
zb/find-links-missing-directory-error

Conversation

@astral-automations-bot

@astral-automations-bot astral-automations-bot Bot commented Oct 7, 2026 •

Copy link
Copy Markdown
Contributor

A missing local --find-links directory in a requirements file is reparsed as a URL, producing relative URL without a base. Keep inputs classified as local paths by RequirementsInput on the filesystem path so the error identifies the missing directory.

The URL fallback was already present in #4838 and was retained inside RequirementsInput::Local by #21787. That refactor classifies HTTP(S) URLs, including uppercase schemes, as Remote and converts file:// URLs to local paths before this branch. Existing local paths, including URL-like names such as https:links, still take precedence. Relative paths continue to resolve against the containing requirements file as in #20832.

There is a narrow compatibility change: split_scheme does 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 \t denotes 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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

1 active deployment
automations — da5f0288 Deployed Oct 7, 2026 by astral-automations-bot[bot] via review / security review #50061
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants