LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

poetry-export

Export Poetry dependencies to other formats

TLDR

Export to requirements.txt
$ poetry export -f requirements.txt -o requirements.txt
copy
Export with dev dependencies
$ poetry export --with dev -f requirements.txt
copy
Export without hashes
$ poetry export --without-hashes -o requirements.txt
copy
Export only specific dependency groups
$ poetry export --only [main,docs] -f requirements.txt
copy
Export to standard output
$ poetry export -f requirements.txt
copy
Export including extras
$ poetry export -f requirements.txt -E [extra_name]
copy

SYNOPSIS

poetry export [options]

DESCRIPTION

poetry export exports the lock file to other formats. It is provided by the poetry-plugin-export plugin. Primarily used to generate requirements.txt files for environments that don't use Poetry directly, such as Docker builds or production deployments.

PARAMETERS

-f, --format format

Output format (requirements.txt, constraints.txt, pylock.toml).
-o, --output file
Output file path. If omitted, prints to standard output.
--with groups
Include optional dependency groups.
--without groups
Exclude dependency groups.
--only groups
Include only the specified dependency groups.
--without-hashes
Exclude hashes from output.
--without-urls
Exclude source URLs from output.
-E, --extras extras
Include extras.

CAVEATS

Requires the poetry-plugin-export plugin to be installed. The `--dev` flag is deprecated in favor of `--with dev`.

SEE ALSO

Copied to clipboard
Kai