mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-02 06:51:14 +00:00
Extract index arguments into their own Clap group (#3985)
## Summary Just removes a lot of repeated documentation. We can expand this strategy in the future.
This commit is contained in:
parent
da1782808a
commit
a4c73fd07e
2 changed files with 78 additions and 291 deletions
|
@ -397,42 +397,8 @@ pub(crate) struct PipCompileArgs {
|
||||||
#[arg(long, value_enum, env = "UV_LINK_MODE")]
|
#[arg(long, value_enum, env = "UV_LINK_MODE")]
|
||||||
pub(crate) link_mode: Option<install_wheel_rs::linker::LinkMode>,
|
pub(crate) link_mode: Option<install_wheel_rs::linker::LinkMode>,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The strategy to use when resolving against multiple index URLs.
|
/// The strategy to use when resolving against multiple index URLs.
|
||||||
///
|
///
|
||||||
|
@ -680,42 +646,8 @@ pub(crate) struct PipSyncArgs {
|
||||||
#[arg(long, value_enum, env = "UV_LINK_MODE")]
|
#[arg(long, value_enum, env = "UV_LINK_MODE")]
|
||||||
pub(crate) link_mode: Option<install_wheel_rs::linker::LinkMode>,
|
pub(crate) link_mode: Option<install_wheel_rs::linker::LinkMode>,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The strategy to use when resolving against multiple index URLs.
|
/// The strategy to use when resolving against multiple index URLs.
|
||||||
///
|
///
|
||||||
|
@ -820,7 +752,6 @@ pub(crate) struct PipSyncArgs {
|
||||||
/// Disable isolation when building source distributions.
|
/// Disable isolation when building source distributions.
|
||||||
///
|
///
|
||||||
/// Assumes that build dependencies specified by PEP 518 are already installed.
|
/// Assumes that build dependencies specified by PEP 518 are already installed.
|
||||||
|
|
||||||
#[arg(
|
#[arg(
|
||||||
long,
|
long,
|
||||||
env = "UV_NO_BUILD_ISOLATION",
|
env = "UV_NO_BUILD_ISOLATION",
|
||||||
|
@ -1067,42 +998,8 @@ pub(crate) struct PipInstallArgs {
|
||||||
#[arg(long, hide = true)]
|
#[arg(long, hide = true)]
|
||||||
pub(crate) pre: bool,
|
pub(crate) pre: bool,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The strategy to use when resolving against multiple index URLs.
|
/// The strategy to use when resolving against multiple index URLs.
|
||||||
///
|
///
|
||||||
|
@ -1124,8 +1021,12 @@ pub(crate) struct PipInstallArgs {
|
||||||
/// - Editable installs are not supported.
|
/// - Editable installs are not supported.
|
||||||
/// - Local dependencies are not supported, unless they point to a specific wheel (`.whl`) or
|
/// - Local dependencies are not supported, unless they point to a specific wheel (`.whl`) or
|
||||||
/// source archive (`.zip`, `.tar.gz`), as opposed to a directory.
|
/// source archive (`.zip`, `.tar.gz`), as opposed to a directory.
|
||||||
#[arg(long, env = "UV_REQUIRE_HASHES",
|
#[arg(
|
||||||
value_parser = clap::builder::BoolishValueParser::new(), overrides_with("no_require_hashes"))]
|
long,
|
||||||
|
env = "UV_REQUIRE_HASHES",
|
||||||
|
value_parser = clap::builder::BoolishValueParser::new(),
|
||||||
|
overrides_with("no_require_hashes"),
|
||||||
|
)]
|
||||||
pub(crate) require_hashes: bool,
|
pub(crate) require_hashes: bool,
|
||||||
|
|
||||||
#[arg(long, overrides_with("require_hashes"), hide = true)]
|
#[arg(long, overrides_with("require_hashes"), hide = true)]
|
||||||
|
@ -1811,42 +1712,8 @@ pub(crate) struct RunArgs {
|
||||||
#[arg(long, short = 'P')]
|
#[arg(long, short = 'P')]
|
||||||
pub(crate) upgrade_package: Vec<PackageName>,
|
pub(crate) upgrade_package: Vec<PackageName>,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The Python interpreter to use to build the run environment.
|
/// The Python interpreter to use to build the run environment.
|
||||||
///
|
///
|
||||||
|
@ -1904,42 +1771,8 @@ pub(crate) struct SyncArgs {
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub(crate) refresh_package: Vec<PackageName>,
|
pub(crate) refresh_package: Vec<PackageName>,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The Python interpreter to use to build the run environment.
|
/// The Python interpreter to use to build the run environment.
|
||||||
///
|
///
|
||||||
|
@ -1986,42 +1819,8 @@ pub(crate) struct LockArgs {
|
||||||
#[arg(long, short = 'P')]
|
#[arg(long, short = 'P')]
|
||||||
pub(crate) upgrade_package: Vec<PackageName>,
|
pub(crate) upgrade_package: Vec<PackageName>,
|
||||||
|
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
#[command(flatten)]
|
||||||
///
|
pub(crate) index_args: IndexArgs,
|
||||||
/// The index given by this flag is given lower priority than all other
|
|
||||||
/// indexes specified via the `--extra-index-url` flag.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, short, env = "UV_INDEX_URL", value_parser = parse_index_url)]
|
|
||||||
pub(crate) index_url: Option<Maybe<IndexUrl>>,
|
|
||||||
|
|
||||||
/// Extra URLs of package indexes to use, in addition to `--index-url`.
|
|
||||||
///
|
|
||||||
/// All indexes given via this flag take priority over the index
|
|
||||||
/// in `--index-url` (which defaults to PyPI). And when multiple
|
|
||||||
/// `--extra-index-url` flags are given, earlier values take priority.
|
|
||||||
///
|
|
||||||
/// Unlike `pip`, `uv` will stop looking for versions of a package as soon
|
|
||||||
/// as it finds it in an index. That is, it isn't possible for `uv` to
|
|
||||||
/// consider versions of the same package across multiple indexes.
|
|
||||||
#[arg(long, env = "UV_EXTRA_INDEX_URL", value_delimiter = ' ', value_parser = parse_index_url)]
|
|
||||||
pub(crate) extra_index_url: Option<Vec<Maybe<IndexUrl>>>,
|
|
||||||
|
|
||||||
/// Locations to search for candidate distributions, beyond those found in the indexes.
|
|
||||||
///
|
|
||||||
/// If a path, the target must be a directory that contains package as wheel files (`.whl`) or
|
|
||||||
/// source distributions (`.tar.gz` or `.zip`) at the top level.
|
|
||||||
///
|
|
||||||
/// If a URL, the page must contain a flat list of links to package files.
|
|
||||||
#[arg(long, short)]
|
|
||||||
pub(crate) find_links: Option<Vec<FlatIndexLocation>>,
|
|
||||||
|
|
||||||
/// Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those
|
|
||||||
/// discovered via `--find-links`.
|
|
||||||
#[arg(long)]
|
|
||||||
pub(crate) no_index: bool,
|
|
||||||
|
|
||||||
/// The Python interpreter to use to build the run environment.
|
/// The Python interpreter to use to build the run environment.
|
||||||
///
|
///
|
||||||
|
@ -2091,6 +1890,26 @@ pub(crate) struct ToolRunArgs {
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub(crate) with: Vec<String>,
|
pub(crate) with: Vec<String>,
|
||||||
|
|
||||||
|
#[command(flatten)]
|
||||||
|
pub(crate) index_args: IndexArgs,
|
||||||
|
|
||||||
|
/// The Python interpreter to use to build the run environment.
|
||||||
|
///
|
||||||
|
/// By default, `uv` uses the virtual environment in the current working directory or any parent
|
||||||
|
/// directory, falling back to searching for a Python executable in `PATH`. The `--python`
|
||||||
|
/// option allows you to specify a different interpreter.
|
||||||
|
///
|
||||||
|
/// Supported formats:
|
||||||
|
/// - `3.10` looks for an installed Python 3.10 using `py --list-paths` on Windows, or
|
||||||
|
/// `python3.10` on Linux and macOS.
|
||||||
|
/// - `python3.10` or `python.exe` looks for a binary with the given name in `PATH`.
|
||||||
|
/// - `/home/ferris/.local/bin/python3.10` uses the exact Python at the given path.
|
||||||
|
#[arg(long, short, env = "UV_PYTHON", verbatim_doc_comment)]
|
||||||
|
pub(crate) python: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Args)]
|
||||||
|
pub(crate) struct IndexArgs {
|
||||||
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
/// The URL of the Python package index (by default: <https://pypi.org/simple>).
|
||||||
///
|
///
|
||||||
/// The index given by this flag is given lower priority than all other
|
/// The index given by this flag is given lower priority than all other
|
||||||
|
@ -2127,18 +1946,4 @@ pub(crate) struct ToolRunArgs {
|
||||||
/// discovered via `--find-links`.
|
/// discovered via `--find-links`.
|
||||||
#[arg(long)]
|
#[arg(long)]
|
||||||
pub(crate) no_index: bool,
|
pub(crate) no_index: bool,
|
||||||
|
|
||||||
/// The Python interpreter to use to build the run environment.
|
|
||||||
///
|
|
||||||
/// By default, `uv` uses the virtual environment in the current working directory or any parent
|
|
||||||
/// directory, falling back to searching for a Python executable in `PATH`. The `--python`
|
|
||||||
/// option allows you to specify a different interpreter.
|
|
||||||
///
|
|
||||||
/// Supported formats:
|
|
||||||
/// - `3.10` looks for an installed Python 3.10 using `py --list-paths` on Windows, or
|
|
||||||
/// `python3.10` on Linux and macOS.
|
|
||||||
/// - `python3.10` or `python.exe` looks for a binary with the given name in `PATH`.
|
|
||||||
/// - `/home/ferris/.local/bin/python3.10` uses the exact Python at the given path.
|
|
||||||
#[arg(long, short, env = "UV_PYTHON", verbatim_doc_comment)]
|
|
||||||
pub(crate) python: Option<String>,
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,10 +128,8 @@ impl RunSettings {
|
||||||
upgrade,
|
upgrade,
|
||||||
no_upgrade,
|
no_upgrade,
|
||||||
upgrade_package,
|
upgrade_package,
|
||||||
index_url,
|
|
||||||
extra_index_url,
|
index_args,
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
python,
|
python,
|
||||||
exclude_newer,
|
exclude_newer,
|
||||||
package,
|
package,
|
||||||
|
@ -139,8 +137,9 @@ impl RunSettings {
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
index_locations: IndexLocations::new(
|
index_locations: IndexLocations::new(
|
||||||
index_url.and_then(Maybe::into_option),
|
index_args.index_url.and_then(Maybe::into_option),
|
||||||
extra_index_url
|
index_args
|
||||||
|
.extra_index_url
|
||||||
.map(|extra_index_urls| {
|
.map(|extra_index_urls| {
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -148,8 +147,8 @@ impl RunSettings {
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
find_links.unwrap_or_default(),
|
index_args.find_links.unwrap_or_default(),
|
||||||
no_index,
|
index_args.no_index,
|
||||||
),
|
),
|
||||||
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
||||||
upgrade: Upgrade::from_args(flag(upgrade, no_upgrade), upgrade_package),
|
upgrade: Upgrade::from_args(flag(upgrade, no_upgrade), upgrade_package),
|
||||||
|
@ -188,17 +187,15 @@ impl ToolRunSettings {
|
||||||
args,
|
args,
|
||||||
from,
|
from,
|
||||||
with,
|
with,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
python,
|
python,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
index_locations: IndexLocations::new(
|
index_locations: IndexLocations::new(
|
||||||
index_url.and_then(Maybe::into_option),
|
index_args.index_url.and_then(Maybe::into_option),
|
||||||
extra_index_url
|
index_args
|
||||||
|
.extra_index_url
|
||||||
.map(|extra_index_urls| {
|
.map(|extra_index_urls| {
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -206,8 +203,8 @@ impl ToolRunSettings {
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
find_links.unwrap_or_default(),
|
index_args.find_links.unwrap_or_default(),
|
||||||
no_index,
|
index_args.no_index,
|
||||||
),
|
),
|
||||||
target,
|
target,
|
||||||
args,
|
args,
|
||||||
|
@ -239,17 +236,15 @@ impl SyncSettings {
|
||||||
refresh,
|
refresh,
|
||||||
no_refresh,
|
no_refresh,
|
||||||
refresh_package,
|
refresh_package,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
python,
|
python,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
index_locations: IndexLocations::new(
|
index_locations: IndexLocations::new(
|
||||||
index_url.and_then(Maybe::into_option),
|
index_args.index_url.and_then(Maybe::into_option),
|
||||||
extra_index_url
|
index_args
|
||||||
|
.extra_index_url
|
||||||
.map(|extra_index_urls| {
|
.map(|extra_index_urls| {
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -257,8 +252,8 @@ impl SyncSettings {
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
find_links.unwrap_or_default(),
|
index_args.find_links.unwrap_or_default(),
|
||||||
no_index,
|
index_args.no_index,
|
||||||
),
|
),
|
||||||
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
||||||
extras: ExtrasSpecification::from_args(
|
extras: ExtrasSpecification::from_args(
|
||||||
|
@ -292,18 +287,16 @@ impl LockSettings {
|
||||||
upgrade,
|
upgrade,
|
||||||
no_upgrade,
|
no_upgrade,
|
||||||
upgrade_package,
|
upgrade_package,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
exclude_newer,
|
exclude_newer,
|
||||||
python,
|
python,
|
||||||
} = args;
|
} = args;
|
||||||
|
|
||||||
Self {
|
Self {
|
||||||
index_locations: IndexLocations::new(
|
index_locations: IndexLocations::new(
|
||||||
index_url.and_then(Maybe::into_option),
|
index_args.index_url.and_then(Maybe::into_option),
|
||||||
extra_index_url
|
index_args
|
||||||
|
.extra_index_url
|
||||||
.map(|extra_index_urls| {
|
.map(|extra_index_urls| {
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
@ -311,8 +304,8 @@ impl LockSettings {
|
||||||
.collect()
|
.collect()
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
find_links.unwrap_or_default(),
|
index_args.find_links.unwrap_or_default(),
|
||||||
no_index,
|
index_args.no_index,
|
||||||
),
|
),
|
||||||
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
refresh: Refresh::from_args(flag(refresh, no_refresh), refresh_package),
|
||||||
upgrade: Upgrade::from_args(flag(upgrade, no_upgrade), upgrade_package),
|
upgrade: Upgrade::from_args(flag(upgrade, no_upgrade), upgrade_package),
|
||||||
|
@ -368,12 +361,9 @@ impl PipCompileSettings {
|
||||||
no_refresh,
|
no_refresh,
|
||||||
refresh_package,
|
refresh_package,
|
||||||
link_mode,
|
link_mode,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
no_index,
|
|
||||||
index_strategy,
|
index_strategy,
|
||||||
keyring_provider,
|
keyring_provider,
|
||||||
find_links,
|
|
||||||
python,
|
python,
|
||||||
system,
|
system,
|
||||||
no_system,
|
no_system,
|
||||||
|
@ -441,15 +431,15 @@ impl PipCompileSettings {
|
||||||
python,
|
python,
|
||||||
system: flag(system, no_system),
|
system: flag(system, no_system),
|
||||||
|
|
||||||
index_url: index_url.and_then(Maybe::into_option),
|
index_url: index_args.index_url.and_then(Maybe::into_option),
|
||||||
extra_index_url: extra_index_url.map(|extra_index_urls| {
|
extra_index_url: index_args.extra_index_url.map(|extra_index_urls| {
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Maybe::into_option)
|
.filter_map(Maybe::into_option)
|
||||||
.collect()
|
.collect()
|
||||||
}),
|
}),
|
||||||
no_index: Some(no_index),
|
no_index: Some(index_args.no_index),
|
||||||
find_links,
|
find_links: index_args.find_links,
|
||||||
index_strategy,
|
index_strategy,
|
||||||
keyring_provider,
|
keyring_provider,
|
||||||
no_build: flag(no_build, build),
|
no_build: flag(no_build, build),
|
||||||
|
@ -523,10 +513,7 @@ impl PipSyncSettings {
|
||||||
no_refresh,
|
no_refresh,
|
||||||
refresh_package,
|
refresh_package,
|
||||||
link_mode,
|
link_mode,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
index_strategy,
|
index_strategy,
|
||||||
require_hashes,
|
require_hashes,
|
||||||
no_require_hashes,
|
no_require_hashes,
|
||||||
|
@ -575,16 +562,15 @@ impl PipSyncSettings {
|
||||||
system: flag(system, no_system),
|
system: flag(system, no_system),
|
||||||
break_system_packages: flag(break_system_packages, no_break_system_packages),
|
break_system_packages: flag(break_system_packages, no_break_system_packages),
|
||||||
target,
|
target,
|
||||||
|
index_url: index_args.index_url.and_then(Maybe::into_option),
|
||||||
index_url: index_url.and_then(Maybe::into_option),
|
extra_index_url: index_args.extra_index_url.map(|extra_index_urls| {
|
||||||
extra_index_url: extra_index_url.map(|extra_index_urls| {
|
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Maybe::into_option)
|
.filter_map(Maybe::into_option)
|
||||||
.collect()
|
.collect()
|
||||||
}),
|
}),
|
||||||
no_index: Some(no_index),
|
no_index: Some(index_args.no_index),
|
||||||
find_links,
|
find_links: index_args.find_links,
|
||||||
index_strategy,
|
index_strategy,
|
||||||
keyring_provider,
|
keyring_provider,
|
||||||
no_build: flag(no_build, build),
|
no_build: flag(no_build, build),
|
||||||
|
@ -661,10 +647,7 @@ impl PipInstallSettings {
|
||||||
resolution,
|
resolution,
|
||||||
prerelease,
|
prerelease,
|
||||||
pre,
|
pre,
|
||||||
index_url,
|
index_args,
|
||||||
extra_index_url,
|
|
||||||
find_links,
|
|
||||||
no_index,
|
|
||||||
index_strategy,
|
index_strategy,
|
||||||
require_hashes,
|
require_hashes,
|
||||||
no_require_hashes,
|
no_require_hashes,
|
||||||
|
@ -736,16 +719,15 @@ impl PipInstallSettings {
|
||||||
system: flag(system, no_system),
|
system: flag(system, no_system),
|
||||||
break_system_packages: flag(break_system_packages, no_break_system_packages),
|
break_system_packages: flag(break_system_packages, no_break_system_packages),
|
||||||
target,
|
target,
|
||||||
|
index_url: index_args.index_url.and_then(Maybe::into_option),
|
||||||
index_url: index_url.and_then(Maybe::into_option),
|
extra_index_url: index_args.extra_index_url.map(|extra_index_urls| {
|
||||||
extra_index_url: extra_index_url.map(|extra_index_urls| {
|
|
||||||
extra_index_urls
|
extra_index_urls
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter_map(Maybe::into_option)
|
.filter_map(Maybe::into_option)
|
||||||
.collect()
|
.collect()
|
||||||
}),
|
}),
|
||||||
no_index: Some(no_index),
|
no_index: Some(index_args.no_index),
|
||||||
find_links,
|
find_links: index_args.find_links,
|
||||||
index_strategy,
|
index_strategy,
|
||||||
keyring_provider,
|
keyring_provider,
|
||||||
no_build: flag(no_build, build),
|
no_build: flag(no_build, build),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue