pypiserver

2.4.1 · active · verified Thu Apr 16

pypiserver is a minimal PyPI compatible server for pip or easy_install, designed to serve packages from local directories. It is built on the Bottle web framework and supports uploading wheels, bdists, eggs, and accompanying PGP-signatures via standard Python packaging tools like pip, setuptools, and twine, or simply by copying files. As of version 2.4.1, it is actively maintained with frequent releases, typically several per year, focusing on maintenance, dependency updates, and new features.

Common errors

Warnings

Install

Imports

Quickstart

This quickstart guides you through setting up a basic pypiserver instance, creating a dummy package, uploading it, and then installing it using pip. It demonstrates the command-line interface for running the server and typical client-side interaction.

# 1. Install pypiserver (if not already done)
# pip install pypiserver

# 2. Create a directory to store your packages
mkdir -p ~/my_pypi_packages

# 3. Start the PyPI server in the background
# This will serve packages from ~/my_pypi_packages on port 8080
pypi-server run -p 8080 ~/my_pypi_packages &

# 4. (Optional) Create a dummy package to upload
mkdir my_dummy_package
echo 'from setuptools import setup, find_packages\nsetup(name="my-dummy-package", version="0.1.0", packages=find_packages())' > my_dummy_package/setup.py
echo '__init__.py' > my_dummy_package/my_dummy_package/__init__.py
pip install build twine
python -m build --sdist --wheel my_dummy_package

# 5. Upload a package using twine
# Replace 'dist/*' with the path to your package files (e.g., .whl, .tar.gz)
twine upload --repository-url http://localhost:8080 dist/*

# 6. Install a package from your local PyPI server
# For HTTP, you might need --trusted-host if pip complains
pip install --index-url http://localhost:8080/simple/ --trusted-host localhost my-dummy-package

# To stop the server later, find its process ID (e.g., `pgrep pypi-server`) and `kill <PID>`

view raw JSON →