From abf9669d8ee331200c3fa3dcb2c9c346b84f9403 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Sat, 18 Jul 2026 15:30:29 +0200 Subject: [PATCH 1/3] docs: add tip for for --- package-structure-code/declare-dependencies.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/package-structure-code/declare-dependencies.md b/package-structure-code/declare-dependencies.md index 218c4f618..fedfe209a 100644 --- a/package-structure-code/declare-dependencies.md +++ b/package-structure-code/declare-dependencies.md @@ -316,6 +316,19 @@ $ uv pip install -e ".[docs]" # Single group $ uv pip install -e ".[docs,tests,lint]" # Multiple groups ``` +:::{tip} +Use the `--active` flag with `uv run` to prefer the currently active +virtual environment over the project's own managed environment: + +```console +$ uv run --active pip install -e ".[docs]" +``` + +This is useful when you have activated a virtual environment and want +`uv run` to use it instead of automatically creating or selecting the +project's environment. +::: + **Install everything (package + all dependencies):** ```console From b3e65411200ebdf7b45dfaa569720e32d5f86a76 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Sat, 18 Jul 2026 15:46:40 +0200 Subject: [PATCH 2/3] docs: add sync --- package-structure-code/declare-dependencies.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/package-structure-code/declare-dependencies.md b/package-structure-code/declare-dependencies.md index fedfe209a..76428476a 100644 --- a/package-structure-code/declare-dependencies.md +++ b/package-structure-code/declare-dependencies.md @@ -307,6 +307,13 @@ uv sync --group docs # Single group uv sync --group docs --group test # Multiple groups uv sync --all-groups # All dependency groups ``` +:::{tip} +use ``--active`` with ``uv sync`` to prefer the currently active virtual environment over the project's own managed environment: + +```console +$ uv sync --active --group docs # Sync into the currently active virtual environment +``` +::: **Install optional dependencies:** @@ -323,6 +330,7 @@ virtual environment over the project's own managed environment: ```console $ uv run --active pip install -e ".[docs]" ``` +::: This is useful when you have activated a virtual environment and want `uv run` to use it instead of automatically creating or selecting the From 0b15df81e1be9f2a9166e8e6639cd4fcdc8cb6e3 Mon Sep 17 00:00:00 2001 From: Revathyvenugopal162 Date: Sat, 18 Jul 2026 15:48:38 +0200 Subject: [PATCH 3/3] docs: add sync --- package-structure-code/declare-dependencies.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package-structure-code/declare-dependencies.md b/package-structure-code/declare-dependencies.md index 76428476a..249add708 100644 --- a/package-structure-code/declare-dependencies.md +++ b/package-structure-code/declare-dependencies.md @@ -311,7 +311,7 @@ uv sync --all-groups # All dependency groups use ``--active`` with ``uv sync`` to prefer the currently active virtual environment over the project's own managed environment: ```console -$ uv sync --active --group docs # Sync into the currently active virtual environment +$ uv sync --active --group docs ``` :::