Python packaging

Python packages in Divio projects are installed using pip.

The appropriate section in the Dockerfile processes the project’s (or, if you have pinned all dependencies, its requirements.txt).

Our wheels proxy

We maintain our own DevPi server for private packages, and a Python wheels proxy.

Our wheels proxy creates wheels for all packages on PyPI.

A Python wheel is a pre-compiled packaged, built for a particular platform. Wheels offer numerous advantages over other Python packaging options.

Using wheels reduces installation times significantly, both locally and on our infrastructure. Using wheels also allows us to perform additional dependency resolution during installation.

Not using the wheels proxy

You don’t have to use our wheels proxy, though it’s the default and it’s strongly recommended. To change the way Python installs packages, see the Dockerfile. Our standard Dockerfile for Python/Django projects contains:

ENV PIP_INDEX_URL=${PIP_INDEX_URL:-${WHEELS_PLATFORM:-aldryn-baseproject-py3}/+simple/} \

This can be removed or changed, along with the subsequent instruction:

RUN pip install --requirement


See Docker image/layer caching and re-use for the implications of caching for package installation with pip.