Package types
PyPI
Install and upload Python packages through a PyPI repository, with pip, uv, Poetry or twine.
This command writes the index URL to pip's configuration file and your credentials to ~/.netrc:
relic package setup pip pypi --write
Install a package:
pip install requests
This command configures twine in ~/.pypirc:
relic package setup twine pypi-local --write
Upload with twine:
twine upload --repository pypi-local dist/*
relic package setup poetry and relic package setup pipenv configure Poetry and Pipenv.
Poetry reserves the name pypi for PyPI, so setup names a repository called pypirelic-pypi in Poetry's configuration.
pip by hand
In pip.conf:
[global]
index-url = https://<you>:<token>@relic.example.com/pypi/pypi/simple
uv
Add the index to pyproject.toml:
[[tool.uv.index]]
name = "relic"
url = "https://relic.example.com/pypi/pypi/simple"
default = true
Set the credentials:
export UV_INDEX_RELIC_USERNAME=<you> UV_INDEX_RELIC_PASSWORD=<token>
Lock the dependencies:
uv lock
Install them:
uv sync --frozen
Poetry
Add the primary source:
poetry source add --priority=primary relic https://relic.example.com/pypi/pypi/simple
Store your credentials:
poetry config http-basic.relic <you> <token>
A remote of PyPI
A remote of PyPI has the file host as url; indexUrl defaults to https://pypi.org:
apiVersion: relic.build/v1
kind: Repository
metadata:
name: pypi-remote
spec:
class: remote
format: pypi
remote:
url: https://files.pythonhosted.org
A url of https://pypi.org also works. For another index, set url to its file host and indexUrl to the index.
Notes
- Replacing an existing file needs delete permission; without it the server answers
409, whichtwine upload --skip-existingskips. - For a private CA (TLS): pip takes
--certorPIP_CERT, uvSSL_CERT_FILEorUV_NATIVE_TLS=1, twine and PoetryREQUESTS_CA_BUNDLE.