Set Up PyPI with a Twine Client

JFrog Artifactory Documentation

Products
JFrog Artifactory
Content Type
User Guide
ft:sourceType
Paligo

The process for setting up PyPI with a Twine client is done in 2 stages:

Configure the Twine Client

To deploy packages using Twine, add an Artifactory repository to the .pypirc file (usually located in your home directory) as follows:

[distutils]
index-servers = <REPOSITORY_NAME>
[<REPO_NAME>]
repository: https://<YOUR_JFROG_DOMAIN>/artifactory/api/pypi/<REPOSITORY_NAME>
username: <USER>
password: <PASSWORD/TOKEN>

For example:

[distutils]
index-servers = pypi-local
[pypi-local]
repository: https://my-awesome.jfrog.io/artifactory/api/pypi/pypi-local
username: johnfrog
password: RANDOM_TOKEN_YWRtaW46QVBBVWJjTExkZTU4WT

Upload a Python Package to Artifactory

To upload a Python package to Artifactory, use the following command:

twine upload --repository <REPOSITORY_NAME> <PATH_TO_FILE>

For example:

twine upload --repository pypi-local ~/workspace/my_file.tar.gz