From bfdb2ba41acbb15e34858a359686e257535b9956 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 7 Sep 2021 17:36:39 -0700 Subject: [PATCH] Pin setuptools to 44.x --- 2.7/bullseye/Dockerfile | 3 ++ 2.7/buster/Dockerfile | 3 ++ 2.7/slim-bullseye/Dockerfile | 3 ++ 2.7/slim-buster/Dockerfile | 3 ++ 2.7/windows/windowsservercore-1809/Dockerfile | 3 ++ 3.7/bullseye/Dockerfile | 3 ++ 3.7/buster/Dockerfile | 3 ++ 3.7/slim-bullseye/Dockerfile | 3 ++ 3.7/slim-buster/Dockerfile | 3 ++ 3.7/windows/windowsservercore-1809/Dockerfile | 3 ++ Dockerfile-linux.template | 3 ++ Dockerfile-windows-servercore.template | 3 ++ versions.json | 6 ++++ versions.sh | 29 ++++++++++++------- 14 files changed, 61 insertions(+), 10 deletions(-) diff --git a/2.7/bullseye/Dockerfile b/2.7/bullseye/Dockerfile index 28575c2..00c6a2b 100644 --- a/2.7/bullseye/Dockerfile +++ b/2.7/bullseye/Dockerfile @@ -88,6 +88,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -101,6 +103,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ # smoke test pip --version; \ diff --git a/2.7/buster/Dockerfile b/2.7/buster/Dockerfile index 78a5220..2639c9b 100644 --- a/2.7/buster/Dockerfile +++ b/2.7/buster/Dockerfile @@ -88,6 +88,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -101,6 +103,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ # smoke test pip --version; \ diff --git a/2.7/slim-bullseye/Dockerfile b/2.7/slim-bullseye/Dockerfile index 7f20c9a..6fd0fdb 100644 --- a/2.7/slim-bullseye/Dockerfile +++ b/2.7/slim-bullseye/Dockerfile @@ -86,6 +86,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -102,6 +104,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ apt-get purge -y --auto-remove wget; \ # smoke test diff --git a/2.7/slim-buster/Dockerfile b/2.7/slim-buster/Dockerfile index 2a582a8..026331c 100644 --- a/2.7/slim-buster/Dockerfile +++ b/2.7/slim-buster/Dockerfile @@ -86,6 +86,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -102,6 +104,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ apt-get purge -y --auto-remove wget; \ # smoke test diff --git a/2.7/windows/windowsservercore-1809/Dockerfile b/2.7/windows/windowsservercore-1809/Dockerfile index 9869126..f7372dc 100644 --- a/2.7/windows/windowsservercore-1809/Dockerfile +++ b/2.7/windows/windowsservercore-1809/Dockerfile @@ -90,6 +90,8 @@ RUN $url = 'https://downloads.python.org/pypy/pypy2.7-v7.3.5-win64.zip'; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -108,6 +110,7 @@ RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); --disable-pip-version-check \ --no-cache-dir \ ('pip == {0}' -f $env:PYTHON_PIP_VERSION) \ + ('setuptools == {0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ ; \ Remove-Item get-pip.py -Force; \ \ diff --git a/3.7/bullseye/Dockerfile b/3.7/bullseye/Dockerfile index 7489af6..d761584 100644 --- a/3.7/bullseye/Dockerfile +++ b/3.7/bullseye/Dockerfile @@ -104,6 +104,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -117,6 +119,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ # smoke test pip --version; \ diff --git a/3.7/buster/Dockerfile b/3.7/buster/Dockerfile index ec27d8b..62143ff 100644 --- a/3.7/buster/Dockerfile +++ b/3.7/buster/Dockerfile @@ -104,6 +104,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -117,6 +119,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ # smoke test pip --version; \ diff --git a/3.7/slim-bullseye/Dockerfile b/3.7/slim-bullseye/Dockerfile index 1c01d31..cb61393 100644 --- a/3.7/slim-bullseye/Dockerfile +++ b/3.7/slim-bullseye/Dockerfile @@ -104,6 +104,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -120,6 +122,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ apt-get purge -y --auto-remove wget; \ # smoke test diff --git a/3.7/slim-buster/Dockerfile b/3.7/slim-buster/Dockerfile index 15d0dc3..60bdc0d 100644 --- a/3.7/slim-buster/Dockerfile +++ b/3.7/slim-buster/Dockerfile @@ -104,6 +104,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -120,6 +122,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ apt-get purge -y --auto-remove wget; \ # smoke test diff --git a/3.7/windows/windowsservercore-1809/Dockerfile b/3.7/windows/windowsservercore-1809/Dockerfile index 141185f..d479080 100644 --- a/3.7/windows/windowsservercore-1809/Dockerfile +++ b/3.7/windows/windowsservercore-1809/Dockerfile @@ -87,6 +87,8 @@ RUN $url = 'https://downloads.python.org/pypy/pypy3.7-v7.3.5-win64.zip'; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION 20.3.4 +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION 44.1.1 # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL https://github.com/pypa/get-pip/raw/3843bff3a0a61da5b63ea0b7d34794c5c51a2f11/get-pip.py ENV PYTHON_GET_PIP_SHA256 95c5ee602b2f3cc50ae053d716c3c89bea62c58568f64d7d25924d399b2d5218 @@ -105,6 +107,7 @@ RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); --disable-pip-version-check \ --no-cache-dir \ ('pip == {0}' -f $env:PYTHON_PIP_VERSION) \ + ('setuptools == {0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ ; \ Remove-Item get-pip.py -Force; \ \ diff --git a/Dockerfile-linux.template b/Dockerfile-linux.template index f54a04a..ebd4ebb 100644 --- a/Dockerfile-linux.template +++ b/Dockerfile-linux.template @@ -132,6 +132,8 @@ RUN set -eux; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION {{ .pip.version }} +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }} # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL {{ ."get-pip".url }} ENV PYTHON_GET_PIP_SHA256 {{ ."get-pip".sha256 }} @@ -150,6 +152,7 @@ RUN set -ex; \ --disable-pip-version-check \ --no-cache-dir \ "pip == $PYTHON_PIP_VERSION" \ + "setuptools == $PYTHON_SETUPTOOLS_VERSION" \ ; \ {{ if is_slim then ( -}} apt-get purge -y --auto-remove wget; \ diff --git a/Dockerfile-windows-servercore.template b/Dockerfile-windows-servercore.template index 7026a1f..9510ef7 100644 --- a/Dockerfile-windows-servercore.template +++ b/Dockerfile-windows-servercore.template @@ -88,6 +88,8 @@ RUN $url = '{{ .arches["windows-amd64"].url }}'; \ # if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value ''" ENV PYTHON_PIP_VERSION {{ .pip.version }} +# https://github.com/docker-library/python/issues/365 +ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }} # https://github.com/pypa/get-pip ENV PYTHON_GET_PIP_URL {{ ."get-pip".url }} ENV PYTHON_GET_PIP_SHA256 {{ ."get-pip".sha256 }} @@ -106,6 +108,7 @@ RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL); --disable-pip-version-check \ --no-cache-dir \ ('pip == {0}' -f $env:PYTHON_PIP_VERSION) \ + ('setuptools == {0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \ ; \ Remove-Item get-pip.py -Force; \ \ diff --git a/versions.json b/versions.json index e74ff11..6484929 100644 --- a/versions.json +++ b/versions.json @@ -26,6 +26,9 @@ "pip": { "version": "20.3.4" }, + "setuptools": { + "version": "44.1.1" + }, "variants": [ "bullseye", "slim-bullseye", @@ -66,6 +69,9 @@ "pip": { "version": "20.3.4" }, + "setuptools": { + "version": "44.1.1" + }, "variants": [ "bullseye", "slim-bullseye", diff --git a/versions.sh b/versions.sh index add56b5..afba6ed 100755 --- a/versions.sh +++ b/versions.sh @@ -27,20 +27,28 @@ fi versions=( "${versions[@]%/}" ) pipVersion="$( - curl -fsSL 'https://pypi.org/pypi/pip/json' \ - | jq -r ' - .releases - | keys[] - # version 20.x is the last to support Python 2 - | select(startswith("20.")) - ' \ - | sort -rV \ - | head -1 + curl -fsSL 'https://pypi.org/pypi/pip/json' | jq -r ' + .releases + | keys_unsorted + # version 20.x is the last to support Python 2 + | map(select(startswith("20.") and (test("[^0-9.]") | not))) + | max_by(split(".") | map(tonumber)) + ' +)" +# https://github.com/docker-library/python/issues/365 +setuptoolsVersion="$( + curl -fsSL 'https://pypi.org/pypi/setuptools/json' | jq -r ' + .releases + | keys_unsorted + # version 44.x is the last to support Python 2 + | map(select(startswith("44."))) + | max_by(split(".") | map(tonumber)) + ' )" getPipCommit="$(curl -fsSL "https://github.com/pypa/get-pip/commits/$pipVersion/get-pip.py.atom" | tac|tac | awk -F '[[:space:]]*[<>/]+' '$2 == "id" && $3 ~ /Commit/ { print $4; exit }')" getPipUrl="https://github.com/pypa/get-pip/raw/$getPipCommit/get-pip.py" getPipSha256="$(curl -fsSL "$getPipUrl" | sha256sum | cut -d' ' -f1)" -export pipVersion getPipCommit getPipUrl getPipSha256 +export pipVersion setuptoolsVersion getPipCommit getPipUrl getPipSha256 sha256s="$(curl -fsSL --compressed 'https://www.pypy.org/checksums.html')" pypy_tarball() { @@ -106,6 +114,7 @@ for version in "${versions[@]}"; do }, }, pip: { version: env.pipVersion }, + setuptools: { version: env.setuptoolsVersion }, "get-pip": { version: env.getPipCommit, sha256: env.getPipSha256,