Skip to content

Commit

Permalink
Update managing-dependencies.md
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 authored and radoering committed Jan 6, 2025
1 parent e551aed commit 9e7a610
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions docs/managing-dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,24 +163,24 @@ Poetry supports what's called dependency synchronization. Dependency synchroniza
that the locked dependencies in the `poetry.lock` file are the only ones present
in the environment, removing anything that's not necessary.

This is done by using the `--sync` option of the `install` command:
This is done by using the `sync` command:

```bash
poetry install --sync
poetry sync
```

The `--sync` option can be combined with any [dependency groups]({{< relref "#dependency-groups" >}}) related options
to synchronize the environment with specific groups. Note that extras are separate. Any
extras not selected for install are always removed, regardless of `--sync`.
The `sync` command can be combined with any [dependency groups]({{< relref "#dependency-groups" >}}) related options
to synchronize the environment with specific groups. Note that extras are separate.
Any extras not selected for install are always removed.

```bash
poetry install --without dev --sync
poetry install --with docs --sync
poetry install --only dev
poetry sync --without dev
poetry sync --with docs
poetry sync --only dev
```

## Layering optional groups

When you omit the `--sync` option, you can install any subset of optional groups without removing
When you using `install` command without the `--sync` option, you can install any subset of optional groups without removing
those that are already installed. This is very useful, for example, in multi-stage
Docker builds, where you run `poetry install` multiple times in different build stages.

0 comments on commit 9e7a610

Please sign in to comment.