Skip to content

Commit

Permalink
Merge pull request #33 from LabForComputationalVision/mac_failing_test
Browse files Browse the repository at this point in the history
Fix failing tests/notebooks by updating action versions
  • Loading branch information
billbrod authored May 29, 2024
2 parents 5582f77 + ff5def4 commit 6ec6e0b
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If applicable, add screenshots to help explain your problem.

**System (please complete the following information):**
- OS: [e.g. Mac (with version), Ubuntu 18.04]
- Python version [e.g. 3.7]
- Python version [e.g. 3.11]
- Pyrtools version [e.g. 1.0.1]

**Additional context**
Expand Down
26 changes: 14 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
outputs:
notebook: ${{ steps.get-notebooks.outputs.nb }}
steps:
- uses: actions/checkout@v3
- 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]')\"\
Expand All @@ -27,39 +27,39 @@ jobs:
needs: [get_notebooks]
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
fail-fast: false
name: Execute notebooks
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: setup.py
- name: Setup FFmpeg
uses: FedericoCarboni/setup-ffmpeg@v2
uses: FedericoCarboni/setup-ffmpeg@v3.1
- 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 }}.ipynb --kernel_name=python3
run: jupyter execute ${{ matrix.notebook }} --kernel_name=python3
tests:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: [3.7, 3.8, 3.9, '3.10']
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
fail-fast: false
name: Run tests
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Install Python 3
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
Expand All @@ -80,7 +80,9 @@ 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@858dd794fbb81941b6d60b0dca860878cba60fa9 # v3.1.1
uses: codecov/codecov-action@a079530fc142d3d288ddf76321ca0b7fe5b18df5 # v4.4.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
all_tutorials_in_docs:
runs-on: ubuntu-latest
name: Check that all tutorial notebooks are included in docs
Expand All @@ -89,7 +91,7 @@ jobs:
matrix:
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check for file
shell: bash
run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then
Expand All @@ -98,7 +100,7 @@ jobs:
runs-on: ubuntu-latest
name: Check that we don't have any extra nblink files
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Check same number of nblink and notebooks
shell: bash
run: |
Expand Down
66 changes: 33 additions & 33 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,60 +10,60 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
os: [macos-latest, ubuntu-latest, windows-latest]
fail-fast: false

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: "Build wheels"
uses: pypa/cibuildwheel@v2.8.1
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
CIBW_SKIP: "*musllinux*"
CIBW_ARCHS: native
CIBW_BUILD_FRONTEND: build
CIBW_TEST_COMMAND: "python {project}/TESTS/unitTests.py"
- name: Build wheels
uses: pypa/cibuildwheel@357b80c11e6e995e6297e86386460ae84cbc5bee # v2.18.1
env:
CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
CIBW_BUILD: cp37-* cp38-* cp39-* cp310-*
CIBW_SKIP: '*musllinux*'
CIBW_ARCHS: native
CIBW_BUILD_FRONTEND: build
CIBW_TEST_COMMAND: python {project}/TESTS/unitTests.py
# cross-compilation for Apple Silicon:
# https://cibuildwheel.readthedocs.io/en/stable/faq/#how-to-cross-compile
CIBW_ARCHS_MACOS: x86_64 arm64
CIBW_ARCHS_MACOS: x86_64 arm64

- name: "Upload wheel as artifact"
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-wheel
path: "./**/*.whl"
- name: Upload wheel as artifact
uses: actions/upload-artifact@v4
with:
name: artifact-${{ matrix.os }}-wheel
path: ./**/*.whl

build-sdist:
name: Make source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: artifact-source-dist
path: "./**/dist/*.tar.gz"
path: ./**/dist/*.tar.gz

deploy:
needs: [build-wheels, build-sdist]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/checkout@v3
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Copy artifacts to dist/ folder
run: |
find . -name 'artifact-*' -exec unzip '{}' \;
mkdir -p dist/
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
find . -name '*.whl' -exec mv '{}' dist/ \;
- name: Publish package to test pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
- name: Copy artifacts to dist/ folder
run: |
find . -name 'artifact-*' -exec unzip '{}' \;
mkdir -p dist/
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
find . -name '*.whl' -exec mv '{}' dist/ \;
- name: Publish package to test pypi
uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![PyPI Version](https://img.shields.io/pypi/v/pyrtools.svg)](https://pypi.org/project/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.7|3.8|3.9|3.10-blue.svg)
![Python version](https://img.shields.io/badge/python-3.8|3.9|3.10|3.11|3.12-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
8 changes: 4 additions & 4 deletions TESTS/unitTests.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ def test1(self):
#foo = pointOp(200, 200, img, 5, filt, 0, 1, 0);
foo = pt.pointOp(img, filt, 0, 1);
foo = np.reshape(foo,(200,200))
self.assertTrue((matImg['foo'] == foo).all())
np.testing.assert_allclose(matImg['foo'], foo)

class maxPyrHeightTests(unittest.TestCase):
def test1(self):
Expand Down Expand Up @@ -336,7 +336,7 @@ def test7(self):
img = plt.imread(op.join(test_data_path, 'lenna-256x256.tif'))
pyPyr = pt.pyramids.LaplacianPyramid(img)
recon = pyPyr.recon_pyr()
self.assertTrue((matPyr['recon'] == recon).all())
np.testing.assert_allclose(matPyr['recon'], recon)
def test8(self):
matPyr = scipy.io.loadmat(op.join(matfiles_path, 'buildLpyr8.mat'))
pyRamp = pt.synthetic_images.ramp(200)
Expand All @@ -360,13 +360,13 @@ def test11(self):
pyRamp = pt.synthetic_images.ramp((200,200))
pyPyr = pt.pyramids.LaplacianPyramid(pyRamp)
recon = pyPyr.recon_pyr(levels=[1])
self.assertTrue((matPyr['recon'] == recon).all())
np.testing.assert_allclose(matPyr['recon'], recon, atol=1e-6)
def test12(self):
matPyr = scipy.io.loadmat(op.join(matfiles_path, 'buildLpyr12.mat'))
pyRamp = pt.synthetic_images.ramp((200,200))
pyPyr = pt.pyramids.LaplacianPyramid(pyRamp)
recon = pyPyr.recon_pyr(levels=[0, 2, 4])
self.assertTrue((matPyr['recon'] == recon).all())
np.testing.assert_allclose(matPyr['recon'], recon, atol=1e-6)

class WpyrTests(unittest.TestCase):
def test0(self):
Expand Down
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,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.7%7C3.8%7C3.9%7C3.10-blue.svg
.. |python-version-shield| image:: https://img.shields.io/badge/python-3.8%7C3.9%7C3.10%7C3.11%7C3.12-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 @@ -4,7 +4,7 @@ dynamic = ["version"]
authors = [{name="Pyrtools authors"}]
description = "Python tools for multi-scale image processing, including Laplacian pyramids, Wavelets, and Steerable Pyramids."
readme = "README.md"
requires-python = ">=3.7"
requires-python = ">=3.8"
classifiers = [
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit 6ec6e0b

Please sign in to comment.