From 80582c45c5e13818488cfa1290a72e6b8782aaa1 Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Tue, 3 Oct 2023 14:43:23 -0400 Subject: [PATCH 1/3] add desktop-only CI, add py312, remove ipywidget import, pin pygfx>=0.1.14 --- .github/workflows/ci.yml | 66 ++++++++++++++++++++++++++++-- .github/workflows/pypi-publish.yml | 2 +- .github/workflows/screenshots.yml | 2 +- fastplotlib/layouts/_plot.py | 1 - setup.py | 2 +- 5 files changed, 65 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85731e381..7b65db952 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -37,7 +37,7 @@ jobs: - name: Install dev dependencies run: | python -m pip install --upgrade pip - # remove pygfx from requirements, we install a specific commit of pygfx since both fpl and pygfx are fast evolving + # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main pip install -e ".[notebook,docs,tests]" @@ -46,8 +46,8 @@ jobs: cd docs make html SPHINXOPTS="-W --keep-going" - test-build: - name: Test examples + test-build-full: + name: Test examples, env with notebook and glfw runs-on: ubuntu-latest if: ${{ !github.event.pull_request.draft }} strategy: @@ -60,6 +60,8 @@ jobs: pyversion: '3.10' - name: Test py311 pyversion: '3.11' + - name: Test py312 + pyversion: '3.12' steps: - name: Install git-lfs run: | @@ -76,7 +78,7 @@ jobs: - name: Install dev dependencies run: | python -m pip install --upgrade pip - # remove pygfx from requirements, we install a specific commit of pygfx since both fpl and pygfx are fast evolving + # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main pip install -e ".["tests"]" @@ -100,3 +102,59 @@ jobs: path: | examples/desktop/diffs examples/notebooks/diffs + + test-build-desktop: + name: Test examples, env with only glfw + runs-on: ubuntu-latest + if: ${{ !github.event.pull_request.draft }} + strategy: + fail-fast: false + matrix: + include: + - name: Test py39 + pyversion: '3.9' + - name: Test py310 + pyversion: '3.10' + - name: Test py311 + pyversion: '3.11' + - name: Test py312 + pyversion: '3.12' + steps: + - name: Install git-lfs + run: | + sudo apt install --no-install-recommends -y git-lfs + - uses: actions/checkout@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.pyversion }} + - name: Install llvmpipe and lavapipe for offscreen canvas + run: | + sudo apt-get update -y -qq + sudo apt-get install --no-install-recommends -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers git-lfs + - name: Install dev dependencies + run: | + python -m pip install --upgrade pip + # remove pygfx from install_requires, we install using pygfx@main + sed -i "/pygfx/d" ./setup.py + pip install git+https://github.com/pygfx/pygfx.git@main + pip install glfw + pip install -e . + - name: Show wgpu backend + run: + python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" + - name: fetch git lfs files + run: | + git lfs fetch --all + git lfs pull + - name: Test examples + env: + PYGFX_EXPECT_LAVAPIPE: true + run: | + pytest -v examples + - uses: actions/upload-artifact@v3 + if: ${{ failure() }} + with: + name: screenshot-diffs + path: | + examples/desktop/diffs diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index ec703542b..207d92351 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -25,7 +25,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v3 with: - python-version: '3.x' + python-version: '3.10' - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 5e274da83..68a4e01c8 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -31,7 +31,7 @@ jobs: - name: Install dev dependencies run: | python -m pip install --upgrade pip - # remove pygfx from requirements, we install a specific commit of pygfx since both fpl and pygfx are fast evolving + # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main pip install -e ".["tests"]" diff --git a/fastplotlib/layouts/_plot.py b/fastplotlib/layouts/_plot.py index bf15456bf..253b6296b 100644 --- a/fastplotlib/layouts/_plot.py +++ b/fastplotlib/layouts/_plot.py @@ -3,7 +3,6 @@ import traceback import os -import ipywidgets import pygfx from wgpu.gui.auto import WgpuCanvas, is_jupyter diff --git a/setup.py b/setup.py index aa194aa3e..91bac5be8 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ install_requires = [ "numpy>=1.23.0", - "pygfx>=0.1.13", + "pygfx>=0.1.14", ] From 82f82a523e03c7289f2ae88a1c0c23c2e57cf106 Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Tue, 3 Oct 2023 14:49:27 -0400 Subject: [PATCH 2/3] add tests-desktop to extras_require --- .github/workflows/ci.yml | 3 +-- setup.py | 9 +++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b65db952..fd8c08d3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -138,8 +138,7 @@ jobs: # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main - pip install glfw - pip install -e . + pip install -e ".["tests-desktop"]" - name: Show wgpu backend run: python -c "from examples.tests.testutils import wgpu_backend; print(wgpu_backend)" diff --git a/setup.py b/setup.py index 91bac5be8..6557994ef 100644 --- a/setup.py +++ b/setup.py @@ -43,6 +43,15 @@ "scikit-learn", "tqdm", "sidecar" + ], + + "tests-desktop": + [ + "pytest", + "scipy", + "imageio", + "scikit-learn", + "tqdm", ] } From 4b0b3cd754d38fa78e99d1f343b3b09005d51ffd Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Tue, 3 Oct 2023 15:08:07 -0400 Subject: [PATCH 3/3] install setuptools explicitly, use py3.11 for docs test --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/screenshots.yml | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd8c08d3e..5fe2f65fe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,10 @@ jobs: fail-fast: false steps: - uses: actions/checkout@v3 - - name: Set up Python 3.9 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: 3.9 + python-version: 3.11 - name: Install llvmpipe and lavapipe for offscreen canvas, and git lfs run: | sudo apt-get update -y -qq @@ -36,7 +36,7 @@ jobs: sudo apt-get install ./pandoc-3.1.4-1-amd64.deb - name: Install dev dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main @@ -77,7 +77,7 @@ jobs: sudo apt-get install --no-install-recommends -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers git-lfs - name: Install dev dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main @@ -134,7 +134,7 @@ jobs: sudo apt-get install --no-install-recommends -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers git-lfs - name: Install dev dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main diff --git a/.github/workflows/screenshots.yml b/.github/workflows/screenshots.yml index 68a4e01c8..d4cfb94d3 100644 --- a/.github/workflows/screenshots.yml +++ b/.github/workflows/screenshots.yml @@ -20,17 +20,17 @@ jobs: run: | sudo apt install --no-install-recommends -y git-lfs - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python 3.11 uses: actions/setup-python@v4 with: - python-version: '3.10' + python-version: '3.11' - name: Install llvmpipe and lavapipe for offscreen canvas run: | sudo apt-get update -y -qq sudo apt-get install --no-install-recommends -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - name: Install dev dependencies run: | - python -m pip install --upgrade pip + python -m pip install --upgrade pip setuptools # remove pygfx from install_requires, we install using pygfx@main sed -i "/pygfx/d" ./setup.py pip install git+https://github.com/pygfx/pygfx.git@main