Skip to content

Commit

Permalink
temporarily disable new uv pip dependency-group flags (#10909)
Browse files Browse the repository at this point in the history
We'll probably end up shipping but we were moving ahead with this on the
basis that pip may not even ship this, so let's play it safe and wait
for a bit.
  • Loading branch information
Gankra authored Jan 23, 2025
1 parent 86f2f16 commit c05aca6
Show file tree
Hide file tree
Showing 8 changed files with 5 additions and 1,064 deletions.
68 changes: 0 additions & 68 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1014,40 +1014,6 @@ pub struct PipCompileArgs {
#[arg(long, overrides_with("all_extras"), hide = true)]
pub no_all_extras: bool,

/// Include dependencies from the specified dependency group.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long, conflicts_with("only_group"))]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long, conflicts_with("group"))]
pub only_group: Vec<GroupName>,

/// Include dependencies from all dependency groups.
///
/// Only applies to `pyproject.toml` sources.
///
/// `--no-group` can be used to exclude specific groups.
#[arg(long, conflicts_with_all = [ "group", "only_group" ])]
pub all_groups: bool,

#[command(flatten)]
pub resolver: ResolverArgs,

Expand Down Expand Up @@ -1606,40 +1572,6 @@ pub struct PipInstallArgs {
#[arg(long, overrides_with("all_extras"), hide = true)]
pub no_all_extras: bool,

/// Include dependencies from the specified dependency group.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long, conflicts_with("only_group"))]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
///
/// Only applies to `pyproject.toml` sources.
///
/// May be provided multiple times.
#[arg(long, conflicts_with("group"))]
pub only_group: Vec<GroupName>,

/// Include dependencies from all dependency groups.
///
/// Only applies to `pyproject.toml` sources.
///
/// `--no-group` can be used to exclude specific groups.
#[arg(long, conflicts_with_all = [ "group", "only_group" ])]
pub all_groups: bool,

#[command(flatten)]
pub installer: ResolverInstallerArgs,

Expand Down
46 changes: 1 addition & 45 deletions crates/uv-settings/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use uv_distribution_types::{
};
use uv_install_wheel::linker::LinkMode;
use uv_macros::{CombineOptions, OptionsMetadata};
use uv_normalize::{ExtraName, GroupName, PackageName};
use uv_normalize::{ExtraName, PackageName};
use uv_pep508::Requirement;
use uv_pypi_types::{SupportedEnvironments, VerbatimParsedUrl};
use uv_python::{PythonDownloads, PythonPreference, PythonVersion};
Expand Down Expand Up @@ -1111,50 +1111,6 @@ pub struct PipOptions {
"#
)]
pub no_extra: Option<Vec<ExtraName>>,
/// Include optional dependencies from the specified group; may be provided more than once.
///
/// Only applies to `pyproject.toml` sources.
#[option(
default = "[]",
value_type = "list[str]",
example = r#"
group = ["dev", "docs"]
"#
)]
pub group: Option<Vec<GroupName>>,
/// Exclude optional dependencies from the specified group if `all-groups` are supplied
///
/// Only applies to `pyproject.toml` sources.
#[option(
default = "[]",
value_type = "list[str]",
example = r#"
no-group = ["dev", "docs"]
"#
)]
pub no_group: Option<Vec<GroupName>>,
/// Exclude only dependencies from the specified group.
///
/// Only applies to `pyproject.toml` sources.
#[option(
default = "[]",
value_type = "list[str]",
example = r#"
only-group = ["dev", "docs"]
"#
)]
pub only_group: Option<Vec<GroupName>>,
/// Include all groups.
///
/// Only applies to `pyproject.toml` sources.
#[option(
default = "false",
value_type = "bool",
example = r#"
all-groups = true
"#
)]
pub all_groups: Option<bool>,
/// Ignore package dependencies, instead only add those packages explicitly listed
/// on the command line to the resulting the requirements file.
#[option(
Expand Down
28 changes: 4 additions & 24 deletions crates/uv/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1513,10 +1513,6 @@ impl PipCompileSettings {
extra,
all_extras,
no_all_extras,
group,
no_group,
only_group,
all_groups,
build_constraints,
refresh,
no_deps,
Expand Down Expand Up @@ -1621,10 +1617,6 @@ impl PipCompileSettings {
only_binary,
extra,
all_extras: flag(all_extras, no_all_extras),
group: Some(group),
no_group: Some(no_group),
only_group: Some(only_group),
all_groups: Some(all_groups),
no_deps: flag(no_deps, deps),
output_file,
no_strip_extras: flag(no_strip_extras, strip_extras),
Expand Down Expand Up @@ -1767,10 +1759,6 @@ impl PipInstallSettings {
extra,
all_extras,
no_all_extras,
group,
no_group,
only_group,
all_groups,
installer,
refresh,
no_deps,
Expand Down Expand Up @@ -1866,10 +1854,6 @@ impl PipInstallSettings {
strict: flag(strict, no_strict),
extra,
all_extras: flag(all_extras, no_all_extras),
group: Some(group),
no_group: Some(no_group),
only_group: Some(only_group),
all_groups: Some(all_groups),
no_deps: flag(no_deps, deps),
python_version,
python_platform,
Expand Down Expand Up @@ -2655,10 +2639,6 @@ impl PipSettings {
extra,
all_extras,
no_extra,
group,
no_group,
only_group,
all_groups,
no_deps,
allow_empty_requirements,
resolution,
Expand Down Expand Up @@ -2780,11 +2760,11 @@ impl PipSettings {
false,
false,
false,
args.group.combine(group).unwrap_or_default(),
args.no_group.combine(no_group).unwrap_or_default(),
Vec::new(),
Vec::new(),
false,
Vec::new(),
false,
args.only_group.combine(only_group).unwrap_or_default(),
args.all_groups.combine(all_groups).unwrap_or_default(),
),
dependency_mode: if args.no_deps.combine(no_deps).unwrap_or_default() {
DependencyMode::Direct
Expand Down
Loading

0 comments on commit c05aca6

Please sign in to comment.