Skip to content
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

Drop CPython 3.6 & 3.7 - MERGE AFTER 2025-05-06 #1673

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft
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
37 changes: 26 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,22 +38,39 @@ jobs:
python-version: "3.x"
- uses: pre-commit/[email protected]

build_matrix:
needs: pre_commit
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.matrix.outputs.matrix }}
steps:
- id: matrix
name: build matrix
shell: python
run: |
import os
import json
reduced = [
("x86_64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
("aarch64", "ubuntu-22.04", ("manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2")),
("i686", "ubuntu-22.04", ("manylinux2014", "musllinux_1_2")),
("armv7l", "ubuntu-22.04", ("manylinux_2_31", "musllinux_1_2")),
]
expanded = [{"policy": policy, "platform": platform, "runner": runner} for platform, runner, policies in reduced for policy in policies]
print(json.dumps(expanded, indent=2))
with open(os.environ["GITHUB_OUTPUT"], "at") as f:
f.write(f"matrix={json.dumps(expanded)}")

build_manylinux:
needs: [pre_commit]
name: ${{ matrix.policy }}_${{ matrix.platform }}
runs-on: ubuntu-22.04
needs: build_matrix
runs-on: ${{ matrix.runner }}
permissions:
actions: write # this permission is needed to delete cache
strategy:
fail-fast: false
matrix:
policy: ["manylinux2014", "manylinux_2_28", "manylinux_2_34", "musllinux_1_2"]
platform: ["x86_64"]
include:
- policy: "manylinux2014"
platform: "i686"
- policy: "musllinux_1_2"
platform: "i686"
include: ${{ fromJson(needs.build_matrix.outputs.matrix) }}
env:
POLICY: ${{ matrix.policy }}
PLATFORM: ${{ matrix.platform }}
Expand All @@ -68,8 +85,6 @@ jobs:
- name: Set up emulation
if: matrix.platform != 'i686' && matrix.platform != 'x86_64'
uses: docker/setup-qemu-action@v3
with:
platforms: ${{ matrix.platform }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
Expand Down
20 changes: 0 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,38 +29,18 @@ env:

jobs:
include:
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="manylinux2014" PLATFORM="aarch64"
- arch: s390x
env: POLICY="manylinux2014" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="manylinux2014" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="manylinux_2_28" PLATFORM="aarch64"
- arch: s390x
env: POLICY="manylinux_2_28" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="manylinux_2_28" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="manylinux_2_34" PLATFORM="aarch64"
- arch: s390x
env: POLICY="manylinux_2_34" PLATFORM="s390x"
- arch: ppc64le
env: POLICY="manylinux_2_34" PLATFORM="ppc64le"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="musllinux_1_2" PLATFORM="aarch64"
- arch: arm64-graviton2
virt: vm
group: edge
env: POLICY="musllinux_1_2" PLATFORM="armv7l"
- arch: s390x
env: POLICY="musllinux_1_2" PLATFORM="s390x"
- arch: ppc64le
Expand Down
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -238,12 +238,12 @@ Image content

All supported images currently contain:

- CPython 3.6, 3.7, 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.13t and PyPy 3.7, 3.8, 3.9, 3.10 installed in
- CPython 3.8, 3.9, 3.10, 3.11, 3.12, 3.13, 3.13t and PyPy 3.8, 3.9, 3.10 installed in
``/opt/python/<python tag>-<abi tag>``. The directories are named
after the PEP 425 tags for each environment --
e.g. ``/opt/python/cp37-cp37m`` contains a CPython 3.7 build, and
e.g. ``/opt/python/cp313-cp313`` contains a CPython 3.13 build, and
can be used to produce wheels named like
``<pkg>-<version>-cp37-cp37m-<arch>.whl``.
``<pkg>-<version>-cp313-cp313-<arch>.whl``.

- Development packages for all the libraries that PEP 571/599 list. One should not assume the presence of any other development package.

Expand Down
5 changes: 5 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ elif [ "${POLICY}" == "manylinux_2_28" ]; then
DEVTOOLSET_ROOTPATH="/opt/rh/gcc-toolset-14/root"
PREPEND_PATH="${DEVTOOLSET_ROOTPATH}/usr/bin:"
LD_LIBRARY_PATH_ARG="${DEVTOOLSET_ROOTPATH}/usr/lib64:${DEVTOOLSET_ROOTPATH}/usr/lib:${DEVTOOLSET_ROOTPATH}/usr/lib64/dyninst:${DEVTOOLSET_ROOTPATH}/usr/lib/dyninst"
elif [ "${POLICY}" == "manylinux_2_31" ]; then
BASEIMAGE="ubuntu:20.04"
DEVTOOLSET_ROOTPATH=
PREPEND_PATH=
LD_LIBRARY_PATH_ARG=
elif [ "${POLICY}" == "manylinux_2_34" ]; then
BASEIMAGE="almalinux:9"
DEVTOOLSET_ROOTPATH="/opt/rh/gcc-toolset-14/root"
Expand Down
19 changes: 3 additions & 16 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -107,28 +107,17 @@ RUN export MPDECIMAL_ROOT=mpdecimal-4.0.0 && \
manylinux-entrypoint /build_scripts/build-mpdecimal.sh


FROM build_base AS build_cpython_system_ssl
FROM build_base AS build_cpython
COPY --from=build_tcl_tk /manylinux-buildfs /
COPY --from=build_mpdecimal /manylinux-buildfs /
COPY --from=build_sqlite3 /manylinux-buildfs /
COPY build_scripts/build-cpython.sh /build_scripts/
RUN if command -v apk >/dev/null 2>&1; then ldconfig /; else ldconfig; fi

FROM build_cpython_system_ssl AS build_cpython
COPY build_scripts/build-openssl.sh /build_scripts/
RUN export OPENSSL_ROOT=openssl-3.0.15 && \
export OPENSSL_HASH=23c666d0edf20f14249b3d8f0368acaee9ab585b09e1de82107c66e1f3ec9533 && \
export OPENSSL_DOWNLOAD_URL=https://github.com/openssl/openssl/releases/download/${OPENSSL_ROOT} && \
manylinux-entrypoint /build_scripts/build-openssl.sh


FROM build_cpython_system_ssl AS build_cpython36
COPY build_scripts/cpython-pubkeys.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.6.15

FROM build_cpython_system_ssl AS build_cpython37
COPY build_scripts/cpython-pubkeys.txt /build_scripts/cpython-pubkeys.txt
RUN manylinux-entrypoint /build_scripts/build-cpython.sh 3.7.17
COPY build_scripts/build-cpython.sh /build_scripts/

FROM build_cpython AS build_cpython38
COPY build_scripts/ambv-pubkey.txt /build_scripts/cpython-pubkeys.txt
Expand Down Expand Up @@ -165,9 +154,7 @@ COPY --from=build_mpdecimal /manylinux-rootfs /
COPY --from=build_sqlite3 /manylinux-rootfs /
COPY --from=build_git /manylinux-rootfs /
COPY build_scripts /opt/_internal/build_scripts/
RUN --mount=type=bind,target=/build_cpython36,from=build_cpython36 \
--mount=type=bind,target=/build_cpython37,from=build_cpython37 \
--mount=type=bind,target=/build_cpython38,from=build_cpython38 \
RUN --mount=type=bind,target=/build_cpython38,from=build_cpython38 \
--mount=type=bind,target=/build_cpython39,from=build_cpython39 \
--mount=type=bind,target=/build_cpython310,from=build_cpython310 \
--mount=type=bind,target=/build_cpython311,from=build_cpython311 \
Expand Down
9 changes: 3 additions & 6 deletions docker/build_scripts/build-cpython.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,14 @@ if [ "${2:-}" == "nogil" ]; then
CONFIGURE_ARGS+=(--disable-gil)
fi

if [ "${CPYTHON_VERSION}" == "3.6.15" ]; then
# https://github.com/python/cpython/issues/89863
# gcc-12+ uses these 2 flags in -O2 but they were only enabled in -O3 with gcc-11
CFLAGS_EXTRA="${CFLAGS_EXTRA} -fno-tree-loop-vectorize -fno-tree-slp-vectorize"
fi
if [ "${AUDITWHEEL_POLICY}" == "manylinux2014" ] ; then
# Python 3.11+
export TCLTK_LIBS="-ltk8.6 -ltcl8.6"
fi

if [ "${BASE_POLICY}_${AUDITWHEEL_ARCH}" == "musllinux_armv7l" ]; then
if [ "${BASE_POLICY}_${AUDITWHEEL_ARCH}" == "manylinux_armv7l" ]; then
CONFIGURE_ARGS+=(--build=armv7l-unknown-linux-gnueabihf)
elif [ "${BASE_POLICY}_${AUDITWHEEL_ARCH}" == "musllinux_armv7l" ]; then
CONFIGURE_ARGS+=(--build=arm-linux-musleabihf)
fi

Expand Down
2 changes: 2 additions & 0 deletions docker/build_scripts/build-openssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ fi

if [ "${OS_ID_LIKE}" = "rhel" ];then
manylinux_pkg_remove openssl-devel
elif [ "${OS_ID_LIKE}" = "debian" ];then
manylinux_pkg_remove libssl-dev
elif [ "${OS_ID_LIKE}" = "alpine" ]; then
manylinux_pkg_remove openssl-dev
fi
Expand Down
11 changes: 11 additions & 0 deletions docker/build_scripts/build_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ else
PACKAGE_MANAGER=dnf
elif command -v yum >/dev/null 2>&1; then
PACKAGE_MANAGER=yum
elif command -v apt-get >/dev/null 2>&1; then
PACKAGE_MANAGER=apt
else
echo "unsupported image"
exit 1
Expand All @@ -29,6 +31,7 @@ fi
OS_ID_LIKE=$(. /etc/os-release; echo "${ID} ${ID_LIKE:-}")
case "${OS_ID_LIKE}" in
*rhel*) OS_ID_LIKE=rhel;;
*debian) OS_ID_LIKE=debian;;
*alpine*) OS_ID_LIKE=alpine;;
*) echo "unsupported image"; exit 1;;
esac
Expand Down Expand Up @@ -89,6 +92,9 @@ function manylinux_pkg_install {
yum -y install "$@"
elif [ "${PACKAGE_MANAGER}" = "dnf" ]; then
dnf -y install --allowerasing "$@"
elif [ "${PACKAGE_MANAGER}" = "apt" ]; then
DEBIAN_FRONTEND=noninteractive apt-get update -qq
DEBIAN_FRONTEND=noninteractive apt-get install -qq -y --no-install-recommends "$@"
elif [ "${PACKAGE_MANAGER}" = "apk" ]; then
apk add --no-cache "$@"
else
Expand All @@ -101,6 +107,8 @@ function manylinux_pkg_remove {
yum erase -y "$@"
elif [ "${PACKAGE_MANAGER}" = "dnf" ];then
dnf erase -y "$@"
elif [ "${PACKAGE_MANAGER}" = "apt" ];then
DEBIAN_FRONTEND=noninteractive apt-get remove -y "$@"
elif [ "${PACKAGE_MANAGER}" = "apk" ]; then
apk del "$@"
else
Expand All @@ -115,6 +123,9 @@ function manylinux_pkg_clean {
elif [ "${PACKAGE_MANAGER}" = "dnf" ]; then
dnf clean all
rm -rf /var/cache/dnf
elif [ "${PACKAGE_MANAGER}" = "apt" ]; then
DEBIAN_FRONTEND=noninteractive apt-get clean -qq
rm -rf /var/lib/apt/lists/*
elif [ "${PACKAGE_MANAGER}" = "apk" ]; then
:
else
Expand Down
Loading
Loading