Escribe para buscar…

PyPI

Esta página todavía no se ha traducido — se muestra en su idioma original:English

Publish

uv supports building Python packages into source and binary distributions via uv build and uploading them to a registry with uv publish.

Preparing your project

Before attempting to publish your project, you’ll want to make sure it’s ready to be packaged for distribution.

Configure a build system for your project.

This is done by adding a [build-system] table to your pyproject.toml file.

For example:

toml
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

If your project does not include a [build-system] definition in the pyproject.toml, uv will not build it during uv sync operations in the project, but will fall back to the legacy setuptools build system during uv build.

Read more about build systems in the project configuration documentation.

Building your package

Build your package with uv build:

shell
uv build

By default, uv build will build the project in the current directory, and place the built artifacts in a dist/ subdirectory.

Alternatively, uv build <SRC> will build the package in the specified directory, while uv build --package <PACKAGE> will build the specified package within the current workspace.

By default, uv build respects tool.uv.sources when resolving build dependencies from the build-system.requires section of the pyproject.toml. When publishing a package, we recommend running uv build --no-sources to ensure that the package builds correctly when tool.uv.sources is disabled, as is the case when using other build tools, like pypa/build.

Updating your version

The uv version command provides conveniences for updating the version of your package before you publish it.

To get the version of your package, run uv version:

shell
uv version

To update to an exact version, provide it as a positional argument:

shell
uv version 1.0.0

Estás leyendo una vista previa.

Inicia sesión para leer el artículo completo. Cualquier cuenta abre 4 artículos gratuitos al mes; el alumnado y el profesorado leen las páginas de su curso sin límite.

Iniciar sesión