mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-18 06:18:53 +00:00
Respect --index-url
in uv pip list
(#8942)
## Summary As an oversight, these arguments weren't being respected from the CLI or elsewhere -- we always hit PyPI, ignored `--exclude-newer`, etc. It has to do with the way that the `PipOptions` are setup -- there's a global struct that we pass around everywhere and fill in with defaults, so there's no type safety to guarantee that we provide whatever it is we need to use in the command. The newer APIs are much better about this. Closes #8927.
This commit is contained in:
parent
0b4e5cffa6
commit
04c445a3db
5 changed files with 185 additions and 8 deletions
|
@ -5,7 +5,7 @@ use uv_resolver::PrereleaseMode;
|
|||
use uv_settings::{Combine, PipOptions, ResolverInstallerOptions, ResolverOptions};
|
||||
|
||||
use crate::{
|
||||
BuildOptionsArgs, IndexArgs, InstallerArgs, Maybe, RefreshArgs, ResolverArgs,
|
||||
BuildOptionsArgs, FetchArgs, IndexArgs, InstallerArgs, Maybe, RefreshArgs, ResolverArgs,
|
||||
ResolverInstallerArgs,
|
||||
};
|
||||
|
||||
|
@ -163,6 +163,24 @@ impl From<ResolverInstallerArgs> for PipOptions {
|
|||
}
|
||||
}
|
||||
|
||||
impl From<FetchArgs> for PipOptions {
|
||||
fn from(args: FetchArgs) -> Self {
|
||||
let FetchArgs {
|
||||
index_args,
|
||||
index_strategy,
|
||||
keyring_provider,
|
||||
exclude_newer,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
index_strategy,
|
||||
keyring_provider,
|
||||
exclude_newer,
|
||||
..PipOptions::from(index_args)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl From<IndexArgs> for PipOptions {
|
||||
fn from(args: IndexArgs) -> Self {
|
||||
let IndexArgs {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue