From 464354c588c8b87fe273c00838fd077071110d6b Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Wed, 19 Jun 2024 15:14:12 +0100 Subject: [PATCH] Switch to using the cibuildwheel action and cleanup directory between builds The build directory appears to be left intact between builds for the different cpython versions. Lets ensure everything is done correctly by deleting the build directory to force a complete rebuild. --- .github/workflows/build.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c23c64d..1dee63c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -39,6 +39,7 @@ jobs: python-version: '3.12' - name: Build wheels + uses: pypa/cibuildwheel@v2.19.1 env: CIBW_BUILD: "cp3*" CIBW_SKIP: "*-win32 *-manylinux_i686 *-musllinux_*" @@ -47,13 +48,13 @@ jobs: CIBW_TEST_COMMAND: "pytest {project}/tests" # Skip testing on arm64 Python 3.8 because it uses the x86_64 executable, not the arm executable CIBW_TEST_SKIP: "cp38-macosx_*:arm64" + # Clean the build directory between builds + CIBW_BEFORE_BUILD: >- + rm -rf {package}/build CIBW_ENVIRONMENT_LINUX: CMAKE_GENERATOR="Unix Makefiles" CIBW_ENVIRONMENT_MACOS: CMAKE_GENERATOR="Unix Makefiles" CMAKE_OSX_ARCHITECTURES=${{ matrix.osx_arch }} CIBW_ENVIRONMENT_WINDOWS: CMAKE_GENERATOR="Visual Studio 17 2022" CMAKE_GENERATOR_PLATFORM=x64 CIBW_BUILD_VERBOSITY: 1 - run: | - python -m pip install cibuildwheel build - python -m cibuildwheel --output-dir wheelhouse - name: Build source if: startsWith(matrix.os, 'ubuntu') @@ -74,6 +75,7 @@ jobs: with: name: wheels-${{ matrix.os }} path: ./wheelhouse + if-no-files-found: error merge_artifacts: name: Merge wheel artifacts from build_wheels OS matrix jobs