From 62d45ba132f6dc60c4a14194d1eff04287da1512 Mon Sep 17 00:00:00 2001 From: odidev Date: Fri, 8 Oct 2021 11:47:06 +0000 Subject: [PATCH 1/3] Build Linux wheels --- .github/workflows/ci.yaml | 4 ++++ Makefile | 43 +++++++++++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index daafc8c..d53a59a 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -21,6 +21,7 @@ jobs: env: BASE_IMAGE: ${{ matrix.docker_image }} + ARCH: ${{ matrix.arch }} steps: - uses: actions/checkout@v2 @@ -46,6 +47,9 @@ jobs: # 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 + - name: Build wheels + run: sudo make python-dists-$ARCH + - name: Upload build artifacts uses: actions/upload-artifact@v2 with: diff --git a/Makefile b/Makefile index f98c97d..601a519 100644 --- a/Makefile +++ b/Makefile @@ -30,17 +30,56 @@ release: python-dists > sha256sums .PHONY: python-dists -python-dists: VERSION.h +python-dists: python-dists-amd64 python-dists-arm64 python-dists-ppc64le python-dists-s390x + +.PHONY: python-dists-amd64 +python-dists-x86_64: VERSION.h python setup.py sdist docker run \ --user $$(id -u):$$(id -g) \ - -v $(PWD)/dist:/dist:rw \ + -v `pwd`/dist:/dist:rw \ quay.io/pypa/manylinux1_x86_64:latest \ bash -exc ' \ /opt/python/cp35-cp35m/bin/pip wheel --wheel-dir /tmp /dist/*.tar.gz && \ auditwheel repair --wheel-dir /dist /tmp/*.whl --wheel-dir /dist \ ' +.PHONY: python-dists-arm64 +python-dists-aarch64: VERSION.h + python setup.py sdist + docker run \ + --user $$(id -u):$$(id -g) \ + -v `pwd`/dist:/dist:rw \ + quay.io/pypa/manylinux2014_aarch64: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 \ + ' + +.PHONY: python-dists-ppc64le +python-dists-ppc64le: VERSION.h + python setup.py sdist + docker run \ + --user $$(id -u):$$(id -g) \ + -v `pwd`/dist:/dist:rw \ + quay.io/pypa/manylinux2014_ppc64le: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 \ + ' + +.PHONY: python-dists-s390x +python-dists-s390x: VERSION.h + python setup.py sdist + docker run \ + --user $$(id -u):$$(id -g) \ + -v `pwd`/dist:/dist:rw \ + quay.io/pypa/manylinux2014_s390x: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 \ + ' + .PHONY: builddeb builddeb: debuild --set-envvar=CC=musl-gcc -us -uc -b From 8c586758af8b464e140fe8d2977bc2587b52adc1 Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Mon, 11 Oct 2021 13:03:08 -0700 Subject: [PATCH 2/3] Fix CI by pinning pytest-timeout down A new version of pytest-timeout was just released which needs a newer pytest than what we have installed from the Debian package. --- requirements-dev.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 2dac807..49f54fd 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,3 +1,6 @@ pre-commit>=0.5.0 pytest -pytest-timeout +# 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 From bcbe11dd9dc26ffb48a1d9f38e6d55c55932121f Mon Sep 17 00:00:00 2001 From: Chris Kuehl Date: Mon, 11 Oct 2021 13:22:01 -0700 Subject: [PATCH 3/3] Use a wildcard makefile target --- .github/workflows/ci.yaml | 7 +++++-- Makefile | 44 ++++----------------------------------- 2 files changed, 9 insertions(+), 42 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index d53a59a..395d2e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -8,20 +8,23 @@ jobs: matrix: include: - arch: amd64 + manylinux_arch: x86_64 docker_image: debian:buster - arch: arm64 + manylinux_arch: aarch64 docker_image: arm64v8/debian:buster - arch: ppc64le + manylinux_arch: ppc64le docker_image: ppc64le/debian:buster - arch: s390x + manylinux_arch: s390x docker_image: s390x/debian:buster env: BASE_IMAGE: ${{ matrix.docker_image }} - ARCH: ${{ matrix.arch }} steps: - uses: actions/checkout@v2 @@ -48,7 +51,7 @@ jobs: run: docker run --rm -v $(pwd):/mnt:rw ${{ matrix.docker_image }} /mnt/ci/docker-deb-test - name: Build wheels - run: sudo make python-dists-$ARCH + run: sudo make python-dists-${{ matrix.manylinux_arch }} - name: Upload build artifacts uses: actions/upload-artifact@v2 diff --git a/Makefile b/Makefile index 601a519..1ddbb37 100644 --- a/Makefile +++ b/Makefile @@ -30,51 +30,15 @@ release: python-dists > sha256sums .PHONY: python-dists -python-dists: python-dists-amd64 python-dists-arm64 python-dists-ppc64le python-dists-s390x +python-dists: python-dists-x86_64 python-dists-aarch64 python-dists-ppc64le python-dists-s390x -.PHONY: python-dists-amd64 -python-dists-x86_64: VERSION.h +.PHONY: python-dists-% +python-dists-%: VERSION.h python setup.py sdist docker run \ --user $$(id -u):$$(id -g) \ -v `pwd`/dist:/dist:rw \ - quay.io/pypa/manylinux1_x86_64:latest \ - bash -exc ' \ - /opt/python/cp35-cp35m/bin/pip wheel --wheel-dir /tmp /dist/*.tar.gz && \ - auditwheel repair --wheel-dir /dist /tmp/*.whl --wheel-dir /dist \ - ' - -.PHONY: python-dists-arm64 -python-dists-aarch64: VERSION.h - python setup.py sdist - docker run \ - --user $$(id -u):$$(id -g) \ - -v `pwd`/dist:/dist:rw \ - quay.io/pypa/manylinux2014_aarch64: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 \ - ' - -.PHONY: python-dists-ppc64le -python-dists-ppc64le: VERSION.h - python setup.py sdist - docker run \ - --user $$(id -u):$$(id -g) \ - -v `pwd`/dist:/dist:rw \ - quay.io/pypa/manylinux2014_ppc64le: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 \ - ' - -.PHONY: python-dists-s390x -python-dists-s390x: VERSION.h - python setup.py sdist - docker run \ - --user $$(id -u):$$(id -g) \ - -v `pwd`/dist:/dist:rw \ - quay.io/pypa/manylinux2014_s390x:latest \ + quay.io/pypa/manylinux2014_$*: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 \