From 2ed180ea6bc9002b61604d5e9753991da2418f5f Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 20 Nov 2024 10:31:23 -0500 Subject: [PATCH] Accept either singular or plural for CLI constraints (#9196) ## Summary I find myself messing this up with `--build-constraint` vs. `--build-constraints`, and it turns out our own CLI isn't fully consistent here either. --- crates/uv-cli/src/lib.rs | 46 +++--- crates/uv/src/lib.rs | 24 +-- crates/uv/src/settings.rs | 70 ++++----- crates/uv/tests/it/pip_uninstall.rs | 4 +- crates/uv/tests/it/show_settings.rs | 228 ++++++++++++++-------------- docs/reference/cli.md | 26 ++-- 6 files changed, 199 insertions(+), 199 deletions(-) diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 4485fc9c6..4ea5a0330 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -942,8 +942,8 @@ pub struct PipCompileArgs { /// trigger the installation of that package. /// /// This is equivalent to pip's `--constraint` option. - #[arg(long, short, env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub constraint: Vec>, + #[arg(long, short, alias = "constraint", env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub constraints: Vec>, /// Override versions using the given requirements files. /// @@ -954,8 +954,8 @@ pub struct PipCompileArgs { /// While constraints are _additive_, in that they're combined with the requirements of the /// constituent packages, overrides are _absolute_, in that they completely replace the /// requirements of the constituent packages. - #[arg(long, env = EnvVars::UV_OVERRIDE, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub r#override: Vec>, + #[arg(long, alias = "override", env = EnvVars::UV_OVERRIDE, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub overrides: Vec>, /// Constrain build dependencies using the given requirements files when building source /// distributions. @@ -963,8 +963,8 @@ pub struct PipCompileArgs { /// Constraints files are `requirements.txt`-like files that only control the _version_ of a /// requirement that's installed. However, including a package in a constraints file will _not_ /// trigger the installation of that package. - #[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub build_constraint: Vec>, + #[arg(long, short, alias = "build-constraint", env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub build_constraints: Vec>, /// Include optional dependencies from the specified extra name; may be provided more than once. /// @@ -1243,8 +1243,8 @@ pub struct PipSyncArgs { /// trigger the installation of that package. /// /// This is equivalent to pip's `--constraint` option. - #[arg(long, short, env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub constraint: Vec>, + #[arg(long, short, alias = "constraint", env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub constraints: Vec>, /// Constrain build dependencies using the given requirements files when building source /// distributions. @@ -1252,8 +1252,8 @@ pub struct PipSyncArgs { /// Constraints files are `requirements.txt`-like files that only control the _version_ of a /// requirement that's installed. However, including a package in a constraints file will _not_ /// trigger the installation of that package. - #[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub build_constraint: Vec>, + #[arg(long, short, alias = "build-constraint", env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub build_constraints: Vec>, #[command(flatten)] pub installer: InstallerArgs, @@ -1480,8 +1480,8 @@ pub struct PipInstallArgs { /// extract the requirements for the relevant project. /// /// If `-` is provided, then requirements will be read from stdin. - #[arg(long, short, group = "sources", value_parser = parse_file_path)] - pub requirement: Vec, + #[arg(long, short, alias = "requirement", group = "sources", value_parser = parse_file_path)] + pub requirements: Vec, /// Install the editable package based on the provided local file path. #[arg(long, short, group = "sources")] @@ -1494,8 +1494,8 @@ pub struct PipInstallArgs { /// trigger the installation of that package. /// /// This is equivalent to pip's `--constraint` option. - #[arg(long, short, env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub constraint: Vec>, + #[arg(long, short, alias = "constraint", env = EnvVars::UV_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub constraints: Vec>, /// Override versions using the given requirements files. /// @@ -1506,8 +1506,8 @@ pub struct PipInstallArgs { /// While constraints are _additive_, in that they're combined with the requirements of the /// constituent packages, overrides are _absolute_, in that they completely replace the /// requirements of the constituent packages. - #[arg(long, env = EnvVars::UV_OVERRIDE, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub r#override: Vec>, + #[arg(long, alias = "override", env = EnvVars::UV_OVERRIDE, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub overrides: Vec>, /// Constrain build dependencies using the given requirements files when building source /// distributions. @@ -1515,8 +1515,8 @@ pub struct PipInstallArgs { /// Constraints files are `requirements.txt`-like files that only control the _version_ of a /// requirement that's installed. However, including a package in a constraints file will _not_ /// trigger the installation of that package. - #[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub build_constraint: Vec>, + #[arg(long, short, alias = "build-constraint", env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub build_constraints: Vec>, /// Include optional dependencies from the specified extra name; may be provided more than once. /// @@ -1764,8 +1764,8 @@ pub struct PipUninstallArgs { pub package: Vec, /// Uninstall all packages listed in the given requirements files. - #[arg(long, short, group = "sources", value_parser = parse_file_path)] - pub requirement: Vec, + #[arg(long, short, alias = "requirement", group = "sources", value_parser = parse_file_path)] + pub requirements: Vec, /// The Python interpreter from which packages should be uninstalled. /// @@ -2180,8 +2180,8 @@ pub struct BuildArgs { /// Constraints files are `requirements.txt`-like files that only control the _version_ of a /// build dependency that's installed. However, including a package in a constraints file will /// _not_ trigger the inclusion of that package on its own. - #[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] - pub build_constraint: Vec>, + #[arg(long, short, alias = "build-constraint", env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)] + pub build_constraints: Vec>, /// Require a matching hash for each requirement. /// @@ -3047,7 +3047,7 @@ pub struct AddArgs { pub packages: Vec, /// Add all packages listed in the given `requirements.txt` files. - #[arg(long, short, group = "sources", value_parser = parse_file_path)] + #[arg(long, short, alias = "requirement", group = "sources", value_parser = parse_file_path)] pub requirements: Vec, /// Add the requirements to the development dependency group. diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 9da6b293f..cc32ad5e9 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -310,17 +310,17 @@ async fn run(mut cli: Cli) -> Result { .map(RequirementsSource::from_requirements_file) .collect::>(); let constraints = args - .constraint + .constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); let overrides = args - .r#override + .overrides .into_iter() .map(RequirementsSource::from_overrides_txt) .collect::>(); let build_constraints = args - .build_constraint + .build_constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); @@ -402,12 +402,12 @@ async fn run(mut cli: Cli) -> Result { .map(RequirementsSource::from_requirements_file) .collect::>(); let constraints = args - .constraint + .constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); let build_constraints = args - .build_constraint + .build_constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); @@ -469,25 +469,25 @@ async fn run(mut cli: Cli) -> Result { .package .into_iter() .map(RequirementsSource::from_package) - .chain(args.editable.into_iter().map(RequirementsSource::Editable)) + .chain(args.editables.into_iter().map(RequirementsSource::Editable)) .chain( - args.requirement + args.requirements .into_iter() .map(RequirementsSource::from_requirements_file), ) .collect::>(); let constraints = args - .constraint + .constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); let overrides = args - .r#override + .overrides .into_iter() .map(RequirementsSource::from_overrides_txt) .collect::>(); let build_constraints = args - .build_constraint + .build_constraints .into_iter() .map(RequirementsSource::from_overrides_txt) .collect::>(); @@ -552,7 +552,7 @@ async fn run(mut cli: Cli) -> Result { .into_iter() .map(RequirementsSource::from_package) .chain( - args.requirement + args.requirements .into_iter() .map(RequirementsSource::from_requirements_txt), ) @@ -717,7 +717,7 @@ async fn run(mut cli: Cli) -> Result { // Resolve the build constraints. let build_constraints = args - .build_constraint + .build_constraints .into_iter() .map(RequirementsSource::from_constraints_txt) .collect::>(); diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 375b00d97..2e8f7ad8d 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -1323,9 +1323,9 @@ impl ExportSettings { #[derive(Debug, Clone)] pub(crate) struct PipCompileSettings { pub(crate) src_file: Vec, - pub(crate) constraint: Vec, - pub(crate) r#override: Vec, - pub(crate) build_constraint: Vec, + pub(crate) constraints: Vec, + pub(crate) overrides: Vec, + pub(crate) build_constraints: Vec, pub(crate) constraints_from_workspace: Vec, pub(crate) overrides_from_workspace: Vec, pub(crate) environments: SupportedEnvironments, @@ -1338,12 +1338,12 @@ impl PipCompileSettings { pub(crate) fn resolve(args: PipCompileArgs, filesystem: Option) -> Self { let PipCompileArgs { src_file, - constraint, - r#override, + constraints, + overrides, extra, all_extras, no_all_extras, - build_constraint, + build_constraints, refresh, no_deps, deps, @@ -1422,15 +1422,15 @@ impl PipCompileSettings { Self { src_file, - constraint: constraint + constraints: constraints .into_iter() .filter_map(Maybe::into_option) .collect(), - build_constraint: build_constraint + build_constraints: build_constraints .into_iter() .filter_map(Maybe::into_option) .collect(), - r#override: r#override + overrides: overrides .into_iter() .filter_map(Maybe::into_option) .collect(), @@ -1478,8 +1478,8 @@ impl PipCompileSettings { #[derive(Debug, Clone)] pub(crate) struct PipSyncSettings { pub(crate) src_file: Vec, - pub(crate) constraint: Vec, - pub(crate) build_constraint: Vec, + pub(crate) constraints: Vec, + pub(crate) build_constraints: Vec, pub(crate) dry_run: bool, pub(crate) refresh: Refresh, pub(crate) settings: PipSettings, @@ -1490,8 +1490,8 @@ impl PipSyncSettings { pub(crate) fn resolve(args: Box, filesystem: Option) -> Self { let PipSyncArgs { src_file, - constraint, - build_constraint, + constraints, + build_constraints, installer, refresh, require_hashes, @@ -1521,11 +1521,11 @@ impl PipSyncSettings { Self { src_file, - constraint: constraint + constraints: constraints .into_iter() .filter_map(Maybe::into_option) .collect(), - build_constraint: build_constraint + build_constraints: build_constraints .into_iter() .filter_map(Maybe::into_option) .collect(), @@ -1563,11 +1563,11 @@ impl PipSyncSettings { #[derive(Debug, Clone)] pub(crate) struct PipInstallSettings { pub(crate) package: Vec, - pub(crate) requirement: Vec, - pub(crate) editable: Vec, - pub(crate) constraint: Vec, - pub(crate) r#override: Vec, - pub(crate) build_constraint: Vec, + pub(crate) requirements: Vec, + pub(crate) editables: Vec, + pub(crate) constraints: Vec, + pub(crate) overrides: Vec, + pub(crate) build_constraints: Vec, pub(crate) dry_run: bool, pub(crate) constraints_from_workspace: Vec, pub(crate) overrides_from_workspace: Vec, @@ -1581,11 +1581,11 @@ impl PipInstallSettings { pub(crate) fn resolve(args: PipInstallArgs, filesystem: Option) -> Self { let PipInstallArgs { package, - requirement, + requirements, editable, - constraint, - r#override, - build_constraint, + constraints, + overrides, + build_constraints, extra, all_extras, no_all_extras, @@ -1648,17 +1648,17 @@ impl PipInstallSettings { Self { package, - requirement, - editable, - constraint: constraint + requirements, + editables: editable, + constraints: constraints .into_iter() .filter_map(Maybe::into_option) .collect(), - r#override: r#override + overrides: overrides .into_iter() .filter_map(Maybe::into_option) .collect(), - build_constraint: build_constraint + build_constraints: build_constraints .into_iter() .filter_map(Maybe::into_option) .collect(), @@ -1702,7 +1702,7 @@ impl PipInstallSettings { #[derive(Debug, Clone)] pub(crate) struct PipUninstallSettings { pub(crate) package: Vec, - pub(crate) requirement: Vec, + pub(crate) requirements: Vec, pub(crate) settings: PipSettings, } @@ -1711,7 +1711,7 @@ impl PipUninstallSettings { pub(crate) fn resolve(args: PipUninstallArgs, filesystem: Option) -> Self { let PipUninstallArgs { package, - requirement, + requirements, python, keyring_provider, system, @@ -1725,7 +1725,7 @@ impl PipUninstallSettings { Self { package, - requirement, + requirements, settings: PipSettings::combine( PipOptions { python: python.and_then(Maybe::into_option), @@ -1954,7 +1954,7 @@ pub(crate) struct BuildSettings { pub(crate) sdist: bool, pub(crate) wheel: bool, pub(crate) build_logs: bool, - pub(crate) build_constraint: Vec, + pub(crate) build_constraints: Vec, pub(crate) hash_checking: Option, pub(crate) python: Option, pub(crate) install_mirrors: PythonInstallMirrors, @@ -1972,7 +1972,7 @@ impl BuildSettings { all_packages, sdist, wheel, - build_constraint, + build_constraints, require_hashes, no_require_hashes, verify_hashes, @@ -1998,7 +1998,7 @@ impl BuildSettings { sdist, wheel, build_logs: flag(build_logs, no_build_logs).unwrap_or(true), - build_constraint: build_constraint + build_constraints: build_constraints .into_iter() .filter_map(Maybe::into_option) .collect(), diff --git a/crates/uv/tests/it/pip_uninstall.rs b/crates/uv/tests/it/pip_uninstall.rs index 3a0f24926..31f329f52 100644 --- a/crates/uv/tests/it/pip_uninstall.rs +++ b/crates/uv/tests/it/pip_uninstall.rs @@ -19,9 +19,9 @@ fn no_arguments() { ----- stderr ----- error: the following required arguments were not provided: - > + > - Usage: uv pip uninstall > + Usage: uv pip uninstall > For more information, try '--help'. "### diff --git a/crates/uv/tests/it/show_settings.rs b/crates/uv/tests/it/show_settings.rs index b87b3e7d6..3b5ab3dc9 100644 --- a/crates/uv/tests/it/show_settings.rs +++ b/crates/uv/tests/it/show_settings.rs @@ -71,9 +71,9 @@ fn resolve_uv_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -224,9 +224,9 @@ fn resolve_uv_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -378,9 +378,9 @@ fn resolve_uv_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -564,9 +564,9 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -719,9 +719,9 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -854,9 +854,9 @@ fn resolve_pyproject_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1032,9 +1032,9 @@ fn resolve_index_url() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1215,9 +1215,9 @@ fn resolve_index_url() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1451,9 +1451,9 @@ fn resolve_find_links() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1628,9 +1628,9 @@ fn resolve_top_level() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1769,9 +1769,9 @@ fn resolve_top_level() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -1950,9 +1950,9 @@ fn resolve_top_level() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -2155,9 +2155,9 @@ fn resolve_user_configuration() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -2286,9 +2286,9 @@ fn resolve_user_configuration() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -2417,9 +2417,9 @@ fn resolve_user_configuration() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -2550,9 +2550,9 @@ fn resolve_user_configuration() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -2863,9 +2863,9 @@ fn resolve_poetry_toml() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3022,9 +3022,9 @@ fn resolve_both() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3298,9 +3298,9 @@ fn resolve_config_file() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3552,9 +3552,9 @@ fn resolve_skip_empty() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3686,9 +3686,9 @@ fn resolve_skip_empty() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3839,9 +3839,9 @@ fn allow_insecure_host() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -3984,9 +3984,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -4167,9 +4167,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -4356,9 +4356,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -4540,9 +4540,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -4731,9 +4731,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -4915,9 +4915,9 @@ fn index_priority() -> anyhow::Result<()> { src_file: [ "requirements.in", ], - constraint: [], - override: [], - build_constraint: [], + constraints: [], + overrides: [], + build_constraints: [], constraints_from_workspace: [], overrides_from_workspace: [], environments: SupportedEnvironments( @@ -5110,13 +5110,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], @@ -5235,13 +5235,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], @@ -5358,13 +5358,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], @@ -5483,13 +5483,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], @@ -5606,13 +5606,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], @@ -5730,13 +5730,13 @@ fn verify_hashes() -> anyhow::Result<()> { } PipInstallSettings { package: [], - requirement: [ + requirements: [ "requirements.in", ], - editable: [], - constraint: [], - override: [], - build_constraint: [], + editables: [], + constraints: [], + overrides: [], + build_constraints: [], dry_run: false, constraints_from_workspace: [], overrides_from_workspace: [], diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 5e1233e29..20c781919 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -5198,7 +5198,7 @@ uv pip compile [OPTIONS] ...
  • split: Render each annotation on its own line
  • -
    --build-constraint, -b build-constraint

    Constrain build dependencies using the given requirements files when building source distributions.

    +
    --build-constraints, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -5229,7 +5229,7 @@ uv pip compile [OPTIONS] ...

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, -C config-setting

    Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

    -
    --constraint, -c constraint

    Constrain versions using the given requirements files.

    +
    --constraints, -c constraints

    Constrain versions using the given requirements files.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -5421,7 +5421,7 @@ uv pip compile [OPTIONS] ...

    If the file already exists, the existing versions will be preferred when resolving dependencies, unless --upgrade is also specified.

    -
    --override override

    Override versions using the given requirements files.

    +
    --overrides overrides

    Override versions using the given requirements files.

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    @@ -5648,7 +5648,7 @@ uv pip sync [OPTIONS] ...

    WARNING: --break-system-packages is intended for use in continuous integration (CI) environments, when installing into Python installations that are managed by an external package manager, like apt. It should be used with caution, as such Python installations explicitly recommend against modifications by other package managers (like uv or pip).

    May also be set with the UV_BREAK_SYSTEM_PACKAGES environment variable.

    -
    --build-constraint, -b build-constraint

    Constrain build dependencies using the given requirements files when building source distributions.

    +
    --build-constraints, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -5686,7 +5686,7 @@ uv pip sync [OPTIONS] ...

    May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, -C config-setting

    Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

    -
    --constraint, -c constraint

    Constrain versions using the given requirements files.

    +
    --constraints, -c constraints

    Constrain versions using the given requirements files.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -6009,7 +6009,7 @@ Install packages into an environment

    Usage

    ``` -uv pip install [OPTIONS] |--editable > +uv pip install [OPTIONS] |--editable > ```

    Arguments

    @@ -6040,7 +6040,7 @@ uv pip install [OPTIONS] |--editable WARNING: --break-system-packages is intended for use in continuous integration (CI) environments, when installing into Python installations that are managed by an external package manager, like apt. It should be used with caution, as such Python installations explicitly recommend against modifications by other package managers (like uv or pip).

    May also be set with the UV_BREAK_SYSTEM_PACKAGES environment variable.

    -
    --build-constraint, -b build-constraint

    Constrain build dependencies using the given requirements files when building source distributions.

    +
    --build-constraints, -b build-constraints

    Constrain build dependencies using the given requirements files when building source distributions.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -6078,7 +6078,7 @@ uv pip install [OPTIONS] |--editable May also be set with the UV_CONFIG_FILE environment variable.

    --config-setting, -C config-setting

    Settings to pass to the PEP 517 build backend, specified as KEY=VALUE pairs

    -
    --constraint, -c constraint

    Constrain versions using the given requirements files.

    +
    --constraints, -c constraints

    Constrain versions using the given requirements files.

    Constraints files are requirements.txt-like files that only control the version of a requirement that’s installed. However, including a package in a constraints file will not trigger the installation of that package.

    @@ -6253,7 +6253,7 @@ uv pip install [OPTIONS] |--editable Multiple packages may be provided. Disable binaries for all packages with :all:. Clear previously specified packages with :none:.

    -
    --override override

    Override versions using the given requirements files.

    +
    --overrides overrides

    Override versions using the given requirements files.

    Overrides files are requirements.txt-like files that force a specific version of a requirement to be installed, regardless of the requirements declared by any constituent package, and regardless of whether this would be considered an invalid resolution.

    @@ -6421,7 +6421,7 @@ uv pip install [OPTIONS] |--editable

    May also be set with the UV_REQUIRE_HASHES environment variable.

    -
    --requirement, -r requirement

    Install all packages listed in the given requirements.txt files.

    +
    --requirements, -r requirements

    Install all packages listed in the given requirements.txt files.

    If a pyproject.toml, setup.py, or setup.cfg file is provided, uv will extract the requirements for the relevant project.

    @@ -6471,7 +6471,7 @@ Uninstall packages from an environment

    Usage

    ``` -uv pip uninstall [OPTIONS] > +uv pip uninstall [OPTIONS] > ```

    Arguments

    @@ -6605,7 +6605,7 @@ uv pip uninstall [OPTIONS] >
    --quiet, -q

    Do not print any output

    -
    --requirement, -r requirement

    Uninstall all packages listed in the given requirements files

    +
    --requirements, -r requirements

    Uninstall all packages listed in the given requirements files

    --system

    Use the system Python to uninstall packages.

    @@ -7697,7 +7697,7 @@ uv build [OPTIONS] [SRC]

    WARNING: Hosts included in this list will not be verified against the system’s certificate store. Only use --allow-insecure-host in a secure network with verified sources, as it bypasses SSL verification and could expose you to MITM attacks.

    May also be set with the UV_INSECURE_HOST environment variable.

    -
    --build-constraint, -b build-constraint

    Constrain build dependencies using the given requirements files when building distributions.

    +
    --build-constraints, -b build-constraints

    Constrain build dependencies using the given requirements files when building distributions.

    Constraints files are requirements.txt-like files that only control the version of a build dependency that’s installed. However, including a package in a constraints file will not trigger the inclusion of that package on its own.