Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -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`.
70 changes: 41 additions & 29 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,56 +10,65 @@ on:
branches:
- main

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@v4
- 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.9, '3.10', '3.11', '3.12', '3.13', '3.14']
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14', '3.15']
notebook: ["01_tools.ipynb", "02_pyramids.ipynb", "03_steerable_pyramids.ipynb"]
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: |
pip install --upgrade --upgrade-strategy eager .
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:
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:
- 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
Expand All @@ -80,27 +89,30 @@ 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@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
run: if [[ -z "$(grep TUTORIALS/${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then
exit 1; fi
no_extra_nblinks:
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: |
Expand All @@ -116,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) }}
22 changes: 14 additions & 8 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ on:
types: [published]
workflow_dispatch:

permissions: {}

jobs:
build-wheels:
name: Make ${{ matrix.os }} wheels
Expand All @@ -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*'
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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 '{}' \;
Expand All @@ -65,9 +71,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/
24 changes: 24 additions & 0 deletions .github/workflows/zizmor.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Loading