diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f496892ae2..6a7d627f0f8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -43,7 +43,9 @@ jobs: # with the commit diff, because the merge may affect line numbers. ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} - - name: Set up Python ${{ inputs.python-version }} + # installs using setup-python do not work for arm macOS 3.9 and below + - if: ${{ !(inputs.os == 'macos-latest' && contains(fromJSON('["3.7", "3.8", "3.9"]'), inputs.python-version) && inputs.python-architecture == 'x64') }} + name: Set up Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} @@ -51,6 +53,13 @@ jobs: # PyPy can have FFI changes within Python versions, which creates pain in CI check-latest: ${{ startsWith(inputs.python-version, 'pypy') }} + # workaround for the above, only available for 3.9 + - if: ${{ inputs.os == 'macos-latest' && contains(fromJSON('["3.9"]'), inputs.python-version) && inputs.python-architecture == 'x64' }} + name: Set up Python ${{ inputs.python-version }} + uses: astral-sh/setup-uv@v5 + with: + python-version: cpython-${{ inputs.python-version }}-macos-x86-64 + - name: Install nox run: python -m pip install --upgrade pip && pip install nox[uv] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 989f2344c94..fe814d42665 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,17 +146,13 @@ jobs: matrix: rust: [stable] python-version: ["3.13"] - platform: [ + platform: + [ { - os: "macos-latest", # first available arm macos runner + os: "macos-latest", python-architecture: "arm64", rust-target: "aarch64-apple-darwin", }, - { - os: "macos-13", # last available x86_64 macos runner - python-architecture: "x64", - rust-target: "x86_64-apple-darwin", - }, { os: "ubuntu-latest", python-architecture: "x64", @@ -316,7 +312,7 @@ jobs: python-version: "3.13" platform: { - os: "macos-13", + os: "macos-latest", python-architecture: "x64", rust-target: "x86_64-apple-darwin", } @@ -330,32 +326,17 @@ jobs: rust-target: "x86_64-unknown-linux-gnu", } - # arm64 macOS Python not available on GitHub Actions until 3.10 - # so backfill 3.7-3.9 with x64 macOS runners - - rust: stable - python-version: "3.7" - platform: - { - os: "macos-13", - python-architecture: "x64", - rust-target: "x86_64-apple-darwin", - } - - rust: stable - python-version: "3.8" - platform: - { - os: "macos-13", - python-architecture: "x64", - rust-target: "x86_64-apple-darwin", - } - - rust: stable - python-version: "3.9" - platform: - { - os: "macos-13", - python-architecture: "x64", - rust-target: "x86_64-apple-darwin", - } + # arm64 macOS Python not available on GitHub Actions until 3.10, + # and 3.7 & 3.8 not available to install from uv, but can backfill 3.9 with x64 from uv + # FIXME: setup-uv issue prevents this from working, https://github.com/astral-sh/setup-uv/issues/554 + # - rust: stable + # python-version: "3.9" + # platform: + # { + # os: "macos-latest", + # python-architecture: "x64", + # rust-target: "x86_64-apple-darwin", + # } # arm64 Linux runner is in public preview, so test 3.13 on it - rust: stable python-version: "3.13" @@ -618,12 +599,6 @@ jobs: - os: "ubuntu-latest" target: "x86_64-pc-windows-gnu" flags: "-i python3.13 --features generate-import-lib" - # macos x86_64 -> aarch64 - - os: "macos-13" # last x86_64 macos runners - target: "aarch64-apple-darwin" - # macos aarch64 -> x86_64 - - os: "macos-latest" - target: "x86_64-apple-darwin" # windows x86_64 -> aarch64 - os: "windows-latest" target: "aarch64-pc-windows-msvc"