diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index bcd4c11..3c75390 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -20,7 +20,7 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: '3.10' + python-version: '3.13' - name: Setup conda (windows-latest) if: matrix.os == 'windows-latest' @@ -32,9 +32,20 @@ jobs: echo "LIBRARY_DIRS=C:\Miniconda\Library\lib;C:\Miniconda\Library\bin" >> $env:GITHUB_ENV echo "INCLUDE_DIRS=C:\Miniconda\Library\include" >> $env:GITHUB_ENV + - name: Setup libjpeg paths (macos-latest) + if: matrix.os == 'macos-latest' + run: | + echo 'LIBRARY_DIRS=/opt/homebrew/opt/jpeg/lib' >> $GITHUB_ENV + echo 'INCLUDE_DIRS=/opt/homebrew/opt/jpeg/include' >> $GITHUB_ENV + + # See https://github.com/pypa/cibuildwheel/issues/563#issuecomment-2257729524 + - name: Set macOS deployment target + if: matrix.os == 'macos-latest' + run: echo "MACOSX_DEPLOYMENT_TARGET=$(sw_vers -productVersion | cut -d '.' -f 1-2)" >> $GITHUB_ENV + - name: Install cibuildwheel run: | - python -m pip install cibuildwheel==2.13.1 + python -m pip install cibuildwheel==2.22.0 - name: Build wheels run: | python -m cibuildwheel --output-dir dist @@ -46,12 +57,16 @@ jobs: CIBW_ARCHS_WINDOWS: 'AMD64' # restrict to 64bit builds # (mac-os) Install hdf4 from sources CIBW_BEFORE_ALL_MACOS: > - brew install ninja && + brew install ninja jpeg && + export PATH="/opt/homebrew/opt/jpeg/bin:$PATH" && + export LDFLAGS="-L/opt/homebrew/opt/jpeg/lib" && + export CPPFLAGS="-I/opt/homebrew/opt/jpeg/include" && + export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig" && cd /tmp && - git clone --depth 1 --branch hdf-4_2_16 https://github.com/HDFGroup/hdf4.git && + git clone --depth 1 --branch hdf4.3.0 https://github.com/HDFGroup/hdf4.git && mkdir build && cd build && ../hdf4/configure --enable-hdf4-xdr --enable-shared --disable-static --disable-fortran --disable-netcdf --enable-production --with-zlib --prefix=/usr/local && - make install + sudo make install CIBW_BEFORE_ALL_WINDOWS: > conda config --set always_yes yes --set changeps1 no --set auto_update_conda no --set safety_checks disabled && conda install -q hdf4 @@ -59,9 +74,9 @@ jobs: run: | mkdir wheelhouse cp dist/*.whl wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: wheelhouse + name: wheelhouse-${{ matrix.os }} path: wheelhouse publish: @@ -82,9 +97,9 @@ jobs: python -m pip install build python -m build --sdist -o wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: - name: wheelhouse + name: wheelhouse-sdist path: wheelhouse - name: Publish SDIST to PyPI # there are some problems if sdist is not pushed first @@ -96,10 +111,11 @@ jobs: packages_dir: wheelhouse/ - name: Download all the wheels - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 with: - name: wheelhouse path: ./wheelhouse/ + pattern: wheelhouse-* + merge-multiple: true - name: Publish a Python distribution to Test PyPI uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3b21de..dc2b69f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -15,7 +15,7 @@ jobs: fail-fast: true matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python: ["3.8", "3.9", "3.10", "3.x"] + python: ["3.9", "3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v3 @@ -28,12 +28,19 @@ jobs: - name: Install libhdf4-dev (macos-latest) if: matrix.os == 'macos-latest' run: | - brew install ninja && + brew install ninja jpeg + export PATH="/opt/homebrew/opt/jpeg/bin:$PATH" + export LDFLAGS="-L/opt/homebrew/opt/jpeg/lib" + export CPPFLAGS="-I/opt/homebrew/opt/jpeg/include" + export PKG_CONFIG_PATH="/opt/homebrew/opt/jpeg/lib/pkgconfig" + echo 'LIBRARY_DIRS=/opt/homebrew/opt/jpeg/lib' >> $GITHUB_ENV + echo 'INCLUDE_DIRS=/opt/homebrew/opt/jpeg/include' >> $GITHUB_ENV + cd /tmp && - git clone --depth 1 --branch hdf-4_2_16 https://github.com/HDFGroup/hdf4.git && + git clone --depth 1 --branch hdf4.3.0 https://github.com/HDFGroup/hdf4.git && mkdir build && cd build && ../hdf4/configure --enable-hdf4-xdr --enable-shared --disable-static --disable-fortran --disable-netcdf --enable-java --enable-production --with-zlib --prefix=/usr/local && - make install + sudo make install - name: Install libhdf4-dev (ubuntu-latest) if: matrix.os == 'ubuntu-latest' @@ -53,6 +60,8 @@ jobs: - name: Install requirements run: | + echo LIBRARY_DIRS is $LIBRARY_DIRS + echo INCLUDE_DIRS is $INCLUDE_DIRS python -m pip install -U pip python -m pip install numpy pytest