endlessm / azafea

Service to track device activations and usage metrics
Mozilla Public License 2.0
10 stars 2 forks source link

docker: Preinstall setuptools and wheel #91

Closed bochecha closed 4 years ago

bochecha commented 4 years ago

Building the Docker image requires installing Pipenv, then using it to install the Azafea dependencies in a virtualenv.

The Azafea dependencies are pinned to specific versions, so every time we build the Docker image we get the exact same virtualenv, until we bump those dependencies.

However, Pipenv itself doesn't pin its dependencies, so we get the latest of each one of them.

This has no impact on what ends up in the virtualenv, which is correctly reproducible.

It does have an impact on installing Pipenv though, and this just happened and broke the build of our Docker image.

The latest Pipenv release (which we have been using for a while and hasn't changed) has the following requirements:

A recent virtualenv release (20.0.2 on February 11 2020) added a dependency on distlib<1,>=0.3.0 which doesn't have a wheel available.

As a result, Pip tries to build a distlib egg-info and wheel to install it, which fails because setuptools hasn't been installed yet at this point.

This commit fixes that by installing setuptools early.