Python
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
Navigate to the Artifact Registry module in your Harness project.
Click on New Artifact Registry.
In the Registry Type list, select Python Registry.
Provide a Registry Name.
The registry name must start with a letter and can include lowercase alphanumeric characters, underscores (
_), periods (.), and hyphens (-).
Optionally, add a Description and Labels for better organization.
Choose visibility between Public and Private.
Click Create Registry to finalize.
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
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.
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?