From e334e1673e80ed1522db594e94afdf34fe9271a8 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 02:22:05 -0500 Subject: [PATCH 1/9] add macos-latest to CI matrix --- .github/workflows/ci.yml | 90 ++-------------------------------------- 1 file changed, 3 insertions(+), 87 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b93cb317..03678f431 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,8 +15,7 @@ on: jobs: test-build-full: - name: Test Linux - runs-on: ubuntu-latest + name: Tests timeout-minutes: 25 if: ${{ !github.event.pull_request.draft }} strategy: @@ -26,6 +25,8 @@ jobs: imgui_dep: ["imgui", ""] notebook_dep: ["notebook", ""] pygfx_version: ["pygfx-release", "pygfx-main"] + os: ["ubuntu-latest", "macos-latest"] + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: @@ -83,88 +84,3 @@ jobs: path: | examples/diffs examples/notebooks/diffs - - -# test-build-full-mac: -# name: Test Mac, notebook + glfw -# runs-on: macos-14 -# if: ${{ !github.event.pull_request.draft }} -# strategy: -# fail-fast: false -# matrix: -# include: -# - name: Test py310 -# pyversion: '3.10' -# - name: Test py311 -# pyversion: '3.11' -# - name: Test py312 -# pyversion: '3.12' -# steps: -# - uses: actions/checkout@v3 -# with: -# lfs: true -# - name: Set up Python -# uses: actions/setup-python@v3 -# with: -# python-version: ${{ matrix.pyversion }} -# - name: Install dev dependencies -# run: | -# python -m pip install --upgrade pip setuptools -# # remove pygfx from install_requires, we install using pygfx@main -# pip install -e ".["tests"]" -# pip install git+https://github.com/pygfx/pygfx.git@main -# - name: Show wgpu backend -# run: -# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" -# - name: Test examples -# run: | -# pytest -v examples -# pytest --nbmake examples/notebooks/ -# - uses: actions/upload-artifact@v3 -# if: ${{ failure() }} -# with: -# name: screenshot-diffs -# path: | -# examples/desktop/diffs -# examples/notebooks/diffs -# -# test-build-glfw-mac: -# name: Test Mac, glfw -# runs-on: macos-14 -# if: ${{ !github.event.pull_request.draft }} -# strategy: -# fail-fast: false -# matrix: -# include: -# - name: Test py310 -# pyversion: '3.10' -# - name: Test py311 -# pyversion: '3.11' -# - name: Test py312 -# pyversion: '3.12' -# steps: -# - uses: actions/checkout@v3 -# with: -# lfs: true -# - name: Set up Python -# uses: actions/setup-python@v3 -# with: -# python-version: ${{ matrix.pyversion }} -# - name: Install dev dependencies -# run: | -# python -m pip install --upgrade pip setuptools -# # remove pygfx from install_requires, we install using pygfx@main -# pip install -e ".["tests-desktop"]" -# pip install git+https://github.com/pygfx/pygfx.git@main -# - name: Show wgpu backend -# run: -# python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" -# - name: Test examples -# run: | -# pytest -v examples -# - uses: actions/upload-artifact@v3 -# if: ${{ failure() }} -# with: -# name: screenshot-diffs -# path: | -# examples/desktop/diffs From 01cb51ea75aba7d50db4cd0211af02ad72835ad3 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 02:28:51 -0500 Subject: [PATCH 2/9] Update ci.yml --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03678f431..a6e4178ee 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,7 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install llvmpipe and lavapipe for offscreen canvas + if: ${{ matrix.os == "ubuntu-latest" }} run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev @@ -44,7 +45,7 @@ jobs: run: | python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main - sed -i "/pygfx/d" ./setup.py + sed -i'.bak' "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main - name: Install fastplotlib run: | From a6047808afedb315e4844a50633112e7c35e4a10 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 02:30:56 -0500 Subject: [PATCH 3/9] fix quotes --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6e4178ee..b66672a26 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,12 +36,12 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install llvmpipe and lavapipe for offscreen canvas - if: ${{ matrix.os == "ubuntu-latest" }} + if: ${{ matrix.os == 'pygfx-main' }} run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev - name: Install pygx from main - if: ${{ matrix.pygfx_version == 'pygfx-main' }} + if: ${{ matrix.pygfx_version == 'macos-latest' }} run: | python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main From 222c1a35ddfd2b0ab799f13649186ac9e5d889c8 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 02:40:43 -0500 Subject: [PATCH 4/9] Update ci.yml --- .github/workflows/ci.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b66672a26..01eeb8e41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,16 +36,25 @@ jobs: with: python-version: ${{ matrix.python }} - name: Install llvmpipe and lavapipe for offscreen canvas - if: ${{ matrix.os == 'pygfx-main' }} + if: ${{ matrix.os == 'ubuntu-latest' }} run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev + - name: Set up Homebrew + if: ${{ matrix.os == 'macos-latest' }} + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + - name: Install gsed + if: ${{ matrix.os == 'macos-latest' }} + run: | + brew install gnu-sed + alias sed="gsed" - name: Install pygx from main - if: ${{ matrix.pygfx_version == 'macos-latest' }} + if: ${{ matrix.pygfx_version == 'pygfx-main' }} run: | python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main - sed -i'.bak' "/pygfx/d" ./setup.py + sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main - name: Install fastplotlib run: | From 239f8f7d8ee3205786fb9c83011a793e84900e48 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 02:50:28 -0500 Subject: [PATCH 5/9] Update ci.yml --- .github/workflows/ci.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 01eeb8e41..21cef1293 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,7 +48,9 @@ jobs: if: ${{ matrix.os == 'macos-latest' }} run: | brew install gnu-sed - alias sed="gsed" + echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH" + which sed + sed - name: Install pygx from main if: ${{ matrix.pygfx_version == 'pygfx-main' }} run: | From b023becd71174bc72630ee15f2ed5b8f2df4d690 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 03:00:58 -0500 Subject: [PATCH 6/9] Update ci.yml --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 21cef1293..39d45c744 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,6 +40,7 @@ jobs: run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev + run: echo "PYGFX_EXPECT_LAVAPIPE=true" >> "$GITHUB_ENV" - name: Set up Homebrew if: ${{ matrix.os == 'macos-latest' }} id: set-up-homebrew @@ -49,8 +50,7 @@ jobs: run: | brew install gnu-sed echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH" - which sed - sed + run: echo "PYGFX_EXPECT_LAVAPIPE=false" >> "$GITHUB_ENV" - name: Install pygx from main if: ${{ matrix.pygfx_version == 'pygfx-main' }} run: | @@ -69,25 +69,25 @@ jobs: python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" - name: Test components env: - PYGFX_EXPECT_LAVAPIPE: true + PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} run: | WGPU_FORCE_OFFSCREEN=1 pytest -v tests/ - name: Test examples env: - PYGFX_EXPECT_LAVAPIPE: true + PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} run: | WGPU_FORCE_OFFSCREEN=1 pytest -v examples/ - name: Test examples notebooks, exclude ImageWidget notebook if: ${{ matrix.notebook_dep == 'notebook' }} env: - PYGFX_EXPECT_LAVAPIPE: true + PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} # test notebooks, exclude ImageWidget notebooks run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs) - name: Test ImageWidget notebooks # test image widget notebooks only if imgui is installed if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }} env: - PYGFX_EXPECT_LAVAPIPE: true + PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs) - uses: actions/upload-artifact@v4 if: ${{ failure() }} From b5a9e65cb0da1a9a2399ec32e47e0cb28cc26301 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 03:03:43 -0500 Subject: [PATCH 7/9] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39d45c744..454856cdf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev - run: echo "PYGFX_EXPECT_LAVAPIPE=true" >> "$GITHUB_ENV" + echo "PYGFX_EXPECT_LAVAPIPE=true" >> "$GITHUB_ENV" - name: Set up Homebrew if: ${{ matrix.os == 'macos-latest' }} id: set-up-homebrew @@ -50,7 +50,7 @@ jobs: run: | brew install gnu-sed echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH" - run: echo "PYGFX_EXPECT_LAVAPIPE=false" >> "$GITHUB_ENV" + echo "PYGFX_EXPECT_LAVAPIPE=false" >> "$GITHUB_ENV" - name: Install pygx from main if: ${{ matrix.pygfx_version == 'pygfx-main' }} run: | From c0d1539554e441bf74ed74b4069948075d4e2f19 Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 03:09:01 -0500 Subject: [PATCH 8/9] remove expect lavapipe, not really necessary anymore --- .github/workflows/ci.yml | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 454856cdf..a312896ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,6 @@ jobs: run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev - echo "PYGFX_EXPECT_LAVAPIPE=true" >> "$GITHUB_ENV" - name: Set up Homebrew if: ${{ matrix.os == 'macos-latest' }} id: set-up-homebrew @@ -50,7 +49,6 @@ jobs: run: | brew install gnu-sed echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH" - echo "PYGFX_EXPECT_LAVAPIPE=false" >> "$GITHUB_ENV" - name: Install pygx from main if: ${{ matrix.pygfx_version == 'pygfx-main' }} run: | @@ -69,26 +67,26 @@ jobs: python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" - name: Test components env: - PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} + WGPU_FORCE_OFFSCREEN: 1 run: | - WGPU_FORCE_OFFSCREEN=1 pytest -v tests/ + pytest -v tests/ - name: Test examples env: - PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} + WGPU_FORCE_OFFSCREEN: 1 run: | - WGPU_FORCE_OFFSCREEN=1 pytest -v examples/ + pytest -v examples/ - name: Test examples notebooks, exclude ImageWidget notebook if: ${{ matrix.notebook_dep == 'notebook' }} env: - PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} + FASTPLOTLIB_NB_TESTS: 1 # test notebooks, exclude ImageWidget notebooks - run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs) + run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs) - name: Test ImageWidget notebooks # test image widget notebooks only if imgui is installed if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }} env: - PYGFX_EXPECT_LAVAPIPE: ${{ env.PYGFX_EXPECT_LAVAPIPE }} - run: FASTPLOTLIB_NB_TESTS=1 pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs) + FASTPLOTLIB_NB_TESTS: 1 + run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs) - uses: actions/upload-artifact@v4 if: ${{ failure() }} with: From eb90f9564c3cba4bc2e395420aeaac99428f875f Mon Sep 17 00:00:00 2001 From: Kushal Kolar Date: Sat, 25 Jan 2025 03:50:20 -0500 Subject: [PATCH 9/9] increase tolerance --- examples/notebooks/nb_test_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/notebooks/nb_test_utils.py b/examples/notebooks/nb_test_utils.py index fc74f5875..e1c32e0a0 100644 --- a/examples/notebooks/nb_test_utils.py +++ b/examples/notebooks/nb_test_utils.py @@ -16,7 +16,7 @@ os.makedirs(SCREENSHOTS_DIR, exist_ok=True) os.makedirs(DIFFS_DIR, exist_ok=True) -TOLERANCE = 0.05 +TOLERANCE = 0.1 # store all the failures to allow the nb to proceed to test other examples FAILURES = list()