Skip to content
Paquetier

Python Packages

A repository serves either R packages or Python packages. A Python repository speaks the protocols pip, uv, Poetry, PDM and twine already know, so they work with it without a plugin.

Creating a Python Repository

  1. Navigate to Repositories and click New repository.
  2. Under Language, choose Python.
  3. Fill in the slug, name, visibility and storage as for any repository.

The language cannot change once the repository exists.

With the CLI:

paquetier repo create --slug my-python --name "My Python packages" --type pypi --storage-connection-id 1

The Index URL

Every Python repository serves a simple index (PEP 503 and PEP 691) at:

https://paquetier.example.com/pypi/<slug>/simple/

This is the URL pip calls --index-url and uv and Poetry call an index or source. The repository’s Install tab shows it with ready-to-copy commands.

Installing Packages

pip install --index-url https://paquetier.example.com/pypi/my-python/simple/ my-package
uv add --index paquetier=https://paquetier.example.com/pypi/my-python/simple/ my-package

With Poetry, add the repository as an explicit source and name it when adding a package:

poetry source add --priority=explicit paquetier https://paquetier.example.com/pypi/my-python/simple/
poetry add --source paquetier my-package

--index-url replaces PyPI for pip, so every dependency must be in the repository too: mirror what your packages need, or add --extra-index-url https://pypi.org/simple/ when no name in the repository could clash with one on PyPI. uv takes a package from the first index that has it, and Poetry’s explicit source serves only what names it, so a project of the same name on PyPI cannot replace one from Paquetier.

To make the repository the default, set index-url in pip.conf, a [[tool.uv.index]] entry, or a [[tool.poetry.source]] entry; the Install tab’s Config tab shows each one.

Private Repositories

A private repository takes an API key as the password, with __token__ as the user name. pip and uv both read ~/.netrc:

machine paquetier.example.com login __token__ password paquetier_your_api_key

In CI, pass the key through the environment instead:

# pip
export PIP_INDEX_URL="https://__token__:$PAQUETIER_API_KEY@paquetier.example.com/pypi/my-python/simple/"
# uv, for an index named paquetier
export UV_INDEX_PAQUETIER_USERNAME=__token__
export UV_INDEX_PAQUETIER_PASSWORD="$PAQUETIER_API_KEY"
# Poetry, for a source named paquetier
export POETRY_HTTP_BASIC_PAQUETIER_USERNAME=__token__
export POETRY_HTTP_BASIC_PAQUETIER_PASSWORD="$PAQUETIER_API_KEY"

Publishing Packages

Publishing takes an API key with the write role and write access to the repository, public or not.

# uv
uv build
uv publish --publish-url https://paquetier.example.com/pypi/my-python/ --username __token__ --password "$PAQUETIER_API_KEY"
# twine
python -m build
twine upload --repository-url https://paquetier.example.com/pypi/my-python/ --username __token__ --password "$PAQUETIER_API_KEY" dist/*
# the Paquetier CLI
paquetier upload --repo my-python dist/*

Paquetier checks that each file is a wheel or an sdist whose metadata names the same project and version as its file name. A published file is never replaced, because installers pin its hash:

  • uploading the identical file again succeeds and changes nothing, so a re-run publish job is safe;
  • a different file under the same name is refused with 409 Conflict; publish a new version instead.

uv publish --check-url https://paquetier.example.com/pypi/my-python/simple/ skips the files the repository already has.

Names, Versions and Yanking

Project names are matched in any spelling, as on PyPI: Typing_Extensions, typing.extensions and typing-extensions are one project. Versions follow PEP 440, so 1.10rc1 sorts after 1.9, and 1.0 and 1.0.0 are one release.

Owners and editors can yank a release from its package page, with an optional reason. A yanked release stays installable when pinned with ==, and installers show the reason.

Platforms

A Python repository’s Platforms tab shows which platforms and Python versions its wheels cover. A wheel built for one interpreter, such as cp312, counts for Python 3.12; a wheel for every Python 3 (py3, abi3) counts for all of them. A pure-Python wheel (py3-none-any) installs on every platform and counts on all of them.

Scanning Existing Wheels

A scan imports a directory of wheels and sdists from a storage connection, at any depth, and needs no index file. Leave the path empty to re-import the repository’s own files. A path outside the repository needs a scan path grant, as for R; once the grant is revoked, the files found under it are no longer listed or served.

Mirroring PyPI

A Python repository can mirror a simple index: PyPI (https://pypi.org/simple/), a devpi or Artifactory index, or another Paquetier.

  • Selected packages copies the named projects and what they require, following Requires-Dist; requirements of optional extras are left out.
  • Everything copies every project the upstream lists, which suits small private indexes; PyPI has several hundred thousand.

PyPI projects can have thousands of wheels, so narrow what each one contributes:

Setting Effect
Releases per project Keep the newest releases only; 0 keeps all
Python versions Keep wheels for these versions, such as 3.12; wheels for every Python stay
Wheel platforms Keep wheels for pure Python, manylinux, musllinux, other Linux, macOS, Windows
Include pre-releases Also copy pre-releases and development releases
Skip source distributions Leave sdists out, which saves space but leaves a platform without a wheel stuck

Every file is checked against the hash the index gives. Yanked files are not copied, and a release the upstream yanks later is yanked in the mirror too.

Building from Git

A git source whose repositories are Python repositories builds a Python project: an sdist and a wheel, with uv build, python -m build, or build installed for the occasion. It runs in the build environments (Settings > Build environments) whose language is Python, which need uv or python3 in their image; a git source cannot publish into R and Python repositories at once.

  • The project needs a pyproject.toml, setup.py or setup.cfg in the source’s directory.
  • A version tag such as v1.2.0 must match the version the build produces; setuptools-scm and hatch-vcs projects get the tag’s version handed to them.
  • The first build records the project, and later builds of the source must build the same one.
  • Native wheels go through auditwheel repair, which bundles the libraries they need and tags them manylinux in a glibc image or musllinux in a musl image.
  • With Build binaries, every further environment adds its platform wheels, such as an aarch64 or a musl build.