Allow file: URLs to include package names (#9493)

## Summary

Closes https://github.com/astral-sh/uv/issues/9489.
This commit is contained in:
Charlie Marsh
2024-11-27 22:27:07 -05:00
committed by GitHub
parent be651ed32d
commit 8a27d4d340
2 changed files with 4 additions and 3 deletions
@@ -45,7 +45,7 @@ impl<'dist> RequirementsTxtDist<'dist> {
}
}
// If the URL is not _definitively_ an absolute `file://` URL, write it as a relative path.
// If the URL is not _definitively_ a `file://` URL, write it as a relative path.
if self.dist.is_local() {
if let VersionOrUrlRef::Url(url) = self.dist.version_or_url() {
let given = url.verbatim();
@@ -72,11 +72,12 @@ impl<'dist> RequirementsTxtDist<'dist> {
{
Some(Cow::Owned(path.to_string()))
} else {
// Ex) `file:///flask-3.0.3-py3-none-any.whl`
None
}
} else {
// Ex) `file:./flask-3.0.3-py3-none-any.whl`
Some(given)
None
}
}
Some(_) => None,
+1 -1
View File
@@ -2887,7 +2887,7 @@ fn compile_wheel_path_dependency() -> Result<()> {
# via flask
click==8.1.7
# via flask
file:flask-3.0.0-py3-none-any.whl
flask @ file:flask-3.0.0-py3-none-any.whl
# via -r requirements.in
itsdangerous==2.1.2
# via flask