Python environments

These are the Python environments we use inside our Docker containers.

System Python 3.6

Python 3.6 (‘slim-buster’) is installed from the Debian repositories into /usr.

Dependencies are installed with pip3. See the Docker base image for details.

Local Python 3.6

All of our Docker containers are based on the official python:3.6 Docker Hub repo, and have the latest stable version of Python 3.6 installed in to /usr/local.

The uwsgi and awslogs commands are installed using pip3 and run using Python 3.

Python 3.6 virtual environment

When a Docker container is created, a virtual environment is created at /app/venv using the locally installed Python 3.6. Apps and their requirements are then installed to this virtual environment. uwsgi is configured to run the apps inside the virtual enviroment.

Python 3.8 compatibility

To assist future upgrades, we run Travis checks for Python 3.6, 3.7 and 3.8 on all our Python repos (except the digitalmarketplace-scripts repo). Any code changes should work across all three environments.

The scripts repo requires further work to migrate to Python 3.7+.