← 返回首页
simplify CI and install extras by kushalkolar · Pull Request #698 · fastplotlib/fastplotlib · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

simplify CI and install extras#698

Merged
kushalkolar merged 31 commits into
mainfrom
simplify-ci
Jan 20, 2025
Merged

simplify CI and install extras#698
kushalkolar merged 31 commits into
mainfrom
simplify-ci

Conversation

kushalkolar commented Jan 17, 2025
edited
Loading

Copy link
Copy Markdown
Member

A successfull attempt to do the following: 😄

  • extras deps in setup.py are simplified, was kinda entangled before
  • use matrix in CI for notebook vs. no notebook installs
  • introduce non-imgui tests in the matrix to make sure fpl works without imgui

Also updated to use uplaod-artifacts v4, but for reasons I do not understand it merges the imgui and non-imgui images within the same uploaded zip file even though I specify two separate filenames as specified by their docs. One of the artifacts contains both the imgui and non-imgui screnshots (wtf?) and the other one has only the imgui versions which makes no sense (wtf 2) 🤷‍♂️ . Anyways this is fine for us for now so I don't think we should hold back for this minor quirk of upload-artifacts (they might fix it in a future version sooner than us figuring it out)

closes #678

kushalkolar requested a review from clewis7 as a code owner January 17, 2025 06:26

github-actions Bot commented Jan 17, 2025
edited
Loading

Copy link
Copy Markdown

📚 Docs preview built and uploaded! https://www.fastplotlib.org/ver/simplify-ci

Copy link
Copy Markdown
Member Author

oh shit this is actually working 🤯

Copy link
Copy Markdown
Member Author

wow after lots of git actions bash wrangling and sed garbling my idea actually worked 😲 !

@clewis7 this will require a more thorough review XD

Comment thread .github/workflows/ci.yml
Comment on lines -63 to -114
pytest -v examples
FASTPLOTLIB_NB_TESTS=1 pytest --nbmake examples/notebooks/
- uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: screenshot-diffs
path: |
examples/diffs
examples/notebooks/diffs

test-build-offscreen:
name: Test Linux, only offscreen
runs-on: ubuntu-latest
timeout-minutes: 30
if: ${{ !github.event.pull_request.draft }}
strategy:
fail-fast: false
matrix:
include:
- name: Test py311
pyversion: '3.11'
- name: Test py312
pyversion: '3.12'
- name: Test py313
pyversion: '3.13'
steps:
- uses: actions/checkout@v4
with:
lfs: true
- name: Set up Python
uses: actions/setup-python@v5
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-dev libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers xorg-dev
- name: Install dev dependencies
run: |
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
pip install -e ".["tests-desktop"]"
- 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

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

git is stupid, this entire block is actually the previous non-notebooks test pipeline that came after afterwards

Comment thread .github/workflows/ci.yml
name: Test Linux
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 10

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

we can go back to 10 mins now that we don't have python3.10 which required more time due to no imgui wheels existing for it.

Comment thread .github/workflows/ci.yml
# create string with one of: tests,imgui,notebook; test,imgui; test,notebook ; tests
# sed removes trailing comma
# install fastplotlib with given extras options from above
pip install -e ".[$(echo "tests,${{ matrix.imgui_dep }},${{ matrix.notebook_dep }}" | sed -e "s/,\+/,/g" -e "s/,$//")]"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

I copy pasted the sed from stackoverflow

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

nifty

Copy link
Copy Markdown
Member Author

Oh wait I can use bash to exclude the ImageWidget nb for the pytest call when imgui doesn't exists

clewis7 left a comment
edited
Loading

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

LGTM, very cool stuff! I like the pattern matching with sed

I will let you merge this one

Comment thread .github/workflows/ci.yml
# create string with one of: tests,imgui,notebook; test,imgui; test,notebook ; tests
# sed removes trailing comma
# install fastplotlib with given extras options from above
pip install -e ".[$(echo "tests,${{ matrix.imgui_dep }},${{ matrix.notebook_dep }}" | sed -e "s/,\+/,/g" -e "s/,$//")]"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality Hide comment

nifty

Comment thread setup.py Show resolved Hide resolved

Copy link
Copy Markdown
Member Author

LGTM, very cool stuff! I like the pattern matching with sed

I wouldn't say I like the sed, it's an ugly garble but useful 😂

kushalkolar merged commit 29e3ec4 into main Jan 20, 2025
kushalkolar deleted the simplify-ci branch January 20, 2025 19:59
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add test screenshots without imgui

2 participants

Footer

© 2026 GitHub, Inc.