Pushing a Python package to a local registry in Cloud Registry
Written by
Updated at May 26, 2026
This guide describes how to push a Python package to a local registry.
To push a Python package to a registry, you need the cloud-registry.artifacts.pusher role or higher.
pip + twine
Poetry
uv
-
If you do not have a built package yet, create one.
-
Upload the package:
export LOCAL_REG_ID="<registry_ID>" export IAM_TOKEN="<IAM_token>" twine upload \ --repository-url "https://registry.yandexcloud.net/pypi/$LOCAL_REG_ID/legacy/" \ --username iam \ --password "$IAM_TOKEN" \ dist/*Or configure authentication using a
~/.pypircfile:[distutils] index-servers = cloud-registry [cloud-registry] repository = https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/ username = iam password = <IAM_token>Where:
<registry_ID>: Your local registry ID.username: Token type,iam,oauth, orapi_key.password: Token value.
python3 -m twine upload --repository cloud-registry dist/*Result:
Uploading distributions to https://registry.yandexcloud.net/pypi/e5o6a2blpkb6********/legacy/ Uploading my_package-0.0.1-py3-none-any.whl 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 kB • 00:00 • ? Uploading my_package-0.0.1.tar.gz 100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 kB • 00:00 • ?
-
If you do not have a built package yet, create one.
-
Set up a repository for publishing:
poetry config repositories.cloud-registry https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/ -
Set up authentication:
poetry config http-basic.cloud-registry iam "$(yc iam create-token)"Where:
iam: Token type. Instead ofiamyou can useoauthorapi_key.<registry_ID>: Your local registry ID.
-
Upload the package into the registry:
poetry publish -r cloud-registryResult:
Publishing my_package (0.0.1) to cloud-registry - Uploading my_package-0.0.1-py3-none-any.whl 100% - Uploading my_package-0.0.1.tar.gz 100%
-
If you do not have a built package yet, create one.
-
Upload the package:
export LOCAL_REG_ID="<registry_ID>" export IAM_TOKEN="<IAM_token>" uv publish \ --publish-url "https://registry.yandexcloud.net/pypi/$LOCAL_REG_ID/legacy/" \ --username iam \ --password "$IAM_TOKEN" \ dist/*Or create a file named
uv.tomlin the project root:[publish] url = "https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/" username = "iam" password = "<IAM_token>"Where:
<registry_ID>: Your local registry ID.username: Token type,iam,oauth, orapi_key.password: Token value.
uv publishResult:
Uploading my_package-0.0.1-py3-none-any.whl (4.5 KB) Uploading my_package-0.0.1.tar.gz (3.8 KB)