From 2c47e55fd471bfec2a033afb2260dfaea92eacb3 Mon Sep 17 00:00:00 2001 From: John Mumm Date: Thu, 3 Jul 2025 17:42:40 +0200 Subject: [PATCH] Update docs --- docs/concepts/projects/dependencies.md | 50 +++++++++++++------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/docs/concepts/projects/dependencies.md b/docs/concepts/projects/dependencies.md index 67dbaff95..e1d1cbeca 100644 --- a/docs/concepts/projects/dependencies.md +++ b/docs/concepts/projects/dependencies.md @@ -410,6 +410,30 @@ $ uv add ~/projects/bar/ ### Path dependency installation +By default, a path dependency project is installed in the environment as a package, unless it is +explicitly marked as a [non-package](./config.md#build-systems). This is true even if it lacks a +[`[build-system] table`](./config.md#build-systems). If you'd like to override this behavior and +ensure the path dependency is not installed as a package, set `package = false` on the source: + +```toml title="pyproject.toml" +[project] +dependencies = ["bar"] + +[tool.uv.sources] +bar = { path = "../projects/bar", package = false } +``` + +If the path dependency project is marked as a non-package, but you'd like to install it as a +package, set `package = true` on the source: + +```toml title="pyproject.toml" +[project] +dependencies = ["bar"] + +[tool.uv.sources] +bar = { path = "../projects/bar", package = true } +``` + An [editable installation](#editable-dependencies) is not used for path dependencies by default. An editable installation may be requested for project directories: @@ -427,32 +451,6 @@ dependencies = ["bar"] bar = { path = "../projects/bar", editable = true } ``` -Similarly, if a project is marked as a [non-package](./config.md#build-systems), but you'd like to -install it in the environment as a package, set `package = true` on the source: - -```toml title="pyproject.toml" -[project] -dependencies = ["bar"] - -[tool.uv.sources] -bar = { path = "../projects/bar", package = true } -``` - -If the dependency project is not marked as a non-package and no value is set for `package` on the -source, the default behavior is to install it as a package, even if it lacks a -[[build-system] table](./config.md#build-systems). If you'd like to avoid installing it, set -`package = false` on the source: - -```toml title="pyproject.toml" -[project] -dependencies = ["bar"] - -[tool.uv.sources] -bar = { path = "../projects/bar", package = false } -``` - -This will override the default behavior and the path dependency's own `tool.uv.package` value. - For multiple packages in the same repository, [_workspaces_](./workspaces.md) may be a better fit. ### Workspace member