Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cleanup some dependency-group docs #11284

Merged
merged 4 commits into from
Feb 7, 2025
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 55 additions & 35 deletions crates/uv-cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2697,9 +2697,10 @@ pub struct RunArgs {
#[arg(long, overrides_with("no_dev"), hide = true)]
pub dev: bool,

/// Omit the development dependency group.
/// Disable the development dependency group.
///
/// This option is an alias of `--no-group dev`.
/// You probably actually want `--no-default-groups`.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
///
/// This option is only available when running in a project.
#[arg(long, overrides_with("dev"))]
Expand All @@ -2711,23 +2712,27 @@ pub struct RunArgs {
#[arg(long, conflicts_with_all = ["only_group", "only_dev"])]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
/// Disable the specified dependency group.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
///
/// This is specifically for disabling individual default groups or to
/// modify `--all-groups`. It also has priority over `--group`.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Exclude dependencies from default groups.
/// Don't implicitly include the default dependency groups.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
///
/// `--group` can be used to include specific groups.
/// `--group` can still be used to add back individual defaulted groups,
/// making this unlike `--no-group <some-default-group>`.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
#[arg(long)]
pub no_default_groups: bool,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
Gankra marked this conversation as resolved.
Show resolved Hide resolved
///
/// May be provided multiple times.
/// May be provided multiple times. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "dev", "all_groups"])]
pub only_group: Vec<GroupName>,

Expand All @@ -2745,9 +2750,9 @@ pub struct RunArgs {

/// Only include the development dependency group.
///
/// Omit other dependencies. The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// This option is an alias for `--only-group dev`.
/// This option is an alias for `--only-group dev`. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "all_groups", "no_dev"])]
pub only_dev: bool,

Expand Down Expand Up @@ -2969,17 +2974,18 @@ pub struct SyncArgs {
#[arg(long, overrides_with("no_dev"), hide = true)]
pub dev: bool,

/// Omit the development dependency group.
/// Disable the development dependency group.
///
/// This option is an alias for `--no-group dev`.
/// This option is an alias of `--no-group dev`.
/// You probably actually want `--no-default-groups`.
#[arg(long, overrides_with("dev"))]
pub no_dev: bool,

/// Only include the development dependency group.
///
/// Omit other dependencies. The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// This option is an alias for `--only-group dev`.
/// This option is an alias for `--only-group dev`. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "all_groups", "no_dev"])]
pub only_dev: bool,

Expand All @@ -2992,23 +2998,27 @@ pub struct SyncArgs {
#[arg(long, conflicts_with_all = ["only_group", "only_dev"])]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
/// Disable the specified dependency group.
///
/// This is specifically for disabling individual default groups or to
/// modify `--all-groups`. It also has priority over `--group`.
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Exclude dependencies from default groups.
/// Don't implicitly include the default dependency groups.
///
/// `--group` can be used to include specific groups.
/// `--group` can still be used to add back individual defaulted groups,
/// making this unlike `--no-group <some-default-group>`.
#[arg(long)]
pub no_default_groups: bool,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// May be provided multiple times.
/// May be provided multiple times. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "dev", "all_groups"])]
pub only_group: Vec<GroupName>,

Expand Down Expand Up @@ -3455,15 +3465,16 @@ pub struct TreeArgs {

/// Only include the development dependency group.
///
/// Omit other dependencies. The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// This option is an alias for `--only-group dev`.
/// This option is an alias for `--only-group dev`. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "all_groups", "no_dev"])]
pub only_dev: bool,

/// Omit the development dependency group.
/// Disable the development dependency group.
///
/// This option is an alias for `--no-group dev`.
/// This option is an alias of `--no-group dev`.
/// You probably actually want `--no-default-groups`.
#[arg(long, overrides_with("dev"))]
pub no_dev: bool,

Expand All @@ -3473,23 +3484,27 @@ pub struct TreeArgs {
#[arg(long, conflicts_with_all = ["only_group", "only_dev"])]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
/// Disable the specified dependency group.
///
/// This is specifically for disabling individual default groups or to
/// modify `--all-groups`. It also has priority over `--group`.
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Exclude dependencies from default groups.
/// Don't implicitly include the default dependency groups.
///
/// `--group` can be used to include specific groups.
/// `--group` can still be used to add back individual defaulted groups,
/// making this unlike `--no-group <some-default-group>`.
#[arg(long)]
pub no_default_groups: bool,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// May be provided multiple times.
/// May be provided multiple times. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "dev", "all_groups"])]
pub only_group: Vec<GroupName>,

Expand Down Expand Up @@ -3621,17 +3636,18 @@ pub struct ExportArgs {
#[arg(long, overrides_with("no_dev"), hide = true)]
pub dev: bool,

/// Omit the development dependency group.
/// Disable the development dependency group.
///
/// This option is an alias for `--no-group dev`.
/// This option is an alias of `--no-group dev`.
/// You probably actually want `--no-default-groups`.
#[arg(long, overrides_with("dev"))]
pub no_dev: bool,

/// Only include the development dependency group.
///
/// Omit other dependencies. The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// This option is an alias for `--only-group dev`.
/// This option is an alias for `--only-group dev`. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "all_groups", "no_dev"])]
pub only_dev: bool,

Expand All @@ -3641,23 +3657,27 @@ pub struct ExportArgs {
#[arg(long, conflicts_with_all = ["only_group", "only_dev"])]
pub group: Vec<GroupName>,

/// Exclude dependencies from the specified dependency group.
/// Disable the specified dependency group.
///
/// This is specifically for disabling individual default groups or to
/// modify `--all-groups`. It also has priority over `--group`.
///
/// May be provided multiple times.
#[arg(long)]
pub no_group: Vec<GroupName>,

/// Exclude dependencies from default groups.
/// Don't implicitly include the default dependency groups.
///
/// `--group` can be used to include specific groups.
/// `--group` can still be used to add back individual defaulted groups,
/// making this unlike `--no-group <some-default-group>`.
#[arg(long)]
pub no_default_groups: bool,

/// Only include dependencies from the specified dependency group.
///
/// The project itself will also be omitted.
/// The project and its normal dependencies will be omitted.
///
/// May be provided multiple times.
/// May be provided multiple times. Implies `--no-default-groups`.
#[arg(long, conflicts_with_all = ["group", "dev", "all_groups"])]
pub only_group: Vec<GroupName>,

Expand Down
11 changes: 6 additions & 5 deletions docs/concepts/projects/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,8 @@ dev = [
```

The `dev` group is special-cased; there are `--dev`, `--only-dev`, and `--no-dev` flags to toggle
inclusion or exclusion of its dependencies. Additionally, the `dev` group is
[synced by default](#default-groups).
inclusion or exclusion of its dependencies, although you probably want `--no-default-groups` over
`--no-dev`. Additionally, the `dev` group is [synced by default](#default-groups).
Gankra marked this conversation as resolved.
Show resolved Hide resolved

### Dependency groups

Expand All @@ -633,8 +633,8 @@ lint = [
]
```

Once groups are defined, the `--group`, `--only-group`, and `--no-group` options can be used to
include or exclude their dependencies.
Once groups are defined, the `--all-groups`, `--no-default-groups`, `--group`, `--only-group`, and
`--no-group` options can be used to include or exclude their dependencies.

!!! tip

Expand Down Expand Up @@ -664,7 +664,8 @@ default-groups = ["dev", "foo"]

!!! tip

To exclude a default group during `uv run` or `uv sync`, use `--no-group <name>`.
To disable this behaviour during `uv run` or `uv sync`, use `--no-default-groups`.
To exclude a specific default group, use `--no-group <name>`.

### Legacy `dev-dependencies`

Expand Down
Loading
Loading