mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-03 05:03:46 +00:00
Add --no-sources to avoid reading from tool.uv.sources (#5801)
## Summary Closes https://github.com/astral-sh/uv/issues/5791.
This commit is contained in:
parent
478d32c655
commit
089f50a845
27 changed files with 455 additions and 40 deletions
|
|
@ -2919,6 +2919,12 @@ pub struct InstallerArgs {
|
|||
help_heading = "Installer options"
|
||||
)]
|
||||
pub no_compile_bytecode: bool,
|
||||
|
||||
/// Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the
|
||||
/// standards-compliant, publishable package metadata, as opposed to using any local or Git
|
||||
/// sources.
|
||||
#[arg(long)]
|
||||
pub no_sources: bool,
|
||||
}
|
||||
|
||||
/// Arguments that are used by commands that need to resolve (but not install) packages.
|
||||
|
|
@ -3035,6 +3041,12 @@ pub struct ResolverArgs {
|
|||
help_heading = "Installer options"
|
||||
)]
|
||||
pub link_mode: Option<install_wheel_rs::linker::LinkMode>,
|
||||
|
||||
/// Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the
|
||||
/// standards-compliant, publishable package metadata, as opposed to using any local or Git
|
||||
/// sources.
|
||||
#[arg(long)]
|
||||
pub no_sources: bool,
|
||||
}
|
||||
|
||||
/// Arguments that are used by commands that need to resolve and install packages.
|
||||
|
|
@ -3199,6 +3211,12 @@ pub struct ResolverInstallerArgs {
|
|||
help_heading = "Installer options"
|
||||
)]
|
||||
pub no_compile_bytecode: bool,
|
||||
|
||||
/// Ignore the `tool.uv.sources` table when resolving dependencies. Used to lock against the
|
||||
/// standards-compliant, publishable package metadata, as opposed to using any local or Git
|
||||
/// sources.
|
||||
#[arg(long)]
|
||||
pub no_sources: bool,
|
||||
}
|
||||
|
||||
#[derive(Args)]
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ impl From<ResolverArgs> for PipOptions {
|
|||
config_setting,
|
||||
exclude_newer,
|
||||
link_mode,
|
||||
no_sources,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -61,6 +62,7 @@ impl From<ResolverArgs> for PipOptions {
|
|||
.map(|config_settings| config_settings.into_iter().collect::<ConfigSettings>()),
|
||||
exclude_newer,
|
||||
link_mode,
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
..PipOptions::from(index_args)
|
||||
}
|
||||
}
|
||||
|
|
@ -80,6 +82,7 @@ impl From<InstallerArgs> for PipOptions {
|
|||
link_mode,
|
||||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -92,6 +95,7 @@ impl From<InstallerArgs> for PipOptions {
|
|||
exclude_newer,
|
||||
link_mode,
|
||||
compile_bytecode: flag(compile_bytecode, no_compile_bytecode),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
..PipOptions::from(index_args)
|
||||
}
|
||||
}
|
||||
|
|
@ -117,6 +121,7 @@ impl From<ResolverInstallerArgs> for PipOptions {
|
|||
link_mode,
|
||||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
} = args;
|
||||
|
||||
Self {
|
||||
|
|
@ -137,6 +142,7 @@ impl From<ResolverInstallerArgs> for PipOptions {
|
|||
exclude_newer,
|
||||
link_mode,
|
||||
compile_bytecode: flag(compile_bytecode, no_compile_bytecode),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
..PipOptions::from(index_args)
|
||||
}
|
||||
}
|
||||
|
|
@ -181,6 +187,7 @@ pub fn resolver_options(resolver_args: ResolverArgs, build_args: BuildArgs) -> R
|
|||
config_setting,
|
||||
exclude_newer,
|
||||
link_mode,
|
||||
no_sources,
|
||||
} = resolver_args;
|
||||
|
||||
let BuildArgs {
|
||||
|
|
@ -224,6 +231,7 @@ pub fn resolver_options(resolver_args: ResolverArgs, build_args: BuildArgs) -> R
|
|||
no_build_package: Some(no_build_package),
|
||||
no_binary: flag(no_binary, binary),
|
||||
no_binary_package: Some(no_binary_package),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -250,6 +258,7 @@ pub fn resolver_installer_options(
|
|||
link_mode,
|
||||
compile_bytecode,
|
||||
no_compile_bytecode,
|
||||
no_sources,
|
||||
} = resolver_installer_args;
|
||||
|
||||
let BuildArgs {
|
||||
|
|
@ -296,5 +305,6 @@ pub fn resolver_installer_options(
|
|||
no_build_package: Some(no_build_package),
|
||||
no_binary: flag(no_binary, binary),
|
||||
no_binary_package: Some(no_binary_package),
|
||||
no_sources: if no_sources { Some(true) } else { None },
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue