From 412b59c93a49438663d02a228ce9b9a6390a4e6b Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Sat, 14 Feb 2026 12:46:51 +0000 Subject: [PATCH 1/5] Use `softprops/action-gh-release` instead of archived `eregon/publish-release` --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b5f7bd8..937df71 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -620,8 +620,8 @@ jobs: steps: - name: Finalise release # Publish draft release - uses: eregon/publish-release@01df127f5e9a3c26935118e22e738d95b59d10ce + uses: softprops/action-gh-release@a06a81a03ee405af7f2048a818ed3f03bbf83c7b env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - release_id: ${{ needs.create_release_job.outputs.ID }} + draft: false From 60d91ff4f8da5dab85134330e36325f22765c8dd Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Sun, 15 Feb 2026 18:22:53 +0000 Subject: [PATCH 2/5] Share cache in CI matrix --- .github/workflows/release.yml | 56 +++++++++++++++++++++++++++-------- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 937df71..6f104ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -129,10 +129,19 @@ jobs: body_path: "RELEASE_TEXT.md" draft: true + download_exspy_GOS: + # Use the "reusable workflow" from the hyperspy organisation + uses: hyperspy/.github/.github/workflows/download_exspy_GOS.yml@main + + download_rsciio_test_data: + # Use the "reusable workflow" from the hyperspy organisation + uses: hyperspy/.github/.github/workflows/download_rsciio_test_data.yml@main + with: + VERSION: "release" build: name: ${{ matrix.TARGET_PLATFORM }}-${{ matrix.BLAS_IMPL }} - needs: create_release_job + needs: [create_release_job, download_exspy_GOS, download_rsciio_test_data] runs-on: ${{ matrix.os }}-${{ matrix.os_version }} strategy: fail-fast: false @@ -176,9 +185,22 @@ jobs: TARGET_PLATFORM: osx-arm64 env: DISPLAY: ':0' + RSCIIO_CACHE_POOCH_LABEL: ${{ needs.download_rsciio_test_data.outputs.VERSION }} steps: - uses: actions/checkout@v6 + + - uses: ssciwr/pooch-cache@v1 + with: + name: pooch + fail-on-cache-miss: true + + - uses: ssciwr/pooch-cache@v1 + with: + # to restore the RosettaSciIO test data cache + name: rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }} + fail-on-cache-miss: true + - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -297,19 +319,22 @@ jobs: conda activate "${{ env.install_dir }}" mamba install ${{ env.TEST_DEPS }} - - name: Get rosettasciio tests data location - run: | - conda activate "${{ env.install_dir }}" - python -c "from rsciio.tests import registry; print(f'ROSETTASCIIO_TEST_DATA={str(registry.TESTS_PATH / \"data\") }')" >> $GITHUB_ENV + # Need https://github.com/hyperspy/rosettasciio/pull/482 to be released + # and remove the next step + # - name: Set RSCIIO_TEST_DATA_SOURCE environment variable + # run: | + # # Get the value `RSCIIO_TEST_DATA_SOURCE` from the pooch cache path + # python -c "import pooch; print(f'RSCIIO_TEST_DATA_SOURCE={str(pooch.os_cache(\"rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}\"))}')" >> $GITHUB_ENV - - name: Cache rosettasciio data - uses: actions/cache@v5 - with: - path: ${{ env.ROSETTASCIIO_TEST_DATA }} - key: - RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }} - restore-keys: | - RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }} + - name: Copy RosettaSciIO test data from pooch cache + run: | + # copy the RosettaSciIO test data from the pooch cache to the rsciio/tests/data folder + POOCH_CACHE_DIR=$(python -c "import pooch; print(pooch.os_cache('rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}'))") + RSCIIO_TEST_DATA_DIR=$(python -c "from pathlib import Path; import importlib.util; spec = importlib.util.find_spec('rsciio'); print(Path(spec.origin).parent / 'tests' / 'data')") + echo "Copying test data from ${POOCH_CACHE_DIR} to ${RSCIIO_TEST_DATA_DIR}" + mkdir -p ${RSCIIO_TEST_DATA_DIR} + cp -r ${POOCH_CACHE_DIR} ${RSCIIO_TEST_DATA_DIR} + ls -lR ${RSCIIO_TEST_DATA_DIR}/ - if: always() name: Test new distribution (HyperSpyUI) @@ -419,6 +444,11 @@ jobs: steps: - uses: actions/checkout@v6 + - uses: ssciwr/pooch-cache@v1 + with: + name: pooch + fail-on-cache-miss: true + - name: Cache WinPython data uses: actions/cache@v5 env: From e048f14f61ecd36d4caef3e7ac6265c2b6929885 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 17 Feb 2026 19:17:41 +0000 Subject: [PATCH 3/5] Share cache between jobs --- .github/workflows/release.yml | 46 +++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f104ef..6f37ab1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -190,17 +190,6 @@ jobs: steps: - uses: actions/checkout@v6 - - uses: ssciwr/pooch-cache@v1 - with: - name: pooch - fail-on-cache-miss: true - - - uses: ssciwr/pooch-cache@v1 - with: - # to restore the RosettaSciIO test data cache - name: rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }} - fail-on-cache-miss: true - - uses: conda-incubator/setup-miniconda@v3 with: miniforge-version: latest @@ -319,6 +308,17 @@ jobs: conda activate "${{ env.install_dir }}" mamba install ${{ env.TEST_DEPS }} + - uses: ssciwr/pooch-cache@v1 + with: + name: pooch + fail-on-cache-miss: true + + - uses: ssciwr/pooch-cache@v1 + with: + # to restore the RosettaSciIO test data cache + name: rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }} + fail-on-cache-miss: true + # Need https://github.com/hyperspy/rosettasciio/pull/482 to be released # and remove the next step # - name: Set RSCIIO_TEST_DATA_SOURCE environment variable @@ -328,16 +328,20 @@ jobs: - name: Copy RosettaSciIO test data from pooch cache run: | - # copy the RosettaSciIO test data from the pooch cache to the rsciio/tests/data folder - POOCH_CACHE_DIR=$(python -c "import pooch; print(pooch.os_cache('rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}'))") - RSCIIO_TEST_DATA_DIR=$(python -c "from pathlib import Path; import importlib.util; spec = importlib.util.find_spec('rsciio'); print(Path(spec.origin).parent / 'tests' / 'data')") - echo "Copying test data from ${POOCH_CACHE_DIR} to ${RSCIIO_TEST_DATA_DIR}" - mkdir -p ${RSCIIO_TEST_DATA_DIR} - cp -r ${POOCH_CACHE_DIR} ${RSCIIO_TEST_DATA_DIR} - ls -lR ${RSCIIO_TEST_DATA_DIR}/ - - - if: always() - name: Test new distribution (HyperSpyUI) + conda activate "${{ env.install_dir }}" + python -c " + import importlib.util, os, shutil, sys + from pathlib import Path + import pooch + src = pooch.os_cache('rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}') + dest = Path(importlib.util.find_spec('rsciio').origin).parent / 'tests' / 'data' + print(f'Copying from {src} to {dest}') + shutil.copytree(str(src), str(dest), dirs_exist_ok=True) + print(os.listdir(dest)) + " + + - name: Test new distribution (HyperSpyUI) + if: always() run: | conda activate "${{ env.install_dir }}" # Error on closing figure, not critical From afeff13bd73c76fc4964056e175540d6400d7f24 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 17 Feb 2026 19:50:05 +0000 Subject: [PATCH 4/5] Use share cache in portable distribution job --- .github/workflows/release.yml | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6f37ab1..9bef4c0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -433,13 +433,14 @@ jobs: build_portable: name: windows (Portable) - needs: create_release_job + needs: [create_release_job, download_exspy_GOS, download_rsciio_test_data] runs-on: windows-latest env: WP_URL: https://github.com/winpython/winpython/releases/download/11.2.20241228final/Winpython64-3.12.8.0slim.exe WP_SHA256: c4c59403370e62169bbeba06f140f0da76b2ee5a5a51ebcfdb3d3ad663b2688a WP_EXE: winpython.exe WP_DIR_NAME: WPy64-31280 + RSCIIO_CACHE_POOCH_LABEL: ${{ needs.download_rsciio_test_data.outputs.VERSION }} defaults: run: @@ -538,19 +539,29 @@ jobs: call "${{ env.WP_DIR_NAME }}\scripts\env.bat" python check_hyperspy_latest.py - - name: Get rosettasciio tests data location - run: | - call "${{ env.WP_DIR_NAME }}\scripts\env.bat" - python -c "from rsciio.tests import registry; data_path=str(registry.TESTS_PATH / 'data'); print(f'ROSETTASCIIO_TEST_DATA={data_path}')">> %GITHUB_ENV% + - uses: ssciwr/pooch-cache@v1 + # to restore the pooch cache (e.g. for eXPy GOS data) + with: + name: pooch + fail-on-cache-miss: true - - name: Cache rosettasciio data - uses: actions/cache@v5 + - uses: ssciwr/pooch-cache@v1 + # to restore the RosettaSciIO test data cache with: - path: ${{ env.ROSETTASCIIO_TEST_DATA }} - key: - RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }} - restore-keys: | - RosettaSciIO-test_data-${{ env.ROSETTASCIIO_CACHE_NUMBER }} + name: rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }} + fail-on-cache-miss: true + + # Need https://github.com/hyperspy/rosettasciio/pull/482 to be released + # and remove the next step + # - name: Set RSCIIO_TEST_DATA_SOURCE environment variable + # run: | + # # Get the value `RSCIIO_TEST_DATA_SOURCE` from the pooch cache path + # python -c "import pooch; print(f'RSCIIO_TEST_DATA_SOURCE={str(pooch.os_cache(\"rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}\"))}')" >> $GITHUB_ENV + + - name: Copy RosettaSciIO test data from pooch cache + run: | + call "${{ env.WP_DIR_NAME }}\scripts\env.bat" + python -c "import importlib.util, os, shutil, sys; from pathlib import Path; import pooch; src = pooch.os_cache('rsciio-${{ env.RSCIIO_CACHE_POOCH_LABEL }}'); dest = Path(importlib.util.find_spec('rsciio').origin).parent / 'tests' / 'data'; print(f'Copying from {src} to {dest}'); shutil.copytree(str(src), str(dest), dirs_exist_ok=True); print(os.listdir(dest))" - name: Install testing libraries if: always() From a4b14979ee746d49b377e8d3d6c0af2c3ce7a1d4 Mon Sep 17 00:00:00 2001 From: Eric Prestat Date: Tue, 17 Feb 2026 19:50:41 +0000 Subject: [PATCH 5/5] Tidy up skipping etspy test --- .github/workflows/release.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9bef4c0..cbbe55e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,9 +23,7 @@ env: # are installed in the same environment PYTEST_QT_API: pyqt5 # pytest<9 is workaround for https://github.com/pyxem/pyxem/pull/1175 - # tomli is needed for etspy test_version - # https://github.com/usnistgov/etspy/issues/24 - TEST_DEPS: '"pytest<9" pytest-qt pytest-xdist pytest-rerunfailures pytest-mpl filelock tomli' + TEST_DEPS: '"pytest<9" pytest-qt pytest-xdist pytest-rerunfailures pytest-mpl filelock' CONSTRUCTOR_VERSION: '3.14.0' # Latest version of conda-standalone (from anaconda main) that is built on osx-64 CONDA_STANDALONE: '25.5.1.post1' @@ -418,8 +416,7 @@ jobs: if: always() run: | conda activate "${{ env.install_dir }}" - # https://github.com/usnistgov/etspy/issues/24 - pytest --pyargs etspy -k "not test_version" + pytest --pyargs etspy - name: Upload Release Asset if: startsWith(github.ref, 'refs/tags/') @@ -645,8 +642,7 @@ jobs: # if: always() # run: | # call "${{ env.WP_DIR_NAME }}\scripts\env.bat" - # # https://github.com/usnistgov/etspy/issues/24 - # pytest --pyargs etspy -k "not test_version" + # pytest --pyargs etspy - name: Upload Release Asset if: startsWith(github.ref, 'refs/tags/')