PyPI


Overview

PyPI (Python Package Index) is the official repository for Python packages. It allows developers to share and distribute Python libraries and applications.

Integrating PyPI with JFrog Fly allows you to manage your packages and releases from source code to production in a simple and native way, directly from your IDE.


Supported Clients

JFrog Fly supports Python packages with:

  • Twine (twine upload) - The official tool for publishing packages to PyPI

  • pip (pip install) - The standard package installer for Python

  • Pipenv (pipenv install) - Package installer with virtual environment management


Upload / Publish Package

With Fly App

Activate Twine in your Fly App to configure your .pypirc globally with Fly. The Fly App configures the pypi section as the default, so you can upload without specifying a repository:

twine upload dist/*

Manual Configuration

1. Generate an access token in Fly Token Management

2. Configure Twine by creating ~/.pypirc:

[distutils]
index-servers = pypi

[pypi]
repository = https://<your-fly-subdomain>.jfrog.io/artifactory/api/pypi/pypi
username = <your-fly-username>
password = <your-fly-token>

Note: Using pypi as the section name makes it the default repository for Twine, so you don’t need to specify -r when uploading.

3. Upload:

twine upload dist/*

Download / Install Package

With Fly App

Activate pip in your Fly App to configure your pip.conf globally with Fly, then install as usual:

Using pip:

pip install <package-name>

Using Pipenv:

pipenv install <package-name>

Manual Configuration

1. Generate an access token in Fly Token Management

2. Configure pip by creating ~/.config/pip/pip.conf (Linux/macOS) or %APPDATA%\pip\pip.ini (Windows):

[global]
index-url = https://<your-fly-username>:<your-fly-token>@<your-fly-subdomain>.jfrog.io/artifactory/api/pypi/pypi/simple

3. Install:

Using pip:

pip install <package-name>

Using Pipenv:

Pipenv uses the same pip configuration, so it will automatically use Fly registry.

pipenv install <package-name>

From Public Registry

When you install a package that isn’t in your Fly Registry, JFrog Fly automatically fetches it from PyPI and caches it for future use.

Using pip:

pip install requests

Using Pipenv:

pipenv install requests

Publish/Install Packages with CI

To publish and install Python packages with CI, update your GitHub Actions workflow to include the Fly action.

Simply type in your IDE the prompt: “Configure my workflows with Fly” and Fly MCP will configure your GitHub Actions workflow yml file, as follows:

1. Add permissions (top level, after on:):

permissions:
  contents: read
  id-token: write

2. Add Fly Action (after actions/setup-python, before pip/twine commands):

- name: JFrog Fly - Configure all your package managers to work with Fly registry
  uses: jfrog/fly-action@v1
  with:
    url: https://<your-fly-subdomain>.jfrog.io

GitHub Action Example

name: Build and Publish Python Package

on:
  push:
    branches: [main]

permissions:
  contents: read
  id-token: write

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - name: Checkout code
        uses: actions/checkout@v4

      - name: Setup Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: JFrog Fly - Configure all your package managers to work with Fly registry
        uses: jfrog/fly-action@v1
        with:
          url: https://<your-fly-subdomain>.jfrog.io

      - name: Install dependencies
        run: pip install build twine

      - name: Build package
        run: python -m build

      - name: Upload package
        run: twine upload dist/*

Back to Package Types →