From 1ee4ef98ca77d8e7119cf5f5b688f1b5dd107088 Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 18:31:00 -0500 Subject: [PATCH 01/11] .github/workflows/tests.yml: install libjpeg in macOS --- .github/workflows/tests.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e3b21de..f1d047f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -28,9 +28,14 @@ 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" + 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 From 31e97202051454800dee6442b74a64f8be84525d Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 18:52:12 -0500 Subject: [PATCH 02/11] .github/workflows/tests.yml: add sudo to hdf4 install in macOS --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index f1d047f..2ba2d67 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,7 +38,7 @@ jobs: 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' From 4569fc18e7e68831d0304d20a85ce05dda406d73 Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:06:40 -0500 Subject: [PATCH 03/11] .github/workflows/tests.yml: set libjpeg directories for pyhdf ext in macOS --- .github/workflows/tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2ba2d67..65a8fc6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -33,6 +33,8 @@ jobs: 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 hdf4.3.0 https://github.com/HDFGroup/hdf4.git && @@ -58,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 From 27c0b97050e9d155228fbd8ee5c56198078427a0 Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:12:38 -0500 Subject: [PATCH 04/11] .github/workflows/tests.yml: update python versions --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 65a8fc6..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 From 3be61441af89de1e2f0b8f44710b83e996a2d74a Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:16:39 -0500 Subject: [PATCH 05/11] .github/workflows/package_and_publish.yml: update deprecated upload-artifact action --- .github/workflows/package_and_publish.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index bcd4c11..d9919df 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -59,7 +59,7 @@ jobs: run: | mkdir wheelhouse cp dist/*.whl wheelhouse - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v4 with: name: wheelhouse path: wheelhouse @@ -82,7 +82,7 @@ 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 path: wheelhouse From 5e9136f497b384f0d2155b12a4fef536e601695a Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:20:22 -0500 Subject: [PATCH 06/11] .github/workflows/package_and_publish.yml: update cibuildwheel --- .github/workflows/package_and_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index d9919df..8a33b86 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -34,7 +34,7 @@ jobs: - 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 From 18f1dc2487771d989f3dcf2f0efcabf3f19c6e7b Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:27:07 -0500 Subject: [PATCH 07/11] .github/workflows/package_and_publish.yml: install libjpeg in macOS --- .github/workflows/package_and_publish.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index 8a33b86..6f04b2d 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -46,12 +46,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 From 71a6524e0d812bbb774eefc4b3b216ebff5aad8b Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 19:36:08 -0500 Subject: [PATCH 08/11] .github/workflows/package_and_publish.yml: setup libjpeg paths on macOS --- .github/workflows/package_and_publish.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index 6f04b2d..720b3be 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -32,6 +32,12 @@ 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 + - name: Install cibuildwheel run: | python -m pip install cibuildwheel==2.22.0 From d76797b7bb09e2a2e5b8ce07c49b2c08ce825b0e Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 20:06:30 -0500 Subject: [PATCH 09/11] .github/workflows/package_and_publish.yml: set macOS deployment target --- .github/workflows/package_and_publish.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index 720b3be..8c5ecce 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -38,6 +38,11 @@ jobs: 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.22.0 From 80a673ebeea2148ebde3180ee9f3620ee407eece Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 20:46:03 -0500 Subject: [PATCH 10/11] .github/workflows/package_and_publish.yml: fix artifact name conflict --- .github/workflows/package_and_publish.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index 8c5ecce..523367c 100644 --- a/.github/workflows/package_and_publish.yml +++ b/.github/workflows/package_and_publish.yml @@ -76,7 +76,7 @@ jobs: cp dist/*.whl wheelhouse - uses: actions/upload-artifact@v4 with: - name: wheelhouse + name: wheelhouse-${{ matrix.os }} path: wheelhouse publish: @@ -99,7 +99,7 @@ jobs: - 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 @@ -111,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 From 64be728cbb46e60fdc3a142c706375ea713391a1 Mon Sep 17 00:00:00 2001 From: Fazlul Shahriar Date: Sat, 4 Jan 2025 21:11:01 -0500 Subject: [PATCH 11/11] .github/workflows/package_and_publish.yml: use python 3.13 instead of 3.10 --- .github/workflows/package_and_publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/package_and_publish.yml b/.github/workflows/package_and_publish.yml index 523367c..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'