Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 497f574

Browse files
kushalkolarclewis7
andauthored
separate CI workflow that uses release version of pygfx (#709)
* Create ci-pygfx-release.yml * Update ci.yml * Update ci-pygfx-release.yml * Update CONTRIBUTING.md * Update CONTRIBUTING.md Co-authored-by: Caitlin Lewis <[email protected]> --------- Co-authored-by: Caitlin Lewis <[email protected]>
1 parent a1a2c55 commit 497f574

File tree

3 files changed

+92
-3
lines changed

3 files changed

+92
-3
lines changed
Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
types:
11+
- opened
12+
- reopened
13+
- synchronize
14+
- ready_for_review
15+
16+
jobs:
17+
test-build-full:
18+
name: Tests - pygfx release
19+
timeout-minutes: 25
20+
if: ${{ !github.event.pull_request.draft }}
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
python: ["3.11", "3.12", "3.13"]
25+
imgui_dep: ["imgui", ""]
26+
notebook_dep: ["notebook", ""]
27+
os: ["ubuntu-latest", "macos-latest"]
28+
runs-on: ${{ matrix.os }}
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
lfs: true
33+
- name: Set up Python
34+
uses: actions/setup-python@v5
35+
with:
36+
python-version: ${{ matrix.python }}
37+
- name: Install llvmpipe and lavapipe for offscreen canvas
38+
if: ${{ matrix.os == 'ubuntu-latest' }}
39+
run: |
40+
sudo apt-get update -y -qq
41+
sudo apt-get install --no-install-recommends -y ffmpeg libegl1-mesa-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev
42+
- name: Set up Homebrew
43+
if: ${{ matrix.os == 'macos-latest' }}
44+
id: set-up-homebrew
45+
uses: Homebrew/actions/setup-homebrew@master
46+
- name: Install gsed
47+
if: ${{ matrix.os == 'macos-latest' }}
48+
run: |
49+
brew install gnu-sed
50+
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH"
51+
- name: Install fastplotlib
52+
run: |
53+
# create string with one of: tests,imgui,notebook; test,imgui; test,notebook ; tests
54+
# sed removes trailing comma
55+
# install fastplotlib with given extras options from above
56+
pip install -e ".[$(echo "tests,${{ matrix.imgui_dep }},${{ matrix.notebook_dep }}" | sed -e "s/,\+/,/g" -e "s/,$//")]"
57+
- name: Show wgpu backend
58+
run:
59+
python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)"
60+
- name: Test components
61+
env:
62+
WGPU_FORCE_OFFSCREEN: 1
63+
run: |
64+
pytest -v tests/
65+
- name: Test examples
66+
env:
67+
WGPU_FORCE_OFFSCREEN: 1
68+
run: |
69+
pytest -v examples/
70+
- name: Test examples notebooks, exclude ImageWidget notebook
71+
if: ${{ matrix.notebook_dep == 'notebook' }}
72+
env:
73+
FASTPLOTLIB_NB_TESTS: 1
74+
# test notebooks, exclude ImageWidget notebooks
75+
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "*.ipynb" ! -name "image_widget*.ipynb" -print | xargs)
76+
- name: Test ImageWidget notebooks
77+
# test image widget notebooks only if imgui is installed
78+
if: ${{ matrix.notebook_dep == 'notebook' && matrix.imgui_dep == 'imgui' }}
79+
env:
80+
FASTPLOTLIB_NB_TESTS: 1
81+
run: pytest --nbmake $(find ./examples/notebooks/ -maxdepth 1 -type f -name "image_widget*.ipynb" -print | xargs)
82+
- uses: actions/upload-artifact@v4
83+
if: ${{ failure() }}
84+
with:
85+
name: screenshot-diffs-${{ matrix.pyversion }}-${{ matrix.imgui_dep }}-${{ matrix.notebook_dep }}
86+
path: |
87+
examples/diffs
88+
examples/notebooks/diffs

.github/workflows/ci.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
python: ["3.11", "3.12", "3.13"]
2525
imgui_dep: ["imgui", ""]
2626
notebook_dep: ["notebook", ""]
27-
pygfx_version: ["pygfx-release", "pygfx-main"]
2827
os: ["ubuntu-latest", "macos-latest"]
2928
runs-on: ${{ matrix.os }}
3029
steps:
@@ -50,7 +49,6 @@ jobs:
5049
brew install gnu-sed
5150
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> "$GITHUB_PATH"
5251
- name: Install pygx from main
53-
if: ${{ matrix.pygfx_version == 'pygfx-main' }}
5452
run: |
5553
python -m pip install --upgrade pip setuptools
5654
# remove pygfx from install_requires, we install using pygfx@main

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,5 +304,8 @@ FASTPLOTLIB_NB_TESTS=1 pytest --nbmake examples/notebooks/
304304

305305
5) Update screenshots if necessary ([see testing](#testing-details))
306306

307-
6) Push and open a draft PR against `main`
307+
6) Push and open a PR (pull request) against the `main` branch
308308

309+
> **Note:**
310+
> The tests labeled "CI / Tests" must pass, but the tests labeled "CI / Tests - pygfx release" do not necessarily need to pass. The difference between these two workflows is "CI / Tests" uses the `main` branch of [`pygfx`](https://github.com/pygfx/pygfx) whereas "CI / Tests - pygfx release" uses the latest release of `pygfx`.
311+
> Since `fastplotlib`, `pygfx`, and `wgpu` are all under rapid development we aim to keep `fastplotlib` up to date with `pygfx@main` until `pygfx` stabilizes. The workflow "CI / Tests - pygfx release" is to inform us if any test failures using the release version of `pygfx` are a significant release blocker for `fastplotlib`. Once you make a PR we will help guide you through any failures with "CI / Tests - pygfx release"!

0 commit comments

Comments
 (0)