Skip to content

Update to 3.12.0b1 (which removes bundled setuptools) #833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions 3.12-rc/alpine3.17/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/alpine3.18/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/slim-bullseye/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/slim-buster/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/windows/windowsservercore-1809/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions 3.12-rc/windows/windowsservercore-ltsc2022/Dockerfile

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Dockerfile-linux.template
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,10 @@ RUN set -eux; \

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION {{ .pip.version }}
{{ if .setuptools then ( -}}
# https://github.com/docker-library/python/issues/365
ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }}
{{ ) else "" end -}}
# https://github.com/pypa/get-pip
ENV PYTHON_GET_PIP_URL {{ .pip.url }}
ENV PYTHON_GET_PIP_SHA256 {{ .pip.sha256 }}
Expand Down Expand Up @@ -337,7 +339,9 @@ RUN set -eux; \
--no-cache-dir \
--no-compile \
"pip==$PYTHON_PIP_VERSION" \
{{ if .setuptools then ( -}}
"setuptools==$PYTHON_SETUPTOOLS_VERSION" \
{{ ) else "" end -}}
; \
rm -f get-pip.py; \
\
Expand Down
4 changes: 4 additions & 0 deletions Dockerfile-windows.template
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ RUN $url = ('https://www.python.org/ftp/python/{0}/python-{1}-amd64.exe' -f ($en

# if this is called "PIP_VERSION", pip explodes with "ValueError: invalid truth value '<VERSION>'"
ENV PYTHON_PIP_VERSION {{ .pip.version }}
{{ if .setuptools then ( -}}
# https://github.com/docker-library/python/issues/365
ENV PYTHON_SETUPTOOLS_VERSION {{ .setuptools.version }}
{{ ) else "" end -}}
# https://github.com/pypa/get-pip
ENV PYTHON_GET_PIP_URL {{ .pip.url }}
ENV PYTHON_GET_PIP_SHA256 {{ .pip.sha256 }}
Expand All @@ -69,7 +71,9 @@ RUN Write-Host ('Downloading get-pip.py ({0}) ...' -f $env:PYTHON_GET_PIP_URL);
--no-cache-dir \
--no-compile \
('pip=={0}' -f $env:PYTHON_PIP_VERSION) \
{{ if .setuptools then ( -}}
('setuptools=={0}' -f $env:PYTHON_SETUPTOOLS_VERSION) \
{{ ) else "" end -}}
; \
Remove-Item get-pip.py -Force; \
\
Expand Down
7 changes: 2 additions & 5 deletions versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
"pip": {
"sha256": "96461deced5c2a487ddc65207ec5a9cffeca0d34e7af7ea1afc470ff0d746207",
"url": "https://github.com/pypa/get-pip/raw/0d8570dc44796f4369b652222cf176b3db6ac70e/public/get-pip.py",
"version": "23.0.1"
},
"setuptools": {
"version": "65.5.1"
"version": "23.1.2"
},
"variants": [
"bullseye",
Expand All @@ -60,7 +57,7 @@
"windows/windowsservercore-ltsc2022",
"windows/windowsservercore-1809"
],
"version": "3.12.0a7"
"version": "3.12.0b1"
},
"3.7": {
"pip": {
Expand Down
66 changes: 43 additions & 23 deletions versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -125,34 +125,53 @@ for version in "${versions[@]}"; do
| grep -E '^[^[:space:]]+_VERSION[[:space:]]*='
)"
pipVersion="$(sed -nre 's/^_PIP_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")"
setuptoolsVersion="$(sed -nre 's/^_SETUPTOOLS_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")"
# make sure we got something
if [ -z "$pipVersion" ] || [ -z "$setuptoolsVersion" ]; then
echo >&2 "error: $version: missing either pip ($pipVersion) or setuptools ($setuptoolsVersion) version"
if [ -z "$pipVersion" ]; then
echo >&2 "error: $version: missing pip version"
exit 1
fi
# make sure what we got is valid versions
if ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/pip/$pipVersion/json" || ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/setuptools/$setuptoolsVersion/json"; then
echo >&2 "error: $version: either pip ($pipVersion) or setuptools ($setuptoolsVersion) version seems to be invalid?"
if ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/pip/$pipVersion/json"; then
echo >&2 "error: $version: pip version ($pipVersion) seems to be invalid?"
exit 1
fi

# TODO remove this once Python 3.7 and 3.8 are either "new enough setuptools" or EOL
setuptoolsVersion="$(
{
echo "$setuptoolsVersion"
echo "$minimumSetuptoolsVersion"
} | sort -rV | head -1
)"
setuptoolsVersion="$(sed -nre 's/^_SETUPTOOLS_VERSION[[:space:]]*=[[:space:]]*"(.*?)".*/\1/p' <<<"$ensurepipVersions")"
case "$rcVersion" in
3.7 | 3.8 | 3.9 | 3.10 | 3.11)
if [ -z "$setuptoolsVersion" ]; then
echo >&2 "error: $version: missing setuptools version"
exit 1
fi
if ! wget -q -O /dev/null -o /dev/null --spider "https://pypi.org/pypi/setuptools/$setuptoolsVersion/json"; then
echo >&2 "error: $version: setuptools version ($setuptoolsVersion) seems to be invalid?"
exit 1
fi

# https://github.com/docker-library/python/issues/781 (TODO remove this once 3.10, 3.11, and 3.12 embed a newer setuptools and this section no longer applies)
if [ "$setuptoolsVersion" = '65.5.0' ]; then
setuptoolsVersion='65.5.1'
fi
# TODO remove this once Python 3.7 and 3.8 are either "new enough setuptools" or EOL
setuptoolsVersion="$(
{
echo "$setuptoolsVersion"
echo "$minimumSetuptoolsVersion"
} | sort -rV | head -1
)"

# https://github.com/docker-library/python/issues/781 (TODO remove this if 3.10 and 3.11 embed a newer setuptools and this section no longer applies)
if [ "$setuptoolsVersion" = '65.5.0' ]; then
setuptoolsVersion='65.5.1'
fi
;;

*)
# https://github.com/python/cpython/issues/95299 -> https://github.com/python/cpython/commit/ece20dba120a1a4745721c49f8d7389d4b1ee2a7
if [ -n "$setuptoolsVersion" ]; then
echo >&2 "error: $version: unexpected setuptools: $setuptoolsVersion"
exit 1
fi
;;
esac

# TODO wheelVersion, somehow: https://github.com/docker-library/python/issues/365#issuecomment-914669320

echo "$version: $fullVersion (pip $pipVersion, setuptools $setuptoolsVersion${hasWindows:+, windows})"
echo "$version: $fullVersion (pip $pipVersion${setuptoolsVersion:+, setuptools $setuptoolsVersion}${hasWindows:+, windows})"

export fullVersion pipVersion setuptoolsVersion hasWindows
json="$(jq <<<"$json" -c '
Expand All @@ -163,9 +182,6 @@ for version in "${versions[@]}"; do
url: env.getPipUrl,
sha256: env.getPipSha256,
},
setuptools: {
version: env.setuptoolsVersion,
},
variants: [
(
"bullseye",
Expand All @@ -182,7 +198,11 @@ for version in "${versions[@]}"; do
| "windows/windowsservercore-" + .)
else empty end
],
}
} + if env.setuptoolsVersion != "" then {
setuptools: {
version: env.setuptoolsVersion,
},
} else {} end
')"
done

Expand Down