LinuxCommandLibrary

poetry-sync

Synchronize environment with lock file

TLDR

Sync dependencies with lock file

$ poetry sync
copy
Sync without dev dependencies
$ poetry sync --no-dev
copy
Sync specific groups
$ poetry sync --with [group]
copy
Dry run
$ poetry sync --dry-run
copy

SYNOPSIS

poetry sync [options]

DESCRIPTION

poetry sync strictly synchronizes the virtual environment to match the poetry.lock file exactly. Unlike poetry install, it also removes any packages present in the environment that are not listed in the lock file.
This is useful for ensuring clean, reproducible environments in CI/CD pipelines or production deployments. Use --dry-run to preview changes before applying them.

PARAMETERS

--no-dev

Exclude dev dependencies.
--with GROUPS
Include specific groups.
--without GROUPS
Exclude specific groups.
--dry-run
Simulate sync.

CAVEATS

Removes unlocked packages. More strict than install.

HISTORY

poetry sync provides strict synchronization with the lock file.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community