Skip to content

Commit 6ec6e0b

Browse files
authored
Merge pull request #33 from LabForComputationalVision/mac_failing_test
Fix failing tests/notebooks by updating action versions
2 parents 5582f77 + ff5def4 commit 6ec6e0b

7 files changed

Lines changed: 55 additions & 53 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If applicable, add screenshots to help explain your problem.
3030

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

3636
**Additional context**

.github/workflows/ci.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
outputs:
1818
notebook: ${{ steps.get-notebooks.outputs.nb }}
1919
steps:
20-
- uses: actions/checkout@v3
20+
- uses: actions/checkout@v4
2121
- id: get-notebooks
2222
# it's weird to me, but the quotes around \n should *not* be escaped or it breaks
2323
run: "echo \"nb=$(ls TUTORIALS/*ipynb | jq -R -s -c 'split(\"\\n\")[:-1]')\"\
@@ -27,39 +27,39 @@ jobs:
2727
needs: [get_notebooks]
2828
strategy:
2929
matrix:
30-
python-version: [3.7, 3.8, 3.9, '3.10']
30+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
3131
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
3232
fail-fast: false
3333
name: Execute notebooks
3434
steps:
35-
- uses: actions/checkout@v3
36-
- uses: actions/setup-python@v4
35+
- uses: actions/checkout@v4
36+
- uses: actions/setup-python@v5
3737
with:
3838
python-version: ${{ matrix.python-version }}
3939
cache: pip
4040
cache-dependency-path: setup.py
4141
- name: Setup FFmpeg
42-
uses: FedericoCarboni/setup-ffmpeg@v2
42+
uses: FedericoCarboni/setup-ffmpeg@v3.1
4343
- name: Install dependencies
4444
# nbclient 0.5.5 is the first version that includes jupyter execute
4545
run: |
4646
pip install --upgrade --upgrade-strategy eager .
4747
pip install jupyter ipywidgets
4848
pip install "nbclient>=0.5.5"
4949
- name: Run notebooks
50-
run: jupyter execute ${{ matrix.notebook }}.ipynb --kernel_name=python3
50+
run: jupyter execute ${{ matrix.notebook }} --kernel_name=python3
5151
tests:
5252
runs-on: ${{matrix.os}}
5353
strategy:
5454
matrix:
5555
os: [ubuntu-latest, macos-latest, windows-latest]
56-
python-version: [3.7, 3.8, 3.9, '3.10']
56+
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
5757
fail-fast: false
5858
name: Run tests
5959
steps:
60-
- uses: actions/checkout@v3
60+
- uses: actions/checkout@v4
6161
- name: Install Python 3
62-
uses: actions/setup-python@v4
62+
uses: actions/setup-python@v5
6363
with:
6464
python-version: ${{ matrix.python-version }}
6565
cache: pip
@@ -80,7 +80,9 @@ jobs:
8080
# generate the xml file and move it to root dir for codecov
8181
coverage xml -o ../coverage.xml
8282
- name: Upload coverage to Codecov
83-
uses: codecov/codecov-action@858dd794fbb81941b6d60b0dca860878cba60fa9 # v3.1.1
83+
uses: codecov/codecov-action@a079530fc142d3d288ddf76321ca0b7fe5b18df5 # v4.4.1
84+
with:
85+
token: ${{ secrets.CODECOV_TOKEN }}
8486
all_tutorials_in_docs:
8587
runs-on: ubuntu-latest
8688
name: Check that all tutorial notebooks are included in docs
@@ -89,7 +91,7 @@ jobs:
8991
matrix:
9092
notebook: ${{fromJson(needs.get_notebooks.outputs.notebook)}}
9193
steps:
92-
- uses: actions/checkout@v3
94+
- uses: actions/checkout@v4
9395
- name: Check for file
9496
shell: bash
9597
run: if [[ -z "$(grep ${{ matrix.notebook }} docs/tutorials/*nblink)" ]] ; then
@@ -98,7 +100,7 @@ jobs:
98100
runs-on: ubuntu-latest
99101
name: Check that we don't have any extra nblink files
100102
steps:
101-
- uses: actions/checkout@v3
103+
- uses: actions/checkout@v4
102104
- name: Check same number of nblink and notebooks
103105
shell: bash
104106
run: |

.github/workflows/deploy.yml

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -10,60 +10,60 @@ jobs:
1010
runs-on: ${{ matrix.os }}
1111
strategy:
1212
matrix:
13-
os: ["macos-latest", "ubuntu-latest", "windows-latest"]
13+
os: [macos-latest, ubuntu-latest, windows-latest]
1414
fail-fast: false
1515

1616
steps:
17-
- uses: actions/checkout@v3
17+
- uses: actions/checkout@v4
1818

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

32-
- name: "Upload wheel as artifact"
33-
uses: actions/upload-artifact@v4
34-
with:
35-
name: artifact-${{ matrix.os }}-wheel
36-
path: "./**/*.whl"
32+
- name: Upload wheel as artifact
33+
uses: actions/upload-artifact@v4
34+
with:
35+
name: artifact-${{ matrix.os }}-wheel
36+
path: ./**/*.whl
3737

3838
build-sdist:
3939
name: Make source distribution
4040
runs-on: ubuntu-latest
4141
steps:
42-
- uses: actions/checkout@v3
42+
- uses: actions/checkout@v4
4343

4444
- run: pipx run build --sdist
4545

4646
- uses: actions/upload-artifact@v4
4747
with:
4848
name: artifact-source-dist
49-
path: "./**/dist/*.tar.gz"
49+
path: ./**/dist/*.tar.gz
5050

5151
deploy:
5252
needs: [build-wheels, build-sdist]
5353
runs-on: ubuntu-latest
5454
if: github.event_name == 'release' && github.event.action == 'published'
5555
steps:
56-
- uses: actions/checkout@v3
57-
- name: Download all artifacts
58-
uses: actions/download-artifact@v4
59-
- name: Copy artifacts to dist/ folder
60-
run: |
61-
find . -name 'artifact-*' -exec unzip '{}' \;
62-
mkdir -p dist/
63-
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
64-
find . -name '*.whl' -exec mv '{}' dist/ \;
65-
- name: Publish package to test pypi
66-
uses: pypa/gh-action-pypi-publish@release/v1
67-
with:
68-
user: __token__
69-
password: ${{ secrets.PYPI_API_TOKEN }}
56+
- uses: actions/checkout@v4
57+
- name: Download all artifacts
58+
uses: actions/download-artifact@v4
59+
- name: Copy artifacts to dist/ folder
60+
run: |
61+
find . -name 'artifact-*' -exec unzip '{}' \;
62+
mkdir -p dist/
63+
find . -name '*.tar.gz' -exec mv '{}' dist/ \;
64+
find . -name '*.whl' -exec mv '{}' dist/ \;
65+
- name: Publish package to test pypi
66+
uses: pypa/gh-action-pypi-publish@68e62d4871ad9d14a9d55f114e6ac71f0b408ec0 # v1.8.14
67+
with:
68+
user: __token__
69+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![PyPI Version](https://img.shields.io/pypi/v/pyrtools.svg)](https://pypi.org/project/pyrtools/)
44
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE)
5-
![Python version](https://img.shields.io/badge/python-3.7|3.8|3.9|3.10-blue.svg)
5+
![Python version](https://img.shields.io/badge/python-3.8|3.9|3.10|3.11|3.12-blue.svg)
66
[![Build Status](https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg)](https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild)
77
[![Documentation Status](https://readthedocs.org/projects/pyrtools/badge/?version=latest)](https://pyrtools.readthedocs.io/en/latest/?badge=latest)
88
[![DOI](https://zenodo.org/badge/137527035.svg)](https://zenodo.org/doi/10.5281/zenodo.10161031)

TESTS/unitTests.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ def test1(self):
217217
#foo = pointOp(200, 200, img, 5, filt, 0, 1, 0);
218218
foo = pt.pointOp(img, filt, 0, 1);
219219
foo = np.reshape(foo,(200,200))
220-
self.assertTrue((matImg['foo'] == foo).all())
220+
np.testing.assert_allclose(matImg['foo'], foo)
221221

222222
class maxPyrHeightTests(unittest.TestCase):
223223
def test1(self):
@@ -336,7 +336,7 @@ def test7(self):
336336
img = plt.imread(op.join(test_data_path, 'lenna-256x256.tif'))
337337
pyPyr = pt.pyramids.LaplacianPyramid(img)
338338
recon = pyPyr.recon_pyr()
339-
self.assertTrue((matPyr['recon'] == recon).all())
339+
np.testing.assert_allclose(matPyr['recon'], recon)
340340
def test8(self):
341341
matPyr = scipy.io.loadmat(op.join(matfiles_path, 'buildLpyr8.mat'))
342342
pyRamp = pt.synthetic_images.ramp(200)
@@ -360,13 +360,13 @@ def test11(self):
360360
pyRamp = pt.synthetic_images.ramp((200,200))
361361
pyPyr = pt.pyramids.LaplacianPyramid(pyRamp)
362362
recon = pyPyr.recon_pyr(levels=[1])
363-
self.assertTrue((matPyr['recon'] == recon).all())
363+
np.testing.assert_allclose(matPyr['recon'], recon, atol=1e-6)
364364
def test12(self):
365365
matPyr = scipy.io.loadmat(op.join(matfiles_path, 'buildLpyr12.mat'))
366366
pyRamp = pt.synthetic_images.ramp((200,200))
367367
pyPyr = pt.pyramids.LaplacianPyramid(pyRamp)
368368
recon = pyPyr.recon_pyr(levels=[0, 2, 4])
369-
self.assertTrue((matPyr['recon'] == recon).all())
369+
np.testing.assert_allclose(matPyr['recon'], recon, atol=1e-6)
370370

371371
class WpyrTests(unittest.TestCase):
372372
def test0(self):

docs/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
.. |license-shield| image:: https://img.shields.io/badge/license-MIT-yellow.svg
55
:target: https://github.com/LabForComputationalVision/pyrtools/blob/main/LICENSE
66

7-
.. |python-version-shield| image:: https://img.shields.io/badge/python-3.7%7C3.8%7C3.9%7C3.10-blue.svg
7+
.. |python-version-shield| image:: https://img.shields.io/badge/python-3.8%7C3.9%7C3.10%7C3.11%7C3.12-blue.svg
88

99
.. |build| image:: https://github.com/LabForComputationalVision/pyrtools/workflows/build/badge.svg
1010
:target: https://github.com/LabForComputationalVision/pyrtools/actions?query=workflow%3Abuild

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44
authors = [{name="Pyrtools authors"}]
55
description = "Python tools for multi-scale image processing, including Laplacian pyramids, Wavelets, and Steerable Pyramids."
66
readme = "README.md"
7-
requires-python = ">=3.7"
7+
requires-python = ">=3.8"
88
classifiers = [
99
"Development Status :: 4 - Beta",
1010
"Programming Language :: Python :: 3",

0 commit comments

Comments
 (0)