diff --git a/crates/uv-cli/src/lib.rs b/crates/uv-cli/src/lib.rs index 583e557ed..28745e526 100644 --- a/crates/uv-cli/src/lib.rs +++ b/crates/uv-cli/src/lib.rs @@ -3713,35 +3713,63 @@ pub struct SyncArgs { /// of its dependencies are still installed. This is particularly useful in situations like /// building Docker images where installing the project separately from its dependencies allows /// optimal layer caching. - #[arg(long)] + /// + /// The inverse `--only-install-project` can be used to install _only_ the project itself, + /// excluding all dependencies. + #[arg(long, conflicts_with = "only_install_project")] pub no_install_project: bool, + /// Only install the current project. + #[arg(long, conflicts_with = "no_install_project", hide = true)] + pub only_install_project: bool, + /// Do not install any workspace members, including the root project. /// - /// By default, all of the workspace members and their dependencies are installed into the + /// By default, all workspace members and their dependencies are installed into the /// environment. The `--no-install-workspace` option allows exclusion of all the workspace /// members while retaining their dependencies. This is particularly useful in situations like /// building Docker images where installing the workspace separately from its dependencies /// allows optimal layer caching. - #[arg(long)] + /// + /// The inverse `--only-install-workspace` can be used to install _only_ workspace members, + /// excluding all other dependencies. + #[arg(long, conflicts_with = "only_install_workspace")] pub no_install_workspace: bool, + /// Only install workspace members, including the root project. + #[arg(long, conflicts_with = "no_install_workspace", hide = true)] + pub only_install_workspace: bool, + /// Do not install local path dependencies /// /// Skips the current project, workspace members, and any other local (path or editable) /// packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache /// heavy third-party dependencies first and layer local packages separately. - #[arg(long)] + /// + /// The inverse `--only-install-local` can be used to install _only_ local packages, excluding + /// all remote dependencies. + #[arg(long, conflicts_with = "only_install_local")] pub no_install_local: bool, + /// Only install local path dependencies + #[arg(long, conflicts_with = "no_install_local", hide = true)] + pub only_install_local: bool, + /// Do not install the given package(s). /// /// By default, all of the project's dependencies are installed into the environment. The /// `--no-install-package` option allows exclusion of specific packages. Note this can result /// in a broken environment, and should be used with caution. - #[arg(long)] + /// + /// The inverse `--only-install-package` can be used to install _only_ the specified packages, + /// excluding all others. + #[arg(long, conflicts_with = "only_install_package")] pub no_install_package: Vec, + /// Only install the given package(s). + #[arg(long, conflicts_with = "no_install_package", hide = true)] + pub only_install_package: Vec, + /// Assert that the `uv.lock` will remain unchanged. /// /// Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, @@ -4158,26 +4186,106 @@ pub struct AddArgs { /// its dependencies are still installed. This is particularly useful in situations like building /// Docker images where installing the project separately from its dependencies allows optimal /// layer caching. - #[arg(long, conflicts_with = "frozen", conflicts_with = "no_sync")] + /// + /// The inverse `--only-install-project` can be used to install _only_ the project itself, + /// excluding all dependencies. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "only_install_project" + )] pub no_install_project: bool, + /// Only install the current project. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "no_install_project", + hide = true + )] + pub only_install_project: bool, + /// Do not install any workspace members, including the current project. /// - /// By default, all of the workspace members and their dependencies are installed into the + /// By default, all workspace members and their dependencies are installed into the /// environment. The `--no-install-workspace` option allows exclusion of all the workspace /// members while retaining their dependencies. This is particularly useful in situations like /// building Docker images where installing the workspace separately from its dependencies /// allows optimal layer caching. - #[arg(long, conflicts_with = "frozen", conflicts_with = "no_sync")] + /// + /// The inverse `--only-install-workspace` can be used to install _only_ workspace members, + /// excluding all other dependencies. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "only_install_workspace" + )] pub no_install_workspace: bool, + /// Only install workspace members, including the current project. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "no_install_workspace", + hide = true + )] + pub only_install_workspace: bool, + /// Do not install local path dependencies /// /// Skips the current project, workspace members, and any other local (path or editable) /// packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache /// heavy third-party dependencies first and layer local packages separately. - #[arg(long, conflicts_with = "frozen", conflicts_with = "no_sync")] + /// + /// The inverse `--only-install-local` can be used to install _only_ local packages, excluding + /// all remote dependencies. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "only_install_local" + )] pub no_install_local: bool, + + /// Only install local path dependencies + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "no_install_local", + hide = true + )] + pub only_install_local: bool, + + /// Do not install the given package(s). + /// + /// By default, all project's dependencies are installed into the environment. The + /// `--no-install-package` option allows exclusion of specific packages. Note this can result + /// in a broken environment, and should be used with caution. + /// + /// The inverse `--only-install-package` can be used to install _only_ the specified packages, + /// excluding all others. + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "only_install_package" + )] + pub no_install_package: Vec, + + /// Only install the given package(s). + #[arg( + long, + conflicts_with = "frozen", + conflicts_with = "no_sync", + conflicts_with = "no_install_package", + hide = true + )] + pub only_install_package: Vec, } #[derive(Args)] @@ -4564,32 +4672,92 @@ pub struct ExportArgs { /// By default, the current project is included in the exported requirements file with all of /// its dependencies. The `--no-emit-project` option allows the project to be excluded, but all /// of its dependencies to remain included. - #[arg(long, alias = "no-install-project")] + /// + /// The inverse `--only-emit-project` can be used to emit _only_ the project itself, excluding + /// all dependencies. + #[arg( + long, + alias = "no-install-project", + conflicts_with = "only_emit_project" + )] pub no_emit_project: bool, + /// Only emit the current project. + #[arg( + long, + alias = "only-install-project", + conflicts_with = "no_emit_project", + hide = true + )] + pub only_emit_project: bool, + /// Do not emit any workspace members, including the root project. /// /// 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. - #[arg(long, alias = "no-install-workspace")] + /// + /// The inverse `--only-emit-workspace` can be used to emit _only_ workspace members, excluding + /// all other dependencies. + #[arg( + long, + alias = "no-install-workspace", + conflicts_with = "only_emit_workspace" + )] pub no_emit_workspace: bool, + /// Only emit workspace members, including the root project. + #[arg( + long, + alias = "only-install-workspace", + conflicts_with = "no_emit_workspace", + hide = true + )] + pub only_emit_workspace: bool, + /// Do not include local path dependencies in the exported requirements. /// /// Omits the current project, workspace members, and any other local (path or editable) /// packages from the export. Only remote/indexed dependencies are written. Useful for Docker /// and CI flows that want to export and cache third-party dependencies first. - #[arg(long, alias = "no-install-local")] + /// + /// The inverse `--only-emit-local` can be used to emit _only_ local packages, excluding all + /// remote dependencies. + #[arg(long, alias = "no-install-local", conflicts_with = "only_emit_local")] pub no_emit_local: bool, + /// Only include local path dependencies in the exported requirements. + #[arg( + long, + alias = "only-install-local", + conflicts_with = "no_emit_local", + hide = true + )] + pub only_emit_local: bool, + /// Do not emit the given package(s). /// - /// By default, all of the project's dependencies are included in the exported requirements + /// By default, all project's dependencies are included in the exported requirements /// file. The `--no-emit-package` option allows exclusion of specific packages. - #[arg(long, alias = "no-install-package")] + /// + /// The inverse `--only-emit-package` can be used to emit _only_ the specified packages, + /// excluding all others. + #[arg( + long, + alias = "no-install-package", + conflicts_with = "only_emit_package" + )] pub no_emit_package: Vec, + /// Only emit the given package(s). + #[arg( + long, + alias = "only-install-package", + conflicts_with = "no_emit_package", + hide = true + )] + pub only_emit_package: Vec, + /// Assert that the `uv.lock` will remain unchanged. /// /// Requires that the lockfile is up-to-date. If the lockfile is missing or needs to be updated, diff --git a/crates/uv-configuration/src/install_options.rs b/crates/uv-configuration/src/install_options.rs index e21f9d4f7..db8edeaf0 100644 --- a/crates/uv-configuration/src/install_options.rs +++ b/crates/uv-configuration/src/install_options.rs @@ -17,26 +17,43 @@ pub struct InstallTarget<'a> { pub struct InstallOptions { /// Omit the project itself from the resolution. pub no_install_project: bool, + /// Include only the project itself in the resolution. + pub only_install_project: bool, /// Omit all workspace members (including the project itself) from the resolution. pub no_install_workspace: bool, + /// Include only workspace members (including the project itself) in the resolution. + pub only_install_workspace: bool, /// Omit all local packages from the resolution. pub no_install_local: bool, + /// Include only local packages in the resolution. + pub only_install_local: bool, /// Omit the specified packages from the resolution. pub no_install_package: Vec, + /// Include only the specified packages in the resolution. + pub only_install_package: Vec, } impl InstallOptions { + #[allow(clippy::fn_params_excessive_bools)] pub fn new( no_install_project: bool, + only_install_project: bool, no_install_workspace: bool, + only_install_workspace: bool, no_install_local: bool, + only_install_local: bool, no_install_package: Vec, + only_install_package: Vec, ) -> Self { Self { no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, no_install_package, + only_install_package, } } @@ -48,6 +65,55 @@ impl InstallOptions { members: &BTreeSet, ) -> bool { let package_name = target.name; + + // If `--only-install-package` is set, only include specified packages. + if !self.only_install_package.is_empty() { + if self.only_install_package.contains(package_name) { + return true; + } + debug!("Omitting `{package_name}` from resolution due to `--only-install-package`"); + return false; + } + + // If `--only-install-local` is set, only include local packages. + if self.only_install_local { + if target.is_local { + return true; + } + debug!("Omitting `{package_name}` from resolution due to `--only-install-local`"); + return false; + } + + // If `--only-install-workspace` is set, only include the project and workspace members. + if self.only_install_workspace { + // Check if it's the project itself + if let Some(project_name) = project_name { + if package_name == project_name { + return true; + } + } + + // Check if it's a workspace member + if members.contains(package_name) { + return true; + } + + // Otherwise, exclude it + debug!("Omitting `{package_name}` from resolution due to `--only-install-workspace`"); + return false; + } + + // If `--only-install-project` is set, only include the project itself. + if self.only_install_project { + if let Some(project_name) = project_name { + if package_name == project_name { + return true; + } + } + debug!("Omitting `{package_name}` from resolution due to `--only-install-project`"); + return false; + } + // If `--no-install-project` is set, remove the project itself. if self.no_install_project { if let Some(project_name) = project_name { diff --git a/crates/uv/src/commands/project/add.rs b/crates/uv/src/commands/project/add.rs index 0476bda7f..0e1e95406 100644 --- a/crates/uv/src/commands/project/add.rs +++ b/crates/uv/src/commands/project/add.rs @@ -67,8 +67,13 @@ pub(crate) async fn add( active: Option, no_sync: bool, no_install_project: bool, + only_install_project: bool, no_install_workspace: bool, + only_install_workspace: bool, no_install_local: bool, + only_install_local: bool, + no_install_package: Vec, + only_install_package: Vec, requirements: Vec, constraints: Vec, marker: Option, @@ -743,8 +748,13 @@ pub(crate) async fn add( sync_state, lock_check, no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, + no_install_package.clone(), + only_install_package.clone(), &defaulted_extras, &defaulted_groups, raw, @@ -974,8 +984,13 @@ async fn lock_and_sync( sync_state: PlatformState, lock_check: LockCheck, no_install_project: bool, + only_install_project: bool, no_install_workspace: bool, + only_install_workspace: bool, no_install_local: bool, + only_install_local: bool, + no_install_package: Vec, + only_install_package: Vec, extras: &ExtrasSpecificationWithDefaults, groups: &DependencyGroupsWithDefaults, raw: bool, @@ -1167,9 +1182,13 @@ async fn lock_and_sync( None, InstallOptions::new( no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, - vec![], + only_install_local, + no_install_package, + only_install_package, ), Modifications::Sufficient, None, diff --git a/crates/uv/src/lib.rs b/crates/uv/src/lib.rs index 1eb09cb97..5bd250da7 100644 --- a/crates/uv/src/lib.rs +++ b/crates/uv/src/lib.rs @@ -2121,8 +2121,13 @@ async fn run_project( args.active, args.no_sync, args.no_install_project, + args.only_install_project, args.no_install_workspace, + args.only_install_workspace, args.no_install_local, + args.only_install_local, + args.no_install_package, + args.only_install_package, requirements, constraints, args.marker, diff --git a/crates/uv/src/settings.rs b/crates/uv/src/settings.rs index 461e60be7..9f6b0d8c4 100644 --- a/crates/uv/src/settings.rs +++ b/crates/uv/src/settings.rs @@ -1346,9 +1346,13 @@ impl SyncSettings { inexact, exact, no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, no_install_package, + only_install_package, locked, frozen, active, @@ -1417,9 +1421,13 @@ impl SyncSettings { editable: flag(editable, no_editable, "editable").map(EditableMode::from), install_options: InstallOptions::new( no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, no_install_package, + only_install_package, ), modifications: if flag(exact, inexact, "inexact").unwrap_or(true) { Modifications::Exact @@ -1526,8 +1534,13 @@ pub(crate) struct AddSettings { pub(crate) python: Option, pub(crate) workspace: Option, pub(crate) no_install_project: bool, + pub(crate) only_install_project: bool, pub(crate) no_install_workspace: bool, + pub(crate) only_install_workspace: bool, pub(crate) no_install_local: bool, + pub(crate) only_install_local: bool, + pub(crate) no_install_package: Vec, + pub(crate) only_install_package: Vec, pub(crate) install_mirrors: PythonInstallMirrors, pub(crate) refresh: Refresh, pub(crate) indexes: Vec, @@ -1572,8 +1585,13 @@ impl AddSettings { workspace, no_workspace, no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, + no_install_package, + only_install_package, } = args; let dependency_type = if let Some(extra) = optional { @@ -1680,8 +1698,13 @@ impl AddSettings { python: python.and_then(Maybe::into_option), workspace: flag(workspace, no_workspace, "workspace"), no_install_project, + only_install_project, no_install_workspace, + only_install_workspace, no_install_local, + only_install_local, + no_install_package, + only_install_package, editable: flag(editable, no_editable, "editable"), extras: extra.unwrap_or_default(), refresh: Refresh::from(refresh), @@ -2019,9 +2042,13 @@ impl ExportSettings { no_hashes, output_file, no_emit_project, + only_emit_project, no_emit_workspace, - no_emit_package, + only_emit_workspace, no_emit_local, + only_emit_local, + no_emit_package, + only_emit_package, locked, frozen, resolver, @@ -2063,9 +2090,13 @@ impl ExportSettings { hashes: flag(hashes, no_hashes, "hashes").unwrap_or(true), install_options: InstallOptions::new( no_emit_project, + only_emit_project, no_emit_workspace, + only_emit_workspace, no_emit_local, + only_emit_local, no_emit_package, + only_emit_package, ), output_file, lock_check: if locked { diff --git a/crates/uv/tests/it/export.rs b/crates/uv/tests/it/export.rs index 186e66850..cb0ed4139 100644 --- a/crates/uv/tests/it/export.rs +++ b/crates/uv/tests/it/export.rs @@ -2266,6 +2266,92 @@ fn requirements_txt_no_emit() -> Result<()> { Ok(()) } +#[test] +fn requirements_txt_only_emit() -> Result<()> { + let context = TestContext::new("3.12"); + + let pyproject_toml = context.temp_dir.child("pyproject.toml"); + pyproject_toml.write_str( + r#" + [project] + name = "project" + version = "0.1.0" + requires-python = ">=3.12" + dependencies = ["anyio==3.7.0", "child"] + + [tool.uv.workspace] + members = ["child"] + + [tool.uv.sources] + child = { workspace = true } + + [build-system] + requires = ["setuptools>=42"] + build-backend = "setuptools.build_meta" + "#, + )?; + + let child = context.temp_dir.child("child"); + child.child("pyproject.toml").write_str( + r#" + [project] + name = "child" + version = "0.1.0" + requires-python = ">=3.12" + dependencies = ["iniconfig>=2"] + + [build-system] + requires = ["setuptools>=42"] + build-backend = "setuptools.build_meta" + "#, + )?; + + context.lock().assert().success(); + + uv_snapshot!(context.filters(), context.export().arg("--only-emit-workspace"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + # This file was autogenerated by uv via the following command: + # uv export --cache-dir [CACHE_DIR] --only-emit-workspace + -e . + -e ./child + # via project + + ----- stderr ----- + Resolved 6 packages in [TIME] + "###); + + uv_snapshot!(context.filters(), context.export().arg("--only-emit-project"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + # This file was autogenerated by uv via the following command: + # uv export --cache-dir [CACHE_DIR] --only-emit-project + -e . + + ----- stderr ----- + Resolved 6 packages in [TIME] + "###); + + uv_snapshot!(context.filters(), context.export().arg("--only-emit-package").arg("anyio"), @r###" + success: true + exit_code: 0 + ----- stdout ----- + # This file was autogenerated by uv via the following command: + # uv export --cache-dir [CACHE_DIR] --only-emit-package anyio + anyio==3.7.0 \ + --hash=sha256:275d9973793619a5374e1c89a4f4ad3f4b0a5510a2b5b939444bee8f4c4d37ce \ + --hash=sha256:eddca883c4175f14df8aedce21054bfca3adb70ffe76a9f607aef9d7fa2ea7f0 + # via project + + ----- stderr ----- + Resolved 6 packages in [TIME] + "###); + + Ok(()) +} + #[test] fn requirements_txt_no_editable() -> Result<()> { let context = TestContext::new("3.12"); diff --git a/docs/reference/cli.md b/docs/reference/cli.md index e1af75d22..1d89006d1 100644 --- a/docs/reference/cli.md +++ b/docs/reference/cli.md @@ -898,10 +898,16 @@ uv add [OPTIONS] >

May also be set with the UV_NO_CONFIG environment variable.

--no-index

Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

--no-install-local

Do not install local path dependencies

Skips the current project, workspace members, and any other local (path or editable) packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache heavy third-party dependencies first and layer local packages separately.

+

The inverse --only-install-local can be used to install only local packages, excluding all remote dependencies.

+
--no-install-package no-install-package

Do not install the given package(s).

+

By default, all project's dependencies are installed into the environment. The --no-install-package option allows exclusion of specific packages. Note this can result in a broken environment, and should be used with caution.

+

The inverse --only-install-package can be used to install only the specified packages, excluding all others.

--no-install-project

Do not install the current project.

By default, the current project is installed into the environment with all of its dependencies. The --no-install-project option allows the project to be excluded, but all of its dependencies are still installed. This is particularly useful in situations like building Docker images where installing the project separately from its dependencies allows optimal layer caching.

+

The inverse --only-install-project can be used to install only the project itself, excluding all dependencies.

--no-install-workspace

Do not install any workspace members, including the current project.

-

By default, all of the workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

+

By default, all workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

+

The inverse --only-install-workspace can be used to install only workspace members, excluding all other dependencies.

--no-managed-python

Disable use of uv-managed Python versions.

Instead, uv will search for a suitable Python version on the system.

May also be set with the UV_NO_MANAGED_PYTHON environment variable.

--no-progress

Hide all progress outputs.

@@ -1488,12 +1494,16 @@ uv sync [OPTIONS]

May also be set with the UV_NO_GROUP environment variable.

--no-index

Ignore the registry index (e.g., PyPI), instead relying on direct URL dependencies and those provided via --find-links

--no-install-local

Do not install local path dependencies

Skips the current project, workspace members, and any other local (path or editable) packages. Only remote/indexed dependencies are installed. Useful in Docker builds to cache heavy third-party dependencies first and layer local packages separately.

+

The inverse --only-install-local can be used to install only local packages, excluding all remote dependencies.

--no-install-package no-install-package

Do not install the given package(s).

By default, all of the project's dependencies are installed into the environment. The --no-install-package option allows exclusion of specific packages. Note this can result in a broken environment, and should be used with caution.

+

The inverse --only-install-package can be used to install only the specified packages, excluding all others.

--no-install-project

Do not install the current project.

By default, the current project is installed into the environment with all of its dependencies. The --no-install-project option allows the project to be excluded, but all of its dependencies are still installed. This is particularly useful in situations like building Docker images where installing the project separately from its dependencies allows optimal layer caching.

+

The inverse --only-install-project can be used to install only the project itself, excluding all dependencies.

--no-install-workspace

Do not install any workspace members, including the root project.

-

By default, all of the workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

+

By default, all workspace members and their dependencies are installed into the environment. The --no-install-workspace option allows exclusion of all the workspace members while retaining their dependencies. This is particularly useful in situations like building Docker images where installing the workspace separately from its dependencies allows optimal layer caching.

+

The inverse --only-install-workspace can be used to install only workspace members, excluding all other dependencies.

--no-managed-python

Disable use of uv-managed Python versions.

Instead, uv will search for a suitable Python version on the system.

May also be set with the UV_NO_MANAGED_PYTHON environment variable.

--no-progress

Hide all progress outputs.

@@ -1915,12 +1925,16 @@ uv export [OPTIONS]

May also be set with the UV_NO_DEV environment variable.

--no-editable

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

May also be set with the UV_NO_EDITABLE environment variable.

--no-emit-local, --no-install-local

Do not include local path dependencies in the exported requirements.

Omits the current project, workspace members, and any other local (path or editable) packages from the export. Only remote/indexed dependencies are written. Useful for Docker and CI flows that want to export and cache third-party dependencies first.

+

The inverse --only-emit-local can be used to emit only local packages, excluding all remote dependencies.

--no-emit-package, --no-install-package no-emit-package

Do not emit the given package(s).

-

By default, all of the project's dependencies are included in the exported requirements file. The --no-emit-package option allows exclusion of specific packages.

+

By default, all project's dependencies are included in the exported requirements file. The --no-emit-package option allows exclusion of specific packages.

+

The inverse --only-emit-package can be used to emit only the specified packages, excluding all others.

--no-emit-project, --no-install-project

Do not emit the current project.

By default, the current project is included in the exported requirements file with all of its dependencies. The --no-emit-project option allows the project to be excluded, but all of its dependencies to remain included.

+

The inverse --only-emit-project can be used to emit only the project itself, excluding all dependencies.

--no-emit-workspace, --no-install-workspace

Do not emit any workspace members, including the root project.

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.

+

The inverse --only-emit-workspace can be used to emit only workspace members, excluding all other dependencies.

--no-extra no-extra

Exclude the specified optional dependencies, if --all-extras is supplied.

May be provided multiple times.

--no-group no-group

Disable the specified dependency group.