Yandex Cloud
Documentation
PresentationContact UsTry it for free
© 2026 Direct Cursus Technology L.L.C.
Yandex Cloud Registry
  • Getting started
    • All guides
        • Setting up PyPI
        • Creating a Python package
        • Pushing a Python package to a registry
        • Pulling a Python package from a registry
        • Examples of working with PyPI registries
      • Deleting an artifact from a registry
  • Access management
  • Pricing policy
  • Terraform reference
  • Monitoring metrics
  • Audit Trails events
  1. Step-by-step guides
  2. Managing artifacts
  3. Python artifact
  4. Pushing a Python package to a registry

Pushing a Python package to a local registry in Cloud Registry

Written by
Yandex Cloud
Updated at July 8, 2026
View in Markdown

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
  1. If you do not have a built package yet, create one.

  2. 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 ~/.pypirc file:

    [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 or api_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 • ?
    
  1. If you do not have a built package yet, create one.

  2. Set up a repository for publishing:

    poetry config repositories.cloud-registry https://registry.yandexcloud.net/pypi/<registry_ID>/legacy/
    
  3. Set up authentication:

    poetry config http-basic.cloud-registry iam "$(yc iam create-token)"
    

    Where:

    • iam: Token type. Instead of iam, you can use api_key.
    • <registry_ID>: Your local registry ID.
  4. Upload the package into the registry:

    poetry publish -r cloud-registry
    

    Result:

    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%
    
  1. If you do not have a built package yet, create one.

  2. 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.toml in 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 or api_key.
    • password: Token value.
    uv publish
    

    Result:

    Uploading my_package-0.0.1-py3-none-any.whl (4.5 KB)
    Uploading my_package-0.0.1.tar.gz (3.8 KB)
    

Useful linksUseful links

  • Creating a Python package
  • Pulling a Python package from a Cloud Registry
  • Examples of working with PyPI registries

Was the article helpful?

Previous
Creating a Python package
Next
Pulling a Python package from a registry
© 2026 Direct Cursus Technology L.L.C.