From 73fdde658cdd9fff241f02a4536413c27ef0b2ee Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 10 Jan 2025 09:24:43 +0800 Subject: [PATCH 1/3] Add an option to disable compilation of the binary wheel. --- setup.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index cb0e9c054..9aa82bf91 100644 --- a/setup.py +++ b/setup.py @@ -170,9 +170,11 @@ def build_extension(self, ext): # There are a few reasons we might not be able to compile the C extension. -# Figure out if we should attempt the C extension or not. +# Figure out if we should attempt the C extension or not. Define +# COVERAGE_DISABLE_EXTENSION in the build environment to explicitly disable the +# extension. -compile_extension = True +compile_extension = os.getenv("COVERAGE_DISABLE_EXTENSION", None) is None if "__pypy__" in sys.builtin_module_names: # Pypy can't compile C extensions From d0cce6f33219a03caeca2edecc6866071cd4e0f5 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 10 Jan 2025 09:25:06 +0800 Subject: [PATCH 2/3] Modify sdist workflow to also produce a py3-none-any wheel. --- .github/workflows/kit.yml | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index b9ecbbf57..f7e04e911 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -162,7 +162,7 @@ jobs: run: | python -m pip install -r requirements/kit.pip - - name: "Build wheels" + - name: "Build binary wheels" env: CIBW_BUILD: ${{ matrix.py }}*-* CIBW_ARCHS: ${{ matrix.arch }} @@ -173,7 +173,7 @@ jobs: run: | python -m cibuildwheel --output-dir wheelhouse - - name: "List wheels" + - name: "List binary wheels" run: | ls -al wheelhouse/ @@ -181,15 +181,15 @@ jobs: run: | python -m twine check wheelhouse/* - - name: "Upload wheels" + - name: "Upload binary wheels" uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: name: dist-${{ env.MATRIX_ID }} path: wheelhouse/*.whl retention-days: 7 - sdist: - name: "Source distribution" + non-binary: + name: "Non-binary artifacts" runs-on: ubuntu-latest steps: - name: "Check out the repo" @@ -208,23 +208,25 @@ jobs: run: | python -m pip install -r requirements/kit.pip - - name: "Build sdist" + - name: "Build non-binary artifacts" + env: + COVERAGE_DISABLE_EXTENSION: 1 run: | python -m build - - name: "List sdist" + - name: "List non-binary artifacts" run: | ls -al dist/ - - name: "Check sdist" + - name: "Check non-binary artifacts" run: | python -m twine check dist/* - - name: "Upload sdist" + - name: "Upload non-binary artifacts" uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0 with: - name: dist-sdist - path: dist/*.tar.gz + name: dist-non-binary + path: dist/* retention-days: 7 pypy: From 451839d8c51f93a59f2009e8f9f47361f1f7899e Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 10 Jan 2025 09:48:41 +0800 Subject: [PATCH 3/3] Correct the reference to the non-binary job. --- .github/workflows/kit.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/kit.yml b/.github/workflows/kit.yml index f7e04e911..67fbc3fe2 100644 --- a/.github/workflows/kit.yml +++ b/.github/workflows/kit.yml @@ -279,7 +279,7 @@ jobs: name: "Sign artifacts" needs: - wheels - - sdist + - non-binary - pypy runs-on: ubuntu-latest permissions: