From 2bec3f005c669034e363c64d7d33dfe9d788e6ea Mon Sep 17 00:00:00 2001 From: Zhang Yunjun Date: Wed, 21 Jan 2026 13:08:53 +0800 Subject: [PATCH 1/3] build-n-publish-2-pypi: update gfortran provider for macOS + update macOS from 13 to 15 + use gfortran installed from homebrew. Another option is https://github.com/numpy/numpy/pull/26812/files --- .github/workflows/build-and-publish-to-pypi.yml | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-publish-to-pypi.yml b/.github/workflows/build-and-publish-to-pypi.yml index 345c939..fbec77e 100644 --- a/.github/workflows/build-and-publish-to-pypi.yml +++ b/.github/workflows/build-and-publish-to-pypi.yml @@ -17,24 +17,21 @@ jobs: fail-fast: false matrix: # skip building wheel for windows as it's not working yet - os: [ubuntu-latest, macos-13] #windows-2019 + os: [ubuntu-latest, macos-15] #windows-2019 steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Provide gfortran (macOS-13) + - name: Symlink gfortran (macOS) if: runner.os == 'macOS' run: | - # https://github.com/actions/virtual-environments/issues/2524 - # https://github.com/cbg-ethz/dce/blob/master/.github/workflows/pkgdown.yaml - sudo ln -s /usr/local/bin/gfortran-13 /usr/local/bin/gfortran - sudo mkdir /usr/local/gfortran - sudo ln -s /usr/local/Cellar/gcc@13/*/lib/gcc/13 /usr/local/gfortran/lib + brew install gcc + ln -sf $(brew --prefix)/bin/gfortran-15 /usr/local/bin/gfortran gfortran --version - - name: Provide gfortran (Windows) + - name: Symlink gfortran (Windows) if: runner.os == 'Windows' uses: msys2/setup-msys2@v2 @@ -48,7 +45,7 @@ jobs: env: # Disable building for PyPy and 32bit. CIBW_SKIP: pp* *-win32 *-manylinux_i686 - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="13.0" + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="15.0" CIBW_BEFORE_BUILD_MACOS: python -m pip install --upgrade pip # Package the DLL dependencies in the wheel for windows (done by default for the other platforms). # delvewheel cannot mangle the libraries, stripping does not work. From 48c33f327b1997f575577aeec59d98fa2b7429c1 Mon Sep 17 00:00:00 2001 From: Zhang Yunjun Date: Thu, 22 Jan 2026 00:32:24 +0800 Subject: [PATCH 2/3] sourcery ai suggestions + lower the MACOSX_DEPLOYMENT_TARGET version for better compatiability + use macos-latest instead of macos-15 for easier maintainence + grab gfortran version dynamically for easier maintainence --- .github/workflows/build-and-publish-to-pypi.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-publish-to-pypi.yml b/.github/workflows/build-and-publish-to-pypi.yml index fbec77e..890a304 100644 --- a/.github/workflows/build-and-publish-to-pypi.yml +++ b/.github/workflows/build-and-publish-to-pypi.yml @@ -17,7 +17,7 @@ jobs: fail-fast: false matrix: # skip building wheel for windows as it's not working yet - os: [ubuntu-latest, macos-15] #windows-2019 + os: [ubuntu-latest, macos-latest] #windows-2019 steps: - uses: actions/checkout@v4 @@ -28,7 +28,8 @@ jobs: if: runner.os == 'macOS' run: | brew install gcc - ln -sf $(brew --prefix)/bin/gfortran-15 /usr/local/bin/gfortran + fc_files=( $(brew --prefix)/bin/gfortran-* ) + sudo ln -sf "${fc_files[@]: -1}" /usr/local/bin/gfortran gfortran --version - name: Symlink gfortran (Windows) @@ -45,7 +46,7 @@ jobs: env: # Disable building for PyPy and 32bit. CIBW_SKIP: pp* *-win32 *-manylinux_i686 - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="15.0" + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="14.0" CIBW_BEFORE_BUILD_MACOS: python -m pip install --upgrade pip # Package the DLL dependencies in the wheel for windows (done by default for the other platforms). # delvewheel cannot mangle the libraries, stripping does not work. From 2ecb2146f1378176ddb749f14cb64571e822a6e4 Mon Sep 17 00:00:00 2001 From: Zhang Yunjun Date: Thu, 22 Jan 2026 00:33:59 +0800 Subject: [PATCH 3/3] Update build-and-publish-to-pypi.yml --- .github/workflows/build-and-publish-to-pypi.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-publish-to-pypi.yml b/.github/workflows/build-and-publish-to-pypi.yml index 890a304..1711090 100644 --- a/.github/workflows/build-and-publish-to-pypi.yml +++ b/.github/workflows/build-and-publish-to-pypi.yml @@ -46,7 +46,7 @@ jobs: env: # Disable building for PyPy and 32bit. CIBW_SKIP: pp* *-win32 *-manylinux_i686 - CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="14.0" + CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET="15.0" CIBW_BEFORE_BUILD_MACOS: python -m pip install --upgrade pip # Package the DLL dependencies in the wheel for windows (done by default for the other platforms). # delvewheel cannot mangle the libraries, stripping does not work.