From 6d8a9c84ebcda0e99dddc8ebe3f5ace8d43057c9 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 31 Oct 2025 15:11:50 +0000 Subject: [PATCH 1/7] Update docker images to bookworm Buster is EOL since 2022-09-10, and the LTS is also EOL since 2024-06-30. It's not available anymore in http://ftp.debian.org/debian/dists/ It's also safe to remove python3-distutils, since python3-setuptools depends on it. And given it's deprecated since Python 3.10, the package has been removed in later Debian versions (bookworm, trixie). --- .github/workflows/ci.yaml | 10 +++++----- Dockerfile | 3 +-- ci/docker-deb-test | 3 +++ ci/docker-python-test | 3 +++ 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 395d2e5..f8dda5a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,19 +9,19 @@ jobs: include: - arch: amd64 manylinux_arch: x86_64 - docker_image: debian:buster + docker_image: debian:bookworm - arch: arm64 manylinux_arch: aarch64 - docker_image: arm64v8/debian:buster + docker_image: arm64v8/debian:bookworm - arch: ppc64le manylinux_arch: ppc64le - docker_image: ppc64le/debian:buster + docker_image: ppc64le/debian:bookworm - arch: s390x manylinux_arch: s390x - docker_image: s390x/debian:buster + docker_image: s390x/debian:bookworm env: BASE_IMAGE: ${{ matrix.docker_image }} @@ -48,7 +48,7 @@ jobs: - name: Test built Debian package # XXX: This uses the clean base image (not the build one) to make # sure it installs in a clean image without any hidden dependencies. - run: docker run --rm -v $(pwd):/mnt:rw ${{ matrix.docker_image }} /mnt/ci/docker-deb-test + run: docker run --platform linux/${{ matrix.arch }} --rm -v $(pwd):/mnt:rw ${{ matrix.docker_image }} /mnt/ci/docker-deb-test - name: Build wheels run: sudo make python-dists-${{ matrix.manylinux_arch }} diff --git a/Dockerfile b/Dockerfile index c37efad..15d8536 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=debian:buster +ARG BASE_IMAGE=debian:bookworm FROM $BASE_IMAGE LABEL maintainer="Chris Kuehl " @@ -13,7 +13,6 @@ RUN : \ devscripts \ equivs \ lintian \ - python3-distutils \ python3-setuptools \ python3-pip \ && apt-get clean \ diff --git a/ci/docker-deb-test b/ci/docker-deb-test index cfe2d59..bb6beba 100755 --- a/ci/docker-deb-test +++ b/ci/docker-deb-test @@ -1,6 +1,9 @@ #!/bin/bash -eux set -o pipefail +# Allow pip from modifying the system packages +export PIP_BREAK_SYSTEM_PACKAGES=1 + apt-get update apt-get -y --no-install-recommends install python3-pip procps diff --git a/ci/docker-python-test b/ci/docker-python-test index ecac947..eba892e 100755 --- a/ci/docker-python-test +++ b/ci/docker-python-test @@ -1,6 +1,9 @@ #!/bin/bash -eux set -euo pipefail +# Allow pip from modifying the system packages +export PIP_BREAK_SYSTEM_PACKAGES=1 + cd /mnt python3 setup.py clean From beab2036c289b0a0429df6638926f48cdf090980 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 31 Oct 2025 15:14:42 +0000 Subject: [PATCH 2/7] Add riscv64 deb and wheel packages It is based on Debian Trixie which is the first stable release to support riscv64. --- .github/workflows/ci.yaml | 13 +++++++++---- Makefile | 15 ++++++++++++--- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index f8dda5a..fc78e2c 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,23 +8,28 @@ jobs: matrix: include: - arch: amd64 - manylinux_arch: x86_64 + manylinux_arch: manylinux2014_x86_64 docker_image: debian:bookworm - arch: arm64 - manylinux_arch: aarch64 + manylinux_arch: manylinux2014_aarch64 docker_image: arm64v8/debian:bookworm - arch: ppc64le - manylinux_arch: ppc64le + manylinux_arch: manylinux2014_ppc64le docker_image: ppc64le/debian:bookworm - arch: s390x - manylinux_arch: s390x + manylinux_arch: manylinux2014_s390x docker_image: s390x/debian:bookworm + - arch: riscv64 + manylinux_arch: manylinux_2_39_riscv64 + docker_image: riscv64/debian:trixie + env: BASE_IMAGE: ${{ matrix.docker_image }} + TARGETARCH: ${{ matrix.arch }} steps: - uses: actions/checkout@v2 diff --git a/Makefile b/Makefile index 1ddbb37..8abb9fa 100644 --- a/Makefile +++ b/Makefile @@ -30,15 +30,19 @@ release: python-dists > sha256sums .PHONY: python-dists -python-dists: python-dists-x86_64 python-dists-aarch64 python-dists-ppc64le python-dists-s390x +python-dists: python-dists-manylinux2014_x86_64 python-dists-manylinux2014_aarch64 python-dists-manylinux2014_ppc64le python-dists-manylinux2014_s390x python-dists-manylinux_2_39_riscv64 .PHONY: python-dists-% python-dists-%: VERSION.h python setup.py sdist + if test -f dist/dumb-init-$(VERSION).tar.gz; then \ + mv dist/dumb-init-$(VERSION).tar.gz dist/dumb_init-$(VERSION).tar.gz; \ + fi docker run \ + $(if $(TARGETARCH),--platform linux/$(TARGETARCH)) \ --user $$(id -u):$$(id -g) \ -v `pwd`/dist:/dist:rw \ - quay.io/pypa/manylinux2014_$*:latest \ + quay.io/pypa/$*:latest \ bash -exc ' \ /opt/python/cp38-cp38/bin/pip wheel --wheel-dir /tmp /dist/*.tar.gz && \ auditwheel repair --wheel-dir /dist /tmp/*.whl --wheel-dir /dist \ @@ -61,7 +65,12 @@ builddeb-docker: docker-image .PHONY: docker-image docker-image: - docker build $(if $(BASE_IMAGE),--build-arg BASE_IMAGE=$(BASE_IMAGE)) -t dumb-init-build . + docker buildx build \ + $(if $(TARGETARCH),--platform linux/$(TARGETARCH)) \ + $(if $(BASE_IMAGE),--build-arg BASE_IMAGE=$(BASE_IMAGE)) \ + --load \ + -t dumb-init-build \ + . .PHONY: test test: From e875bbff9053c9594eb59f3d25460773d673a1da Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Fri, 31 Oct 2025 15:22:41 +0000 Subject: [PATCH 3/7] Bump autopep8 pre-commit hook Per [1], pre-commit/mirrors-autopep8 is deprecated in favor of https://github.com/hhatto/autopep8 [1] https://github.com/pre-commit/mirrors-autopep8?tab=readme-ov-file#deprecated --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 49f11e2..aab455f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,8 +14,8 @@ repos: - id: name-tests-test - id: requirements-txt-fixer - id: trailing-whitespace -- repo: https://github.com/pre-commit/mirrors-autopep8 - rev: v2.0.0 +- repo: https://github.com/hhatto/autopep8 + rev: v2.3.2 hooks: - id: autopep8 - repo: https://github.com/pycqa/flake8 From e88f6354778e3de453027ffe3c9c589aae25e207 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 3 Nov 2025 07:10:26 +0000 Subject: [PATCH 4/7] Bump GH runner version `ubuntu-20.04` isn't available anymore. It's safe to use `ubuntu-latest` since all the build steps are executed inside a container anyway so the dependency versions are controlled this way --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index fc78e2c..d1f7198 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -2,7 +2,7 @@ name: CI on: push jobs: build-and-test: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest strategy: fail-fast: false matrix: From fc0a015ada9d7cb2da76e352c1add8ce7020cb05 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 3 Nov 2025 07:15:10 +0000 Subject: [PATCH 5/7] Bump actions/upload-artifact to v4 v2 was deprecated [1] [1] https://github.blog/changelog/2024-02-13-deprecation-notice-v1-and-v2-of-the-artifact-actions/ --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d1f7198..93706a2 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -59,7 +59,7 @@ jobs: run: sudo make python-dists-${{ matrix.manylinux_arch }} - name: Upload build artifacts - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.arch }} path: dist From 06b25375763c3a3a6dd73ab40220c964e7a7def6 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 3 Nov 2025 07:33:45 +0000 Subject: [PATCH 6/7] Compute sha256sums from all dist files Store it in the artifacts for future bookkeeping. --- .github/workflows/ci.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 93706a2..daac162 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -58,6 +58,9 @@ jobs: - name: Build wheels run: sudo make python-dists-${{ matrix.manylinux_arch }} + - name: Compute sha256sums + run: sha256sum dist/* | sudo tee dist/sha256sums + - name: Upload build artifacts uses: actions/upload-artifact@v4 with: From 8eb9f0351d07c5c207330e16c0713bd0180bb039 Mon Sep 17 00:00:00 2001 From: Ludovic Henry Date: Mon, 3 Nov 2025 07:51:31 +0000 Subject: [PATCH 7/7] Remove version pin on pytest-timeout Version pytest-timeout<2.0.0 still depends on distutils which doesn't exist in debian bookworm anymore. --- requirements-dev.txt | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 49f54fd..2dac807 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,6 +1,3 @@ pre-commit>=0.5.0 pytest -# TODO: This pin is to work around an issue where the system pytest is too old. -# We should fix this by not depending on the system pytest/python packages at -# some point. -pytest-timeout<2.0.0 +pytest-timeout