pip, uv and Poetry

Pratique serves a Python simple index at /pypi/simple/. Point pip, uv or Poetry at it, and give each one your token.

The examples use https://pratique.example.com. Use your own server's public URL. Connect clients in the web UI shows these settings for your server, and the token page shows them with your token filled in. To create a token, see access tokens.

Python clients send the token as a password. The user name can be anything. The examples use token.

pip

Set the index URL in pip.conf, with the token in the URL as the password:

inipip.conf
[global]
index-url = https://token:YOUR_TOKEN@pratique.example.com/pypi/simple/

You can also write it with pip, or set it for one shell or CI job with an environment variable:

bashother ways to set the index
pip config set global.index-url https://token:YOUR_TOKEN@pratique.example.com/pypi/simple/
export PIP_INDEX_URL=https://token:YOUR_TOKEN@pratique.example.com/pypi/simple/

Use index-url, not extra-index-url. With an extra index, pip still asks PyPI as well, and can install from it.

Plain HTTP

pip refuses an index on plain HTTP unless its host is in trusted-host. For a trial on your own machine:

inipip.conf for a local trial
[global]
index-url = http://token:YOUR_TOKEN@127.0.0.1:8484/pypi/simple/
trusted-host = 127.0.0.1

Put Pratique behind TLS before anyone uses it over a network. A token in a URL on plain HTTP can be read by anyone on the path.

uv

Add Pratique as the default index in pyproject.toml:

tomlpyproject.toml
[[tool.uv.index]]
name = "pratique"
url = "https://pratique.example.com/pypi/simple/"
default = true

Keep the token out of the file. uv reads it from environment variables named after the index:

bashcredentials for uv
export UV_INDEX_PRATIQUE_USERNAME=token
export UV_INDEX_PRATIQUE_PASSWORD=YOUR_TOKEN

default = true replaces PyPI, so uv asks only Pratique.

Poetry

Add Pratique as the primary source, and store the token in Poetry's credentials:

bashPoetry
poetry source add --priority=primary pratique https://pratique.example.com/pypi/simple/
poetry config http-basic.pratique token YOUR_TOKEN

In CI, set POETRY_HTTP_BASIC_PRATIQUE_USERNAME and POETRY_HTTP_BASIC_PRATIQUE_PASSWORD instead of running poetry config. For details, see the Poetry repositories documentation.

Held and refused versions

Pratique lists each file that a client cannot download as yanked, with a yank reason that gives Pratique's decision. pip and uv do not install a yanked file unless you pin that exact version. So a plain pip install some-package gets the newest cleared version and does not fail.

If you pin a held or refused version, such as some-package==4.3.0, the client shows the yank reason, then the download fails with HTTP 403. The yank reason has this form:

textyank reason
Pratique: held, in quarantine until 2026-12-08 09:15 UTC. To see why, or request an exception, open https://pratique.example.com/packages/pypi/some-package?version=4.3.0#why

Held and refused files are listed under /pypi/blocked/, so the address in the client's error also tells you what happened. If the file has cleared since the listing was read, the same address delivers it.

If no file of a package is cleared, the index page itself is refused with HTTP 403, and the message says "no file of some-package is cleared" with the reason for the newest one.

Pratique also refuses a file for which PyPI declares no sha256 hash.

Missing or wrong token

Without a valid token, Pratique answers HTTP 401 with this message:

textno token
pratique: a valid client token is required. Create one at https://pratique.example.com/tokens, and set up your package manager as https://pratique.example.com/connect shows

A wrong or expired token gets the same answer. Check that the token is in the URL or in the environment variables, and that the host matches.

Lockfiles

uv.lock records a URL for each file. Files that a client got through Pratique have addresses on Pratique, under /pypi/files/.

A lockfile made before you moved to Pratique has links to files.pythonhosted.org. Those links work through Pratique if your web gateway redirects that host to Pratique's /pypi/packages/ path. Pratique reads the project from the file name, and that project's listing decides as usual. See redirect at your web gateway.

pratique lockcheck still fails such a lockfile, because it names a host other than Pratique. It reads uv.lock, poetry.lock and requirements*.txt, including --index-url and --extra-index-url lines. Regenerate the lockfile with Pratique as the index to pass. See CI.

bashin CI
pratique lockcheck --registry https://pratique.example.com

Internal packages

Names that match a reserved pattern, such as acme-*, are never looked up on PyPI. A reserved name with nothing published returns HTTP 404. In artifactory mode, you can publish private packages with uv publish or twine upload to /pypi/legacy/:

bashpublish
uv publish --publish-url https://pratique.example.com/pypi/legacy/ --token YOUR_TOKEN

The token needs publish access. See private packages.