Skip to content

Navigation Menu

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

Provide feedback

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

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

simplify CI and install extras #698

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jan 20, 2025
Merged

simplify CI and install extras #698

merged 31 commits into from
Jan 20, 2025

Conversation

kushalkolar
Copy link
Member

@kushalkolar kushalkolar commented Jan 17, 2025

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 kushalkolar requested a review from clewis7 as a code owner January 17, 2025 06:26
Copy link

github-actions bot commented Jan 17, 2025

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

@kushalkolar
Copy link
Member Author

oh shit this is actually working 🤯

@kushalkolar
Copy link
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 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
Member Author

Choose a reason for hiding this comment

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

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

runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 10
Copy link
Member Author

Choose a reason for hiding this comment

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

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.

# 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
Member Author

Choose a reason for hiding this comment

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

I copy pasted the sed from stackoverflow

Copy link
Member

Choose a reason for hiding this comment

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

nifty

@kushalkolar
Copy link
Member Author

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

Copy link
Member

@clewis7 clewis7 left a comment

Choose a reason for hiding this comment

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

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

I will let you merge this one

# 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
Member

Choose a reason for hiding this comment

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

nifty

setup.py Show resolved Hide resolved
@kushalkolar
Copy link
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 kushalkolar merged commit 29e3ec4 into main Jan 20, 2025
16 checks passed
@kushalkolar kushalkolar deleted the simplify-ci branch January 20, 2025 19:59
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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.