diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index c100672bd..4aa2a0820 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -2596,34 +2596,38 @@ pub struct RunArgs { #[arg(long, overrides_with("all_extras"), hide = true)] pub no_all_extras: bool, - /// Include development dependencies. + /// Include the development dependency group. /// - /// Development dependencies are defined via `tool.uv.dev-dependencies` in a - /// `pyproject.toml`. + /// Development dependencies are defined via `dependency-groups.dev` or + /// `tool.uv.dev-dependencies` in a `pyproject.toml`. + /// + /// This option is an alias for `--group dev`. /// /// This option is only available when running in a project. #[arg(long, overrides_with("no_dev"), hide = true)] pub dev: bool, - /// Omit development dependencies. + /// Omit the development dependency group. + /// + /// This option is an alias of `--no-group dev`. /// /// This option is only available when running in a project. #[arg(long, overrides_with("dev"))] pub no_dev: bool, - /// Include dependencies from the specified local dependency group. + /// Include dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long, conflicts_with("only_group"))] pub group: Vec, - /// Exclude dependencies from the specified local dependency group. + /// Exclude dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long)] pub no_group: Vec, - /// Only include dependencies from the specified local dependency group. + /// Only include dependencies from the specified dependency group. /// /// May be provided multiple times. /// @@ -2637,9 +2641,11 @@ pub struct RunArgs { #[arg(short, long, conflicts_with = "script")] pub module: bool, - /// Omit non-development dependencies. + /// Only include the development dependency group. /// - /// The project itself will also be omitted. + /// Omit other dependencies. The project itself will also be omitted. + /// + /// This option is an alias for `--only-group dev`. #[arg(long, conflicts_with("no_dev"))] pub only_dev: bool, @@ -2794,33 +2800,39 @@ pub struct SyncArgs { #[arg(long, overrides_with("all_extras"), hide = true)] pub no_all_extras: bool, - /// Include development dependencies. + /// Include the development dependency group. + /// + /// This option is an alias for `--group dev`. #[arg(long, overrides_with("no_dev"), hide = true)] pub dev: bool, - /// Omit development dependencies. + /// Omit the development dependency group. + /// + /// This option is an alias for `--no-group dev`. #[arg(long, overrides_with("dev"))] pub no_dev: bool, - /// Omit non-development dependencies. + /// Only include the development dependency group. /// - /// The project itself will also be omitted. + /// Omit other dependencies. The project itself will also be omitted. + /// + /// This option is an alias for `--only-group dev`. #[arg(long, conflicts_with("no_dev"))] pub only_dev: bool, - /// Include dependencies from the specified local dependency group. + /// Include dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long, conflicts_with("only_group"))] pub group: Vec, - /// Exclude dependencies from the specified local dependency group. + /// Exclude dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long)] pub no_group: Vec, - /// Only include dependencies from the specified local dependency group. + /// Only include dependencies from the specified dependency group. /// /// May be provided multiple times. /// @@ -2992,7 +3004,9 @@ pub struct AddArgs { #[arg(long, short, group = "sources", value_parser = parse_file_path)] pub requirements: Vec, - /// Add the requirements as development dependencies. + /// Add the requirements to the development dependency group. + /// + /// This option is an alias for `--group dev`. #[arg(long, conflicts_with("optional"), conflicts_with("group"))] pub dev: bool, @@ -3005,7 +3019,7 @@ pub struct AddArgs { #[arg(long, conflicts_with("dev"), conflicts_with("group"))] pub optional: Option, - /// Add the requirements to the specified local dependency group. + /// Add the requirements to the specified dependency group. /// /// These requirements will not be included in the published metadata for the project. #[arg(long, conflicts_with("dev"), conflicts_with("optional"))] @@ -3114,7 +3128,9 @@ pub struct RemoveArgs { #[arg(required = true)] pub packages: Vec, - /// Remove the packages from the development dependencies. + /// Remove the packages from the development dependency group. + /// + /// This option is an alias for `--group dev`. #[arg(long, conflicts_with("optional"), conflicts_with("group"))] pub dev: bool, @@ -3122,7 +3138,7 @@ pub struct RemoveArgs { #[arg(long, conflicts_with("dev"), conflicts_with("group"))] pub optional: Option, - /// Remove the packages from the specified local dependency group. + /// Remove the packages from the specified dependency group. #[arg(long, conflicts_with("dev"), conflicts_with("optional"))] pub group: Option, @@ -3194,36 +3210,42 @@ pub struct TreeArgs { #[command(flatten)] pub tree: DisplayTreeArgs, - /// Include development dependencies. + /// Include the development dependency group. /// - /// Development dependencies are defined via `tool.uv.dev-dependencies` in a - /// `pyproject.toml`. + /// Development dependencies are defined via `dependency-groups.dev` or + /// `tool.uv.dev-dependencies` in a `pyproject.toml`. + /// + /// This option is an alias for `--group dev`. #[arg(long, overrides_with("no_dev"), hide = true)] pub dev: bool, - /// Omit non-development dependencies. + /// Only include the development dependency group. /// - /// The project itself will also be omitted. + /// Omit other dependencies. The project itself will also be omitted. + /// + /// This option is an alias for `--only-group dev`. #[arg(long, conflicts_with("no_dev"))] pub only_dev: bool, - /// Omit development dependencies. + /// Omit the development dependency group. + /// + /// This option is an alias for `--no-group dev`. #[arg(long, overrides_with("dev"), conflicts_with = "invert")] pub no_dev: bool, - /// Include dependencies from the specified local dependency group. + /// Include dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long, conflicts_with("only_group"))] pub group: Vec, - /// Exclude dependencies from the specified local dependency group. + /// Exclude dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long)] pub no_group: Vec, - /// Only include dependencies from the specified local dependency group. + /// Only include dependencies from the specified dependency group. /// /// May be provided multiple times. /// @@ -3318,33 +3340,39 @@ pub struct ExportArgs { #[arg(long, overrides_with("all_extras"), hide = true)] pub no_all_extras: bool, - /// Include development dependencies. + /// Include the development dependency group. + /// + /// This option is an alias for `--group dev`. #[arg(long, overrides_with("no_dev"), hide = true)] pub dev: bool, - /// Omit development dependencies. + /// Omit the development dependency group. + /// + /// This option is an alias for `--no-group dev`. #[arg(long, overrides_with("dev"))] pub no_dev: bool, - /// Omit non-development dependencies. + /// Only include the development dependency group. /// - /// The project itself will also be omitted. + /// Omit other dependencies. The project itself will also be omitted. + /// + /// This option is an alias for `--only-group dev`. #[arg(long, conflicts_with("no_dev"))] pub only_dev: bool, - /// Include dependencies from the specified local dependency group. + /// Include dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long, conflicts_with("only_group"))] pub group: Vec, - /// Exclude dependencies from the specified local dependency group. + /// Exclude dependencies from the specified dependency group. /// /// May be provided multiple times. #[arg(long)] pub no_group: Vec, - /// Only include dependencies from the specified local dependency group. + /// Only include dependencies from the specified dependency group. /// /// May be provided multiple times. /// diff --git a/crates/uv-workspace/src/pyproject.rs b/crates/uv-workspace/src/pyproject.rs index 631e4891b..10d077501 100644 --- a/crates/uv-workspace/src/pyproject.rs +++ b/crates/uv-workspace/src/pyproject.rs @@ -323,8 +323,15 @@ pub struct ToolUv { )] pub default_groups: Option>, - /// The project's development dependencies. Development dependencies will be installed by - /// default in `uv run` and `uv sync`, but will not appear in the project's published metadata. + /// The project's development dependencies. + /// + /// Development dependencies will be installed by default in `uv run` and `uv sync`, but will + /// not appear in the project's published metadata. + /// + /// Use of this field is not recommend anymore. Instead, use the `dependency-groups.dev` field + /// which is a standardized way to declare development dependencies. The contents of + /// `tool.uv.dev-dependencies` and `dependency-groups.dev` are combined to determine the the + /// final requirements of the `dev` dependency group. #[cfg_attr( feature = "schemars", schemars( diff --git a/docs/reference/cli.md b/docs/reference/cli.md index 9e5f9f93e..30c9a13f1 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -163,7 +163,7 @@ uv run [OPTIONS] [COMMAND]

Instead of checking if the lockfile is up-to-date, uses the versions in the lockfile as the source of truth. If the lockfile is missing, uv will exit with an error. If the pyproject.toml includes changes to dependencies that have not been included in the lockfile yet, they will not be present in the environment.

May also be set with the UV_FROZEN environment variable.

-
--group group

Include dependencies from the specified local dependency group.

+
--group group

Include dependencies from the specified dependency group.

May be provided multiple times.

@@ -280,13 +280,15 @@ uv run [OPTIONS] [COMMAND]

Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

May also be set with the UV_NO_CONFIG environment variable.

-
--no-dev

Omit development dependencies.

+
--no-dev

Omit the development dependency group.

+ +

This option is an alias of --no-group dev.

This option is only available when running in a project.

--no-editable

Install any editable dependencies, including the project and any workspace members, as non-editable

-
--no-group no-group

Exclude dependencies from the specified local dependency group.

+
--no-group no-group

Exclude dependencies from the specified dependency group.

May be provided multiple times.

@@ -315,11 +317,13 @@ uv run [OPTIONS] [COMMAND]

When disabled, uv will only use locally cached data and locally available files.

-
--only-dev

Omit non-development dependencies.

+
--only-dev

Only include the development dependency group.

-

The project itself will also be omitted.

+

Omit other dependencies. The project itself will also be omitted.

-
--only-group only-group

Only include dependencies from the specified local dependency group.

+

This option is an alias for --only-group dev.

+ +
--only-group only-group

Only include dependencies from the specified dependency group.

May be provided multiple times.

@@ -728,7 +732,9 @@ uv add [OPTIONS] >

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

-
--dev

Add the requirements as development dependencies

+
--dev

Add the requirements to the development dependency group.

+ +

This option is an alias for --group dev.

--directory directory

Change to the given directory prior to running the command.

@@ -768,7 +774,7 @@ uv add [OPTIONS] >

The project environment will not be synced.

May also be set with the UV_FROZEN environment variable.

-
--group group

Add the requirements to the specified local dependency group.

+
--group group

Add the requirements to the specified dependency group.

These requirements will not be included in the published metadata for the project.

@@ -1074,7 +1080,9 @@ uv remove [OPTIONS] ...

The index given by this flag is given lower priority than all other indexes specified via the --index flag.

May also be set with the UV_DEFAULT_INDEX environment variable.

-
--dev

Remove the packages from the development dependencies

+
--dev

Remove the packages from the development dependency group.

+ +

This option is an alias for --group dev.

--directory directory

Change to the given directory prior to running the command.

@@ -1106,7 +1114,7 @@ uv remove [OPTIONS] ...

The project environment will not be synced.

May also be set with the UV_FROZEN environment variable.

-
--group group

Remove the packages from the specified local dependency group

+
--group group

Remove the packages from the specified dependency group

--help, -h

Display the concise help for this command

@@ -1430,7 +1438,7 @@ uv sync [OPTIONS]

Instead of checking if the lockfile is up-to-date, uses the versions in the lockfile as the source of truth. If the lockfile is missing, uv will exit with an error. If the pyproject.toml includes changes to dependencies that have not been included in the lockfile yet, they will not be present in the environment.

May also be set with the UV_FROZEN environment variable.

-
--group group

Include dependencies from the specified local dependency group.

+
--group group

Include dependencies from the specified dependency group.

May be provided multiple times.

@@ -1539,11 +1547,13 @@ uv sync [OPTIONS]

Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

May also be set with the UV_NO_CONFIG environment variable.

-
--no-dev

Omit development dependencies

+
--no-dev

Omit the development dependency group.

+ +

This option is an alias for --no-group dev.

--no-editable

Install any editable dependencies, including the project and any workspace members, as non-editable

-
--no-group no-group

Exclude dependencies from the specified local dependency group.

+
--no-group no-group

Exclude dependencies from the specified dependency group.

May be provided multiple times.

@@ -1573,11 +1583,13 @@ uv sync [OPTIONS]

When disabled, uv will only use locally cached data and locally available files.

-
--only-dev

Omit non-development dependencies.

+
--only-dev

Only include the development dependency group.

-

The project itself will also be omitted.

+

Omit other dependencies. The project itself will also be omitted.

-
--only-group only-group

Only include dependencies from the specified local dependency group.

+

This option is an alias for --only-group dev.

+ +
--only-group only-group

Only include dependencies from the specified dependency group.

May be provided multiple times.

@@ -2074,7 +2086,7 @@ uv export [OPTIONS]

If a uv.lock does not exist, uv will exit with an error.

May also be set with the UV_FROZEN environment variable.

-
--group group

Include dependencies from the specified local dependency group.

+
--group group

Include dependencies from the specified dependency group.

May be provided multiple times.

@@ -2181,7 +2193,9 @@ uv export [OPTIONS]

Normally, configuration files are discovered in the current directory, parent directories, or user configuration directories.

May also be set with the UV_NO_CONFIG environment variable.

-
--no-dev

Omit development dependencies

+
--no-dev

Omit the development dependency group.

+ +

This option is an alias for --no-group dev.

--no-editable

Install any editable dependencies, including the project and any workspace members, as non-editable

@@ -2197,7 +2211,7 @@ uv export [OPTIONS]

By default, all workspace members and their dependencies are included in the exported requirements file, with all of their dependencies. The --no-emit-workspace option allows exclusion of all the workspace members while retaining their dependencies.

-
--no-group no-group

Exclude dependencies from the specified local dependency group.

+
--no-group no-group

Exclude dependencies from the specified dependency group.

May be provided multiple times.

@@ -2219,11 +2233,13 @@ uv export [OPTIONS]

When disabled, uv will only use locally cached data and locally available files.

-
--only-dev

Omit non-development dependencies.

+
--only-dev

Only include the development dependency group.

-

The project itself will also be omitted.

+

Omit other dependencies. The project itself will also be omitted.

-
--only-group only-group

Only include dependencies from the specified local dependency group.

+

This option is an alias for --only-group dev.

+ +
--only-group only-group

Only include dependencies from the specified dependency group.

May be provided multiple times.

@@ -2405,7 +2421,7 @@ uv tree [OPTIONS]

If the lockfile is missing, uv will exit with an error.

May also be set with the UV_FROZEN environment variable.

-
--group group

Include dependencies from the specified local dependency group.

+
--group group

Include dependencies from the specified dependency group.

May be provided multiple times.

@@ -2516,9 +2532,11 @@ uv tree [OPTIONS]

May also be set with the UV_NO_CONFIG environment variable.

--no-dedupe

Do not de-duplicate repeated dependencies. Usually, when a package has already displayed its dependencies, further occurrences will not re-display its dependencies, and will include a (*) to indicate it has already been shown. This flag will cause those duplicates to be repeated

-
--no-dev

Omit development dependencies

+
--no-dev

Omit the development dependency group.

-
--no-group no-group

Exclude dependencies from the specified local dependency group.

+

This option is an alias for --no-group dev.

+ +
--no-group no-group

Exclude dependencies from the specified dependency group.

May be provided multiple times.

@@ -2536,11 +2554,13 @@ uv tree [OPTIONS]

When disabled, uv will only use locally cached data and locally available files.

-
--only-dev

Omit non-development dependencies.

+
--only-dev

Only include the development dependency group.

-

The project itself will also be omitted.

+

Omit other dependencies. The project itself will also be omitted.

-
--only-group only-group

Only include dependencies from the specified local dependency group.

+

This option is an alias for --only-group dev.

+ +
--only-group only-group

Only include dependencies from the specified dependency group.

May be provided multiple times.

diff --git a/docs/reference/settings.md b/docs/reference/settings.md index b3fd364bc..222eed8be 100644 --- a/docs/reference/settings.md +++ b/docs/reference/settings.md @@ -49,8 +49,15 @@ default-groups = ["docs"] ### [`dev-dependencies`](#dev-dependencies) {: #dev-dependencies } -The project's development dependencies. Development dependencies will be installed by -default in `uv run` and `uv sync`, but will not appear in the project's published metadata. +The project's development dependencies. + +Development dependencies will be installed by default in `uv run` and `uv sync`, but will +not appear in the project's published metadata. + +Use of this field is not recommend anymore. Instead, use the `dependency-groups.dev` field +which is a standardized way to declare development dependencies. The contents of +`tool.uv.dev-dependencies` and `dependency-groups.dev` are combined to determine the the +final requirements of the `dev` dependency group. **Default value**: `[]`