Skip to content

Commit 0d12174

Browse files
committed
Rewrite some references to "optional groups" (#8454)
## Summary We generally want to avoid references to "optional groups" now that dependency groups are a first-class, standardized concept.
1 parent 88d0458 commit 0d12174

File tree

8 files changed

+26
-29
lines changed

8 files changed

+26
-29
lines changed

CHANGELOG.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,8 +1901,7 @@ and `uv tool run` ([#4717](https://github.com/astral-sh/uv/pull/4717))
19011901
- Add `uv tool uninstall` ([#4641](https://github.com/astral-sh/uv/pull/4641))
19021902
- Add support for specifying `name@version` in `uv tool run` ([#4572](https://github.com/astral-sh/uv/pull/4572))
19031903
- Allow `uv add` to specify optional dependency groups ([#4607](https://github.com/astral-sh/uv/pull/4607))
1904-
- Allow the package spec to be passed positionally
1905-
in `uv tool install` ([#4564](https://github.com/astral-sh/uv/pull/4564))
1904+
- Allow the package spec to be passed positionally in `uv tool install` ([#4564](https://github.com/astral-sh/uv/pull/4564))
19061905
- Avoid infinite loop for cyclic installs ([#4633](https://github.com/astral-sh/uv/pull/4633))
19071906
- Indent wheels like dependencies in the lockfile ([#4582](https://github.com/astral-sh/uv/pull/4582))
19081907
- Sync all packages in a virtual workspace ([#4636](https://github.com/astral-sh/uv/pull/4636))

crates/uv-cli/src/lib.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -945,7 +945,7 @@ pub struct PipCompileArgs {
945945
#[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)]
946946
pub build_constraint: Vec<Maybe<PathBuf>>,
947947

948-
/// Include optional dependencies from the extra group name; may be provided more than once.
948+
/// Include optional dependencies from the specified extra name; may be provided more than once.
949949
///
950950
/// Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources.
951951
#[arg(long, conflicts_with = "all_extras", value_parser = extra_name_with_clap_error)]
@@ -1494,7 +1494,7 @@ pub struct PipInstallArgs {
14941494
#[arg(long, short, env = EnvVars::UV_BUILD_CONSTRAINT, value_delimiter = ' ', value_parser = parse_maybe_file_path)]
14951495
pub build_constraint: Vec<Maybe<PathBuf>>,
14961496

1497-
/// Include optional dependencies from the extra group name; may be provided more than once.
1497+
/// Include optional dependencies from the specified extra name; may be provided more than once.
14981498
///
14991499
/// Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources.
15001500
#[arg(long, conflicts_with = "all_extras", value_parser = extra_name_with_clap_error)]
@@ -2573,7 +2573,7 @@ pub struct InitArgs {
25732573
#[derive(Args)]
25742574
#[allow(clippy::struct_excessive_bools)]
25752575
pub struct RunArgs {
2576-
/// Include optional dependencies from the extra group name.
2576+
/// Include optional dependencies from the specified extra name.
25772577
///
25782578
/// May be provided more than once.
25792579
///
@@ -2769,7 +2769,7 @@ pub struct RunArgs {
27692769
#[derive(Args)]
27702770
#[allow(clippy::struct_excessive_bools)]
27712771
pub struct SyncArgs {
2772-
/// Include optional dependencies from the extra group name.
2772+
/// Include optional dependencies from the specified extra name.
27732773
///
27742774
/// May be provided more than once.
27752775
///
@@ -2977,13 +2977,12 @@ pub struct AddArgs {
29772977
#[arg(long, conflicts_with("optional"), conflicts_with("group"))]
29782978
pub dev: bool,
29792979

2980-
/// Add the requirements to the specified optional dependency group.
2980+
/// Add the requirements to the package's optional dependencies for the specified extra.
29812981
///
29822982
/// The group may then be activated when installing the project with the
29832983
/// `--extra` flag.
29842984
///
2985-
/// To enable an optional dependency group for this requirement instead, see
2986-
/// `--extra`.
2985+
/// To enable an optional extra for this requirement instead, see `--extra`.
29872986
#[arg(long, conflicts_with("dev"), conflicts_with("group"))]
29882987
pub optional: Option<ExtraName>,
29892988

@@ -3030,8 +3029,7 @@ pub struct AddArgs {
30303029
///
30313030
/// May be provided more than once.
30323031
///
3033-
/// To add this dependency to an optional group in the current project
3034-
/// instead, see `--optional`.
3032+
/// To add this dependency to an optional extra instead, see `--optional`.
30353033
#[arg(long)]
30363034
pub extra: Option<Vec<ExtraName>>,
30373035

@@ -3101,7 +3099,7 @@ pub struct RemoveArgs {
31013099
#[arg(long, conflicts_with("optional"), conflicts_with("group"))]
31023100
pub dev: bool,
31033101

3104-
/// Remove the packages from the specified optional dependency group.
3102+
/// Remove the packages from the project's optional dependencies for the specified extra.
31053103
#[arg(long, conflicts_with("dev"), conflicts_with("group"))]
31063104
pub optional: Option<ExtraName>,
31073105

@@ -3282,7 +3280,7 @@ pub struct ExportArgs {
32823280
#[arg(long)]
32833281
pub package: Option<PackageName>,
32843282

3285-
/// Include optional dependencies from the extra group name.
3283+
/// Include optional dependencies from the specified extra name.
32863284
///
32873285
/// May be provided more than once.
32883286
#[arg(long, conflicts_with = "all_extras", value_parser = extra_name_with_clap_error)]

crates/uv-resolver/src/lock/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3864,7 +3864,7 @@ enum LockErrorKind {
38643864
/// The ID of the package for which a duplicate dependency was
38653865
/// found.
38663866
id: PackageId,
3867-
/// The name of the optional dependency group.
3867+
/// The name of the extra.
38683868
extra: ExtraName,
38693869
/// The ID of the conflicting dependency.
38703870
dependency: Dependency,

crates/uv-settings/src/settings.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -921,7 +921,7 @@ pub struct PipOptions {
921921
"#
922922
)]
923923
pub strict: Option<bool>,
924-
/// Include optional dependencies from the extra group name; may be provided more than once.
924+
/// Include optional dependencies from the specified extra; may be provided more than once.
925925
///
926926
/// Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources.
927927
#[option(

docs/concepts/projects.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ same time.
481481
uv requires that all optional dependencies ("extras") declared by the project are compatible with
482482
each other and resolves all optional dependencies together when creating the lockfile.
483483

484-
If optional dependencies declared in one group are not compatible with those in another group, uv
484+
If optional dependencies declared in one extra are not compatible with those in another extra, uv
485485
will fail to resolve the requirements of the project with an error.
486486

487487
!!! note
@@ -727,8 +727,8 @@ no-build-isolation-package = ["cchardet"]
727727

728728
Installing packages without build isolation requires that the package's build dependencies are
729729
installed in the project environment _prior_ to installing the package itself. This can be achieved
730-
by separating out the build dependencies and the packages that require them into distinct optional
731-
groups. For example:
730+
by separating out the build dependencies and the packages that require them into distinct extras.
731+
For example:
732732

733733
```toml title="pyproject.toml"
734734
[project]

docs/reference/cli.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ uv run [OPTIONS] [COMMAND]
136136
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>
137137

138138
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p>
139-
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the extra group name.</p>
139+
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
140140

141141
<p>May be provided more than once.</p>
142142

@@ -743,7 +743,7 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
743743

744744
<p>May be provided more than once.</p>
745745

746-
<p>To add this dependency to an optional group in the current project instead, see <code>--optional</code>.</p>
746+
<p>To add this dependency to an optional extra instead, see <code>--optional</code>.</p>
747747

748748
</dd><dt><code>--extra-index-url</code> <i>extra-index-url</i></dt><dd><p>(Deprecated: use <code>--index</code> instead) Extra URLs of package indexes to use, in addition to <code>--index-url</code>.</p>
749749

@@ -886,11 +886,11 @@ uv add [OPTIONS] <PACKAGES|--requirements <REQUIREMENTS>>
886886

887887
<p>When disabled, uv will only use locally cached data and locally available files.</p>
888888

889-
</dd><dt><code>--optional</code> <i>optional</i></dt><dd><p>Add the requirements to the specified optional dependency group.</p>
889+
</dd><dt><code>--optional</code> <i>optional</i></dt><dd><p>Add the requirements to the package&#8217;s optional dependencies for the specified extra.</p>
890890

891891
<p>The group may then be activated when installing the project with the <code>--extra</code> flag.</p>
892892

893-
<p>To enable an optional dependency group for this requirement instead, see <code>--extra</code>.</p>
893+
<p>To enable an optional extra for this requirement instead, see <code>--extra</code>.</p>
894894

895895
</dd><dt><code>--package</code> <i>package</i></dt><dd><p>Add the dependency to a specific package in the workspace</p>
896896

@@ -1222,7 +1222,7 @@ uv remove [OPTIONS] <PACKAGES>...
12221222

12231223
<p>When disabled, uv will only use locally cached data and locally available files.</p>
12241224

1225-
</dd><dt><code>--optional</code> <i>optional</i></dt><dd><p>Remove the packages from the specified optional dependency group</p>
1225+
</dd><dt><code>--optional</code> <i>optional</i></dt><dd><p>Remove the packages from the project&#8217;s optional dependencies for the specified extra</p>
12261226

12271227
</dd><dt><code>--package</code> <i>package</i></dt><dd><p>Remove the dependencies from a specific package in the workspace</p>
12281228

@@ -1401,7 +1401,7 @@ uv sync [OPTIONS]
14011401
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>
14021402

14031403
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p>
1404-
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the extra group name.</p>
1404+
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
14051405

14061406
<p>May be provided more than once.</p>
14071407

@@ -2029,7 +2029,7 @@ uv export [OPTIONS]
20292029
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>
20302030

20312031
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p>
2032-
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the extra group name.</p>
2032+
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name.</p>
20332033

20342034
<p>May be provided more than once.</p>
20352035

@@ -4951,7 +4951,7 @@ uv pip compile [OPTIONS] <SRC_FILE>...
49514951
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>
49524952

49534953
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p>
4954-
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the extra group name; may be provided more than once.</p>
4954+
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
49554955

49564956
<p>Only applies to <code>pyproject.toml</code>, <code>setup.py</code>, and <code>setup.cfg</code> sources.</p>
49574957

@@ -5715,7 +5715,7 @@ uv pip install [OPTIONS] <PACKAGE|--requirement <REQUIREMENT>|--editable <EDITAB
57155715
<p>Accepts both RFC 3339 timestamps (e.g., <code>2006-12-02T02:07:43Z</code>) and local dates in the same format (e.g., <code>2006-12-02</code>) in your system&#8217;s configured time zone.</p>
57165716

57175717
<p>May also be set with the <code>UV_EXCLUDE_NEWER</code> environment variable.</p>
5718-
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the extra group name; may be provided more than once.</p>
5718+
</dd><dt><code>--extra</code> <i>extra</i></dt><dd><p>Include optional dependencies from the specified extra name; may be provided more than once.</p>
57195719

57205720
<p>Only applies to <code>pyproject.toml</code>, <code>setup.py</code>, and <code>setup.cfg</code> sources.</p>
57215721

docs/reference/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1890,7 +1890,7 @@ system's configured time zone.
18901890
#### [`extra`](#pip_extra) {: #pip_extra }
18911891
<span id="extra"></span>
18921892

1893-
Include optional dependencies from the extra group name; may be provided more than once.
1893+
Include optional dependencies from the specified extra; may be provided more than once.
18941894

18951895
Only applies to `pyproject.toml`, `setup.py`, and `setup.cfg` sources.
18961896

uv.schema.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)