LinuxCommandLibrary

uv-export

Export Python dependencies

TLDR

Export dependencies to a requirements.txt file

$ uv export --format requirements-txt [[-o|--output-file]] [requirements.txt]
copy

Export dependencies to pylock.toml format
$ uv export --format pylock.toml
copy

Export only production dependencies (exclude dev dependencies)
$ uv export --no-dev
copy

Export including a specific optional dependency group
$ uv export --extra [group_name]
copy

Export including all optional dependencies
$ uv export --all-extras
copy

Export including a specific dependency group
$ uv export --group [group_name]
copy

Export without hashes
$ uv export --no-hashes
copy

Export dependencies for a specific package in the workspace
$ uv export --package [package_name]
copy

SYNOPSIS

uv export [OPTIONS] [PACKAGE ...]

PARAMETERS

[PACKAGE ...]
    Optional: Specifies one or more packages to export. If omitted, all resolved dependencies are exported.

--format
    Sets the output format for the requirements file. Accepted values are 'pip' (default) for pip compatibility or 'uv' for uv-specific features like hashes.

--output-file
    Specifies the path to the output file. If not provided, the requirements are written to standard output (stdout).

--python
    Defines the Python interpreter to use. Can be a path or a version specifier (e.g., '3.10').

--strict
    Requires all exported dependencies to have a hash, failing if any are missing.

--index-url
    The URL of the primary Python package index to use for resolution.

--extra-index-url
    Additional URLs of Python package indexes to search for packages.

--no-index
    Ignores all package indexes, relying only on `--find-links`.

--find-links
    Location(s) of local Python package archives.

--client-auth
    Path to a client certificate and key file (.pem or .p12) for index authentication.

--keyring-provider
    Specifies the keyring provider for authentication (e.g., 'auto', 'system', 'disabled').

--no-color
    Disables colored output in the console.

--force-color
    Forces colored output, even if not automatically detected.

--verbose
    Enables verbose logging output.

--quiet
    Suppresses all logging output.

--exclude-newer
    Prevents considering package versions newer than the specified version.

--refresh
    Refreshes specified packages during export, e.g., 'all' or a specific package name.

--refresh-all
    Forces a re-resolution and refresh of all packages.

--exclude-platform-specific
    Excludes packages that are specific to certain platforms from the export.

--no-hash
    Excludes package hashes from the exported requirements file.

--legacy-sha1-hashes
    Allows the inclusion of SHA1 hashes in the exported requirements file.

--with-sources
    Includes source URLs (e.g., Git URLs) in the exported requirements file.

--no-strip-extras
    Retains extras (e.g., '[test]') in package names during export.

--no-strip-markers
    Retains environment markers (e.g., '; python_version < "3.9"') in package names.

--no-strip-vcs-urls
    Retains Version Control System (VCS) URLs (e.g., 'git+https://...') in package names.

--strict-markers
    Ensures that all environment markers are strictly compatible with the target environment.

--dependency-mode
    Sets the mode for including dependencies: 'direct', 'direct-plus-primary', or 'transitive' (default).

--resolve-from
    Specifies additional files (e.g., 'pyproject.toml', 'requirements.in') to use as a base for resolution.

--annotation-style