mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-20 03:49:54 +00:00
Support environment variables in index URLs in requirements files (#2036)
## Summary This also preserves the environment variables in the output file, e.g.: ``` Resolved 1 package in 216ms # This file was autogenerated by uv via the following command: # uv pip compile requirements.in --emit-index-url --index-url https://test.pypi.org/${SUFFIX} requests==2.5.4.1 ``` I'm torn on whether that's correct or undesirable here. Closes #2035.
This commit is contained in:
parent
1df977f86b
commit
b873e3e991
14 changed files with 140 additions and 70 deletions
|
|
@ -6,6 +6,7 @@ use rustc_hash::FxHashMap;
|
|||
|
||||
use distribution_types::{CachedRegistryDist, FlatIndexLocation, IndexLocations, IndexUrl};
|
||||
use pep440_rs::Version;
|
||||
use pep508_rs::VerbatimUrl;
|
||||
use platform_tags::Tags;
|
||||
use uv_cache::{Cache, CacheBucket, WheelCache};
|
||||
use uv_fs::{directories, symlinks};
|
||||
|
|
@ -83,7 +84,9 @@ impl<'a> RegistryWheelIndex<'a> {
|
|||
.flat_index()
|
||||
.filter_map(|flat_index| match flat_index {
|
||||
FlatIndexLocation::Path(_) => None,
|
||||
FlatIndexLocation::Url(url) => Some(IndexUrl::Url(url.clone())),
|
||||
FlatIndexLocation::Url(url) => {
|
||||
Some(IndexUrl::Url(VerbatimUrl::unknown(url.clone())))
|
||||
}
|
||||
})
|
||||
.collect();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue