Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions package-structure-code/declare-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
:::

**Install optional dependencies:**

Expand All @@ -316,6 +323,20 @@ $ 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
Expand Down
Loading