Private Python Packages With devpi

This page summarizes the projects mentioned and recommended in the original post on dev.to

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • devpi

    Python PyPi staging server and packaging, testing, release tool

  • There are cases where you want the flexibility of installing a python package via pip without having it available to the open public. This article will focus on using devpi to provide a self-hosted pip compatible python package server. Ubuntu will be used for the OS as it's a fairly common Linux distribution and easily available on Windows Linux Subsystem.

  • twine

    Utilities for interacting with PyPI

  • Twine is also an option if you'd rather stick with the traditional PyPi upload system. It does require an additional duplication of the keyring entry and a configuration file addition as well. First I'll create a $HOME\.pypirc file (make sure this is Powershell so $HOME expands properly) with the following contents:

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
  • example_pypi_package

    Example PyPI (Python Package Index) package set up with automated tests and publishing using GitHub Actions CI/CD, primarily for GitHub + VS Code (Windows / Mac / Linux) users

  • Now it's time to do the actual uploading part, as that's why most would want a private PyPi index right? To start out I'll clone tomchen's example PyPi repo template:

  • supervisor

    Supervisor process control system for Unix (supervisord)

  • As you can see there are several methods of running devpi server including cron, launchd (OSX service), nginx, Windows service, and supervisord. It also has a systemd service file which we can use to manage the service easily as Ubuntu uses it for primary service management. First off though we're going to need a proxy script to ensure that devpi is running in the virtual environment:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts