For the complete documentation index, see llms.txt. This page is also available as Markdown.

Python

spinner

Prerequisites

  • Ensure you have Python CLI installed and configured on your local machine.

  • Ensure you have access to a Harness account with the appropriate permissions to create registries and connectors.


Create a Python Artifact Registry

Create a Python Artifact Registry in Harness
  1. Navigate to the Artifact Registry module in your Harness project.

  2. Click on New Artifact Registry.

  3. In the Registry Type list, select Python Registry.

  4. Provide a Registry Name.

    • The registry name must start with a letter and can include lowercase alphanumeric characters, underscores (_), periods (.), and hyphens (-).

  5. Optionally, add a Description and Labels for better organization.

  6. Choose visibility between Public and Private.

  7. Click Create Registry to finalize.

PRIVATE PYTHON REGISTRY

This registry will serve as your private Python registry within Harness.


Configure an Upstream Proxy (Optional)

An upstream proxy allows your registry to fetch Python packages from external sources if they are not available locally.

Create an upstream proxy

Create a Python Upstream Proxy in Harness

Configure the upstream proxy in your registry

Configure your Python Upstream Proxy in Harness

Create an upstream proxy

1. In the Artifact Registry module, click the dropdown next to **New Artifact Registry** and select **Upstream Proxy**. 2. Choose **Python Registry** as the proxy type. 3. Click **Create Proxy** to establish the connection.

Configure the upstream proxy in your registry

1. In the Artifact Registry module, select an existing Artifact Registry. 2. Select the **Configuration** tab. 3. Under **Advanced (Optional)**, select **Configure Upstream**. 4. Select from the list of compatible proxies to add them to your registry. 5. Click **Save** to save the configuration.

UPSTREAM PROXY CACHING

If a Python package isn’t found in your Harness registry, the upstream proxy fetches it from an external registry like PyPI, reducing duplication and improving package resolution.

Configuring Python PyPI Upstream Proxy with Custom Registry Suffix

Harness supports configuring Python PyPI upstream proxies for registries that use non-standard endpoint paths. In addition to specifying the remote registry URL, you can define an optional custom registry suffix when the PyPI repository is not available under the default /simple/ endpoint.

This is commonly required when integrating with enterprise artifact repositories such as Artifactory, Nexus, or private PyPI mirrors. Authentication can be configured using anonymous access or username and password credentials. Once configured, Harness handles package resolution and authentication automatically when proxying Python dependencies from the upstream registry.


Publish & Install Python Packages

1. Generate Identity Token

An identity token will serve as the password for uploading and downloading artifacts.

Generate an identity token from your Harness account settings.

2. Configure Authentication

Create or update your ~/.pypirc file with the following content:

3. Publish Package

Build and publish your package:

4. Install Package

Install a package using pip:

1. Generate Identity Token

An identity token will serve as the password for uploading and downloading artifacts.

Generate an identity token from your Harness account settings.

2. Configure Repository

Add the registry as a source and configure authentication:

3. Publish Package

Configure publish repository and publish your package:

4. Install Package

Install a package using poetry:

1. Generate Identity Token

An identity token will serve as the password for uploading and downloading artifacts.

Generate an identity token from your Harness account settings.

2. Publish Package

Build and publish your package:

3. Install Package

Install a package using uv:


Last updated

Was this helpful?