mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-23 05:05:02 +00:00
Respect --index-url
provided via requirements.txt (#1719)
## Summary When we read `--index-url` from a `requirements.txt`, we attempt to respect the `--index-url` provided by the CLI if it exists. Unfortunately, `--index-url` from the CLI has a default value... so we _never_ respect the `--index-url` in the requirements file. This PR modifies the CLI to use `None`, and moves the default into logic in the `IndexLocations `struct. Closes https://github.com/astral-sh/uv/issues/1692.
This commit is contained in:
parent
7b2c93f9fb
commit
034f62b24f
7 changed files with 153 additions and 55 deletions
|
@ -56,8 +56,12 @@ pub(crate) async fn resolve_cli(args: ResolveCliArgs) -> Result<()> {
|
|||
|
||||
let platform = Platform::current()?;
|
||||
let venv = Virtualenv::from_env(platform, &cache)?;
|
||||
let index_locations =
|
||||
IndexLocations::from_args(args.index_url, args.extra_index_url, args.find_links, false);
|
||||
let index_locations = IndexLocations::new(
|
||||
Some(args.index_url),
|
||||
args.extra_index_url,
|
||||
args.find_links,
|
||||
false,
|
||||
);
|
||||
let client = RegistryClientBuilder::new(cache.clone())
|
||||
.index_urls(index_locations.index_urls())
|
||||
.build();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue