diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 9dec7f23..0e19d159 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -19,10 +19,6 @@ jobs: # Need to quote decimal versions as string to avoid the "Norway problem" # Windows 64-bit - - os: windows-latest - python: '3.9' - cibw_python: 39 - platform_id: win_amd64 - os: windows-latest python: '3.10' cibw_python: 310 @@ -59,25 +55,23 @@ jobs: platform_id: manylinux_x86_64 # macOS on Intel 64-bit - - os: macos-12 - python: '3.9' - cibw_python: 39 - arch: x86_64 - platform_id: macosx_x86_64 - os: macos-12 python: '3.10' cibw_python: 310 arch: x86_64 + macos_target: 10.14 platform_id: macosx_x86_64 - os: macos-12 python: '3.11' cibw_python: 311 arch: x86_64 + macos_target: 10.14 platform_id: macosx_x86_64 - os: macos-12 python: '3.12' cibw_python: 312 arch: x86_64 + macos_target: 10.14 platform_id: macosx_x86_64 # macOS on Apple M1 64-bit, supported for Python 3.10 and later @@ -85,16 +79,19 @@ jobs: python: '3.10' cibw_python: 310 arch: arm64 + macos_target: 11.0 platform_id: macosx_arm64 - os: macos-14 python: '3.11' cibw_python: 311 arch: arm64 + macos_target: 11.0 platform_id: macosx_arm64 - os: macos-14 python: '3.12' cibw_python: 312 arch: arm64 + macos_target: 11.0 platform_id: macosx_arm64 steps: @@ -112,7 +109,17 @@ jobs: if: matrix.platform_id == 'win_amd64' uses: ilammy/msvc-dev-cmd@v1 + # conda to get libpng on Mac that is compatible with more OS versions + # brew install libpng has a mininum OS of 12 + - name: Set up Conda + if: startsWith(matrix.os, 'macos-') + uses: conda-incubator/setup-miniconda@v3 + with: + auto-update-conda: true + python-version: ${{ matrix.python }} + - name: Install cibuildwheel + shell: bash -el {0} run: python -m pip install cibuildwheel==2.19.2 setuptools toml - name: Get package name and version (Linux / Mac) @@ -129,13 +136,14 @@ jobs: echo "PACKAGE_NAME=$( python -c "import toml; print(toml.load('pyproject.toml')['project']['name'])" )" | Out-File -FilePath $env:GITHUB_ENV ` -Append echo "PACKAGE_VERSION=$( python -c "import toml; print(toml.load('pyproject.toml')['project']['version'])" )" | Out-File -FilePath $env:GITHUB_ENV ` -Append - - name: Determine macOS version + # Do this before CIBW steps + - name: Set MacOS deployment target if: startsWith(matrix.os, 'macos-') run: | - macos_version=$(sw_vers -productVersion | awk -F '.' '{print $1".0"}') - echo "MACOSX_DEPLOYMENT_TARGET=${macos_version}" >> $GITHUB_ENV + echo "MACOSX_DEPLOYMENT_TARGET=${{ matrix.macos_target }}" >> $GITHUB_ENV - name: Build wheels + shell: bash -el {0} env: CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014 CIBW_MANYLINUX_I686_IMAGE: manylinux2014 @@ -157,19 +165,17 @@ jobs: CIBW_ARCHS_MACOS: ${{ matrix.arch }} CIBW_ENVIRONMENT_MACOS: | - CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} CMAKE_PREFIX_PATH=/usr/local + CMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} CIBW_BEFORE_ALL_MACOS: | python -m pip install cmake ninja setuptools - brew update - if ! brew list libpng &>/dev/null; then - HOMEBREW_NO_AUTO_UPDATE=1 brew install libpng - fi + conda install libpng run: python -m cibuildwheel --output-dir wheelhouse/cp${{ matrix.cibw_python }}-${{matrix.platform_id }} - name: Install and test (Linux / Mac) if: ${{ ! startsWith(matrix.os, 'windows-') }} + shell: bash -el {0} run: | python -m pip install wheelhouse/cp${{ matrix.cibw_python }}-${{matrix.platform_id }}/*.whl tests/run_tests.sh @@ -219,4 +225,4 @@ jobs: password: ${{ secrets.PYPI_API_TOKEN }} verify_metadata: false skip_existing: true - verbose: true + verbose: true \ No newline at end of file