From c83d95dd45ba995df2a1b3d68fcf3ca2f882d37b Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 11:55:42 -0500 Subject: [PATCH 1/6] drop python 3.9, add python 3.15 to tests and all --- .github/workflows/ci.yml | 4 ++-- README.md | 2 +- docs/index.rst | 2 +- pyproject.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cbf2da2..55b6d72 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -27,7 +27,7 @@ jobs: needs: [get_notebooks] strategy: matrix: - python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}} fail-fast: false name: Execute notebooks @@ -53,7 +53,7 @@ jobs: strategy: matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.9, '3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] fail-fast: false name: Run tests steps: diff --git a/README.md b/README.md index 03047ad..aaacc69 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ [![PyPI Version](https://img.shields.io/pypi/v/pyrtools.svg)](https://pypi.org/project/pyrtools/) [![Anaconda-Server Badge](https://anaconda.org/conda-forge/pyrtools/badges/version.svg)](https://anaconda.org/conda-forge/pyrtools) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE) -![Python version](https://img.shields.io/badge/python-3.9|3.10|3.11|3.12|3.13|3.14-blue.svg) +![Python version](https://img.shields.io/badge/python-3.10|3.11|3.12|3.13|3.14|3.15-blue.svg) [![Build Status](https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg)](https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild) [![Documentation Status](https://readthedocs.org/projects/pyrtools/badge/?version=latest)](https://pyrtools.readthedocs.io/en/latest/?badge=latest) [![DOI](https://zenodo.org/badge/137527035.svg)](https://zenodo.org/doi/10.5281/zenodo.10161031) diff --git a/docs/index.rst b/docs/index.rst index d05587b..a8f113e 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -7,7 +7,7 @@ .. |license-shield| image:: https://img.shields.io/badge/license-MIT-yellow.svg :target: https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE -.. |python-version-shield| image:: https://img.shields.io/badge/python-3.9%7C3.10%7C3.11%7C3.12%7C3.13%7C3.14-blue.svg +.. |python-version-shield| image:: https://img.shields.io/badge/python-3.10%7C3.11%7C3.12%7C3.13%7C3.14%7C3.15-blue.svg .. |build| image:: https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg :target: https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild diff --git a/pyproject.toml b/pyproject.toml index d469b17..d050e3c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ authors = [{name="Pyrtools authors"}] description = "Python tools for multi-scale image processing, including Laplacian pyramids, Wavelets, and Steerable Pyramids." readme = "README.md" license = "MIT" -requires-python = ">=3.9" +requires-python = ">=3.10" classifiers = [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 3", From 180840bedf99ae3e48af784f6ab7099523e15472 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 12:21:29 -0500 Subject: [PATCH 2/6] update pypi publish version --- .github/workflows/deploy.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index addadae..44dadb1 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -65,9 +65,9 @@ jobs: find . -name '*.whl' -exec mv '{}' dist/ \; - name: Publish package to test pypi if: github.event_name == 'release' && github.event.action == 'published' - uses: pypa/gh-action-pypi-publish@v1.13.0 + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 - name: Publish package to test pypi if: github.event_name != 'release' - uses: pypa/gh-action-pypi-publish@v1.13.0 + uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3 with: repository-url: https://test.pypi.org/legacy/ From 57d3ab5361adee639921bfe1a203500e91c0814b Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 13:08:01 -0500 Subject: [PATCH 3/6] adds zizmor, fix GHA issues --- .github/workflows/ci.yml | 45 ++++++++++++++++++++++++++++-------- .github/workflows/deploy.yml | 18 ++++++++++----- .github/workflows/zizmor.yml | 24 +++++++++++++++++++ 3 files changed, 72 insertions(+), 15 deletions(-) create mode 100644 .github/workflows/zizmor.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 55b6d72..0e422b3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,6 +10,8 @@ on: branches: - main +permissions: {} + jobs: # based on https://slashgear.github.io/how-to-split-test-by-folder-with-github-action/ get_notebooks: @@ -17,7 +19,9 @@ jobs: outputs: notebook: ${{ steps.get-notebooks.outputs.nb }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - id: get-notebooks # it's weird to me, but the quotes around \n should *not* be escaped or it breaks run: "echo \"nb=$(ls TUTORIALS/*ipynb | jq -R -s -c 'split(\"\\n\")[:-1]')\"\ @@ -32,14 +36,31 @@ jobs: fail-fast: false name: Execute notebooks steps: - - uses: actions/checkout@v4 - - uses: actions/setup-python@v5 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 with: python-version: ${{ matrix.python-version }} cache: pip cache-dependency-path: setup.py - - name: Setup FFmpeg - uses: FedericoCarboni/setup-ffmpeg@v3.1 + - name: Load cached FFmpeg + id: cache-ffmpeg + uses: actions/cache@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3 + with: + path: | + /usr/local/bin/ffmpeg + /usr/local/bin/ffprobe + key: ${{ runner.os }}-ffmpeg-5.1.1 + - name: Install FFmpeg if not cached + if: steps.cache-ffmpeg.outputs.cache-hit != 'true' + run: | + VERSION=6.0.1 + RELEASE_NAME=ffmpeg-${VERSION}-amd64-static + wget --timeout=8 --tries=30 https://www.johnvansickle.com/ffmpeg/old-releases/${RELEASE_NAME}.tar.xz + tar -xf ${RELEASE_NAME}.tar.xz + mv ${RELEASE_NAME}/ffmpeg ${RELEASE_NAME}/ffprobe /usr/local/bin/ + rm -rf ${RELEASE_NAME} - name: Install dependencies # nbclient 0.5.5 is the first version that includes jupyter execute run: | @@ -57,9 +78,11 @@ jobs: fail-fast: false name: Run tests steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Install Python 3 - uses: actions/setup-python@v5 + uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 with: python-version: ${{ matrix.python-version }} cache: pip @@ -91,7 +114,9 @@ jobs: matrix: notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Check for file shell: bash run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then @@ -100,7 +125,9 @@ jobs: runs-on: ubuntu-latest name: Check that we don't have any extra nblink files steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Check same number of nblink and notebooks shell: bash run: | diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 44dadb1..467156a 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -4,6 +4,8 @@ on: types: [published] workflow_dispatch: +permissions: {} + jobs: build-wheels: name: Make ${{ matrix.os }} wheels @@ -14,10 +16,12 @@ jobs: fail-fast: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - name: Build wheels - uses: pypa/cibuildwheel@v4.2.0 + uses: pypa/cibuildwheel@f9b966cfadf4109556cadc5bb39ddb72d0ce664e # v4.3.5 env: CIBW_BUILD: cp39-* cp310-* cp311-* cp312-* cp313-* cp314-* CIBW_SKIP: '*musllinux*' @@ -29,7 +33,7 @@ jobs: CIBW_ARCHS_MACOS: x86_64 arm64 - name: Upload wheel as artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: artifact-${{ matrix.os }}-wheel path: ./**/*.whl @@ -38,11 +42,13 @@ jobs: name: Make source distribution runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false - run: pipx run build --sdist - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: artifact-source-dist path: ./**/dist/*.tar.gz @@ -56,7 +62,7 @@ jobs: id-token: write # IMPORTANT: this permission is mandatory for trusted publishing steps: - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@70fc10c6e5e1ce46ad2ea6f2b72d43f7d47b13c3 # v8.0.0 - name: Copy artifacts to dist/ folder run: | find . -name 'artifact-*' -exec unzip '{}' \; diff --git a/.github/workflows/zizmor.yml b/.github/workflows/zizmor.yml new file mode 100644 index 0000000..18166eb --- /dev/null +++ b/.github/workflows/zizmor.yml @@ -0,0 +1,24 @@ +name: GitHub Actions Security Analysis with zizmor 🌈 + +on: + push: + branches: ["main"] + pull_request: + branches: ["**"] + +permissions: {} + +jobs: + zizmor: + name: Run zizmor 🌈 + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + with: + persist-credentials: false + - name: Run zizmor 🌈 + uses: zizmorcore/zizmor-action@0dce2577a4760a2749d8cfb7a84b7d5585ebcb7d # v0.5.0 + with: + advanced-security: false + inputs: .github/workflows From 2ae1390e5d4dc8bceb47011ae2f89c7791012a41 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 14:05:23 -0500 Subject: [PATCH 4/6] fix action file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e422b3..ff35231 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -39,7 +39,7 @@ jobs: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: persist-credentials: false - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 + - uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 #v6.2.0 with: python-version: ${{ matrix.python-version }} cache: pip From 96b3cb404087e2d489459d404e54746d6f059c54 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 14:20:17 -0500 Subject: [PATCH 5/6] remove unsafe way of getting notebooks --- .github/workflows/ci.yml | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff35231..d8111f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -13,26 +13,12 @@ on: permissions: {} jobs: - # based on https://slashgear.github.io/how-to-split-test-by-folder-with-github-action/ - get_notebooks: - runs-on: ubuntu-latest - outputs: - notebook: ${{ steps.get-notebooks.outputs.nb }} - steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - with: - persist-credentials: false - - id: get-notebooks - # it's weird to me, but the quotes around \n should *not* be escaped or it breaks - run: "echo \"nb=$(ls TUTORIALS/*ipynb | jq -R -s -c 'split(\"\\n\")[:-1]')\"\ - \ >> $GITHUB_OUTPUT\n" notebooks: runs-on: ubuntu-latest - needs: [get_notebooks] strategy: matrix: python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15'] - notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}} + notebook: ["01_tools.ipynb", "02_pyramids.ipynb", "03_steerable_pyramids.ipynb"] fail-fast: false name: Execute notebooks steps: @@ -103,16 +89,15 @@ jobs: # generate the xml file and move it to root dir for codecov coverage xml -o ../coverage.xml - name: Upload coverage to Codecov - uses: codecov/codecov-action@a079530fc142d3d288ddf76321ca0b7fe5b18df5 # v4.4.1 + uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: token: ${{ secrets.CODECOV_TOKEN }} all_tutorials_in_docs: runs-on: ubuntu-latest name: Check that all tutorial notebooks are included in docs - needs: [get_notebooks] strategy: matrix: - notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}} + notebook: ["01_tools.ipynb", "02_pyramids.ipynb", "03_steerable_pyramids.ipynb"] steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 with: @@ -143,6 +128,6 @@ jobs: runs-on: ubuntu-latest steps: - name: Decide whether all tests and notebooks succeeded - uses: re-actors/alls-green@afee1c1eac2a506084c274e9c02c8e0687b48d9e # v1.2.2 + uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2 with: jobs: ${{ toJSON(needs) }} From b2baf0eb8aeb0bc5555fe84ae982561e7d679a02 Mon Sep 17 00:00:00 2001 From: "William F. Broderick" Date: Mon, 9 Nov 2026 14:22:37 -0500 Subject: [PATCH 6/6] adds pr template, update ci --- .github/pull_request_template.md | 36 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 4 ++-- 2 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..dcdcfb6 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,36 @@ +**Describe the change in this PR at a high-level** + +e.g., +> This PR adds a new model, originally published in [CITATION], which ... + +**Link any related issues, discussions, PRs** + +Include links to any related issues, discussion or PRs using GitHub's `#` syntax. e.g., + +> This closes issue #350 + +**Outstanding questions / particular feedback** + +List any questions you would like input on or parts of the PR you want reviewers to pay particular attention to, e.g., + +> - I think this can be made more efficient, any ideas? +> - Not sure if my tests make sense, make sure to check them out. + +**Describe changes** + +In a list, describe the changes you made. This should be more granular than the description at the beginning of the PR. These descriptions can be short, but this would also be the place to describe why something seemingly unrelated was included. e.g., + +> - added tests of new model +> - added docs describing new model +> - updated old tests for new API +> - small change to synthesis to be compatible with new API +> - while implementing this, a new version of torch was released, which required a small update to perceptual_distance.py + +**Checklist** + +Affirm that you have done the following: + +- [ ] I have described the changes in this PR, following the template above. +- [ ] I have added any necessary tests. +- [ ] I have added any necessary documentation. This includes docstrings, updates to existing files found in `docs/`, or (for large changes) adding new files to the `docs/` folder. +- [ ] If a new notebook was added: I have added the name of the new notebook to the matrix.notebook variable in `.github/workflows/ci.yml`. diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d8111f0..e0b3fb1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -54,7 +54,7 @@ jobs: pip install jupyter ipywidgets pip install "nbclient>=0.5.5" - name: Run notebooks - run: jupyter execute ${{ matrix.notebook }} --kernel_name=python3 + run: jupyter execute TUTORIALS/${{ matrix.notebook }} --kernel_name=python3 tests: runs-on: ${{matrix.os}} strategy: @@ -104,7 +104,7 @@ jobs: persist-credentials: false - name: Check for file shell: bash - run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then + run: if [[ -z "$(grep TUTORIALS/${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then exit 1; fi no_extra_nblinks: runs-on: ubuntu-latest