diff --git a/.github/workflows/build_release.yml b/.github/workflows/build_release.yml index 7dcb3ce..f2cfa2c 100644 --- a/.github/workflows/build_release.yml +++ b/.github/workflows/build_release.yml @@ -16,15 +16,19 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-latest, macos-12] + os: [ubuntu-latest, macos-12, macos-14] toolchain: - {compiler: gcc, version: 12} + include: + - os: macos-12 + macosx_deployment_target: "12.0" + - os: macos-14 + macosx_deployment_target: "14.0" steps: - uses: actions/checkout@v4 with: - # Needed for `setuptools-scm` - fetch-depth: 0 + fetch-depth: 0 # needed for versioning with `setuptools-scm` - name: Setup Fortran uses: fortran-lang/setup-fortran@v1 @@ -37,11 +41,12 @@ jobs: - name: Build wheels uses: pypa/cibuildwheel@v2.19 env: - MACOSX_DEPLOYMENT_TARGET: "12.0" + MACOSX_DEPLOYMENT_TARGET: ${{ matrix.macosx_deployment_target }} - name: Upload wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: + name: wheels-${{ matrix.os }} path: wheelhouse/*.whl build_sdist: @@ -49,33 +54,34 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + fetch-depth: 0 # needed for versioning with `setuptools-scm` - name: Build sdist run: pipx run build --sdist - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: + name: tarball path: dist/*.tar.gz upload_pypi: + name: Publish on PyPI needs: [build_wheels, build_sdist] runs-on: ubuntu-latest - # upload to PyPI on every tag starting with 'v' + permissions: + id-token: write # IMPORTANT: this permission is mandatory for trusted publishing + # Upload to PyPI on every tag starting with 'v' if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') - # alternatively, to publish when a GitHub Release is created, use the following rule: + # Alternatively, to publish when a GitHub Release is created, use the following rule: # if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 with: - # unpacks default artifact into dist/ - # if `name: artifact` is omitted, the action will create extra parent dir - name: artifact - path: dist - - - uses: pypa/gh-action-pypi-publish@v1.9.0 + path: dist # put artifacts where next action expects them to be + merge-multiple: true + - uses: pypa/gh-action-pypi-publish@v1.10.1 with: - user: __token__ - password: ${{ secrets.pypi_password }} + skip-existing: true # To test: # repository-url: https://test.pypi.org/legacy/ - # password: ${{ secrets.test_pypi_password }} diff --git a/cibuildwheel/before_build.sh b/cibuildwheel/before_build.sh index 5c28a79..b2f5ed1 100755 --- a/cibuildwheel/before_build.sh +++ b/cibuildwheel/before_build.sh @@ -2,8 +2,8 @@ # # This script should be called by `cibuildwheel` in the `before-build` stage. # -# This script will first install the oldest supported `numpy` to maximize -# portability. Next the Boost Python libraries will be built from source, +# This script will first install the latest `numpy` 1.x version (2.x is not +# supported yet). Next the Boost Python libraries will be built from source, # including the bindings to NumPy. The Boost sources must be in the directory # `${BOOST_BUILD_DIR}/boost`. The libraries will be installed in the directory # `${BOOST_INSTALL_DIR}`. Both environment variables must have been set. @@ -15,10 +15,10 @@ function cleanup rm -rf "${BOOST_INSTALL_DIR}" } -# Install oldest supported numpy +# Install latest numpy 1.x; we do not yet support numpy 2.x function install_numpy { - pip install oldest-supported-numpy + pip install 'numpy<2' } # Build the Boost Python libraries @@ -27,10 +27,11 @@ function build_boost_python nproc=$(python -c 'import multiprocessing as mp; print(mp.cpu_count())') inc_dir=$(python -c 'import sysconfig as sc; print(sc.get_path("include"))') cd "${BOOST_BUILD_DIR}/boost" - ./bootstrap.sh --prefix="${BOOST_INSTALL_DIR}" \ - --with-libraries=python \ - --with-toolset=gcc - ./b2 -j"${nproc}" \ + ./bootstrap.sh \ + --prefix="${BOOST_INSTALL_DIR}" \ + --with-toolset=gcc \ + --with-libraries=python + ./b2 -j"${nproc}" -d0 \ cxxflags="-fPIC -I${inc_dir}" \ link=static,shared \ install diff --git a/pyproject.toml b/pyproject.toml index fa61866..52aaa47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,7 +8,7 @@ requires = [ "cmake>=3.18", "meson", "ninja", - "oldest-supported-numpy", + "numpy<2", "scikit-build>=0.13", "setuptools", "setuptools<65; python_version<'3.12'", @@ -76,10 +76,10 @@ Documentation = "https://pybdsf.readthedocs.io" [tool.cibuildwheel] before-all = "cibuildwheel/before_all.sh" before-build = "cibuildwheel/before_build.sh" -build = "cp3{8,9,10,11,12}-*_x86_64" +build = "cp3{8,9,10,11,12}-*" build-verbosity = 1 environment = """ \ - BOOST_VERSION="1.81.0" \ + BOOST_VERSION="1.85.0" \ BOOST_BUILD_DIR="/tmp/boost-build" \ BOOST_INSTALL_DIR="${HOME}/boost" \ BOOST_ROOT="${BOOST_INSTALL_DIR}" \ @@ -98,7 +98,7 @@ repair-wheel-command = """\ """ [tool.cibuildwheel.linux] -skip = ["*-musllinux_*"] +skip = ["*-musllinux_*", "*_i686"] ###########################