Skip to content

Update pyodide CI test to match the pattern used by numpy - #8140

Merged
stefanv merged 4 commits into
scikit-image:mainfrom
blink1073:use-cibuildwheel-pyodide
May 5, 2026
Merged

stefanv merged 4 commits into
scikit-image:mainfrom
blink1073:use-cibuildwheel-pyodide

Conversation

@blink1073

@blink1073 blink1073 commented Apr 29, 2026 •

Copy link
Copy Markdown
Contributor

Fixes #8136.

The original test-pyodide.yml was copied from numpy in 2024. They have since simplified the workflow to use cibuildwheel to do the environment setup. This will make it easier to maintain on our end.

@blink1073 blink1073 added 🤖 type: Infrastructure CI, packaging, tools and automation CI failure labels Apr 29, 2026
Comment thread pyproject.toml

[tool.cibuildwheel.pyodide]
test-command = "pytest --pyargs skimage tests"
test-extras = ["test"]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is to address the failure seen in the nightly wheels build: ERROR: No matching distribution found for matplotlib>=3.10; extra == "optional-free-threaded"

@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Update pyodide CI test to match the patt..." | Re-trigger Greptile

Comment thread pyproject.toml

[tool.cibuildwheel.pyodide]
test-command = "pytest --pyargs skimage tests"
test-extras = ["test"]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Potentially incompatible packages in Pyodide test extras

test-extras = ["test"] will instruct cibuildwheel to run pip install scikit-image[test] inside the Pyodide environment, pulling in pytest-localserver (spawns a werkzeug HTTP server) and pytest-faulthandler (uses signal handlers). Neither has a Pyodide/Emscripten wheel in the Pyodide package repository, and both rely on OS-level networking/signal APIs that are not available in the WASM32 sandbox. If micropip cannot find a compatible wheel it will raise an error and fail the CI step. The original workflow only installed pytest and pytest-pretty; consider narrowing test-extras or adding a conditional install to exclude incompatible packages on emscripten.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This change matches the pattern used in the nightly wheel build

Comment thread .github/workflows/test-pyodide.yaml Resolved
@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "match original triggers" | Re-trigger Greptile

Comment on lines +21 to +22
# To enable this workflow on a fork, comment out:
if: github.repository == 'scikit-image/scikit-image'

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.

Previously this workflow ran for pull requests.

So what is the background for this check? Wouldn't this restrict the workflow to branches on our main repo only (effectively 'main')?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I copied the pattern from numpy. It avoids running the workflow on forks (by default).

Comment thread pyproject.toml Outdated
@@ -303,3 +303,4 @@ before-all = [

[tool.cibuildwheel.pyodide]
test-command = "pytest --pyargs skimage tests"

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.

Suggested change
test-command = "pytest --pyargs skimage tests"
test-command = "pytest --pyargs skimage _skimage2 tests"

I wonder if it would fallback to our pytest config in pyproject.toml if we removed --pyargs ...?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah let's do that instead.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It worked as expected in the passing build, _skimage2 was picked up.

@lagru lagru left a comment

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.

I love to see simplification! 😊

@greptile-apps

greptile-apps Bot commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "address review" | Re-trigger Greptile

@blink1073
blink1073 requested a review from lagru April 29, 2026 17:46
@stefanv
stefanv merged commit 8754962 into scikit-image:main May 5, 2026
22 checks passed
@stefanv

stefanv commented May 5, 2026

Copy link
Copy Markdown
Member

Thanks!

@stefanv stefanv added this to the 0.27 milestone May 5, 2026

# Install pytest and optional dependencies that are available
pip install pytest pytest-pretty
pip install "astropy" "dask[array]" "matplotlib" "PyWavelets" "scikit-learn"

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.

Note change in tested dependencies.

matthew-brett added a commit to matthew-brett/scikit-image that referenced this pull request May 6, 2026
* origin/main:
  Update pyodide CI test to match the pattern used by numpy (scikit-image#8140)
matthew-brett added a commit that referenced this pull request May 12, 2026
* origin/main: (85 commits)
  Drop Python 3.11 Support (#8153)
  undo change to benchmark workflow
  address review
  Update pyodide CI test to match the pattern used by numpy (#8140)
  Update .github/workflows/_build_linux_for_python_x.yaml
  Update .github/workflows/_test_linux_for_python_x.yaml
  Suppress tifffile DeprecationWarning in test_plugin_deprecation_on_imread (#8138)
  fix yaml
  fix yaml
  Update .github/workflows/test-linux.yaml
  Update .github/workflows/_test_linux_for_python_x.yaml
  Update .github/workflows/test-linux.yaml
  Update .github/workflows/test-linux.yaml
  Move tests back to doc build
  Fill out .PHONY targets
  Apply suggestions from code review
  Remove unused imports (apply commit hooks)
  Improve inserted docstring note of `deprecated_func` (#8095)
  address review
  Update doc/source/index.rst
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI failure 🤖 type: Infrastructure CI, packaging, tools and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CI Failure - Test Pyodide

3 participants