LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

uv-publish

Publish Python packages to PyPI

TLDR

Publish all distributions in dist/ to PyPI
$ uv publish
copy
Publish to TestPyPI
$ uv publish --publish-url https://test.pypi.org/legacy/
copy
Publish using a named index from pyproject.toml
$ uv publish --index [name]
copy
Publish with an API token
$ uv publish --token [pypi-token]
copy
Publish specific files
$ uv publish [dist/package-1.0.tar.gz] [dist/package-1.0-py3-none-any.whl]
copy
Publish and skip already-uploaded files
$ uv publish --check-url https://pypi.org/simple/
copy

SYNOPSIS

uv publish [options] [files...]

DESCRIPTION

uv publish uploads Python packages to PyPI or other registries. It publishes wheel and source distributions found in the dist/ directory by default. Supports authentication via API token, username/password, trusted publishing (GitHub Actions, GitLab CI/CD), or keyring.When --check-url is provided, uv skips uploading files that are identical to those already on the registry, making it safe for parallel CI uploads.

PARAMETERS

--publish-url url

URL of the upload endpoint for the target registry.
--index name
Publish to a named index configured in pyproject.toml.
--token token
Authentication token (e.g., PyPI API token). Env: UVPUBLISHTOKEN.
--username user
Repository username. Env: UVPUBLISHUSERNAME.
--password pass
Repository password. Env: UVPUBLISHPASSWORD.
--check-url url
Index URL to check for existing packages; skips identical uploads and handles parallel races.
--trusted-publishing value
Configure trusted publishing (always, never). Supported in GitHub Actions and GitLab CI/CD.
--keyring-provider provider
Use keyring for authentication (subprocess).
--no-attestations
Disable automatic attestation uploads. Env: UVPUBLISHNO_ATTESTATIONS.

SEE ALSO

uv(1), uv-build(1), twine(1), pip(1)

Copied to clipboard
Kai