Skip to content

Updates test suite to be used with pytest-run-parallel - #8065

Merged
stefanv merged 55 commits into
scikit-image:mainfrom
ngoldbaum:use_pytest_run_parallel
May 21, 2026
Merged

stefanv merged 55 commits into
scikit-image:mainfrom
ngoldbaum:use_pytest_run_parallel

Conversation

@ngoldbaum

@ngoldbaum ngoldbaum commented Feb 25, 2026 •

Copy link
Copy Markdown
Contributor

Description

Supercedes #7678.

Updates the test suite to be runnable under pytest-run-parallel.

Checklist

Release note

For maintainers and optionally contributors, please refer to the instructions on how to document this PR for the release notes.

The project now has testing on the free-threaded-build using pytest-run-parallel to detect thread safety issues.

@ngoldbaum

Copy link
Copy Markdown
Contributor Author

It would be helpful to have a sentence somewhere for the maintainers, so that if they run into this pytest-run-parallel thing, they know what it is about. Otherwise looks great, thanks!

Thanks! I'll do that and fix the conflicts here once the RNG PR is merged.

@ngoldbaum

Copy link
Copy Markdown
Contributor Author

I finally came back to this. Now that the other PRs are merged the diff is much smaller here. I'm going to stabilize CI then add developer docs.

@greptile-apps

greptile-apps Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (2): Last reviewed commit: "Merge branch 'main' into use_pytest_run_..." | Re-trigger Greptile

Comment thread src/skimage/io/collection.py Resolved
@greptile-apps

greptile-apps Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "avoid possible deadlock by creating a ne..." | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (4): Last reviewed commit: "add developer docs" | Re-trigger Greptile

@ngoldbaum

Copy link
Copy Markdown
Contributor Author

@stefanv I think this is ready for another code review pass.

That said, I saw one Linux failure I can't easily explain: https://github.com/scikit-image/scikit-image/actions/runs/25746117592/job/75610100370

Looking at the implementation of warp, my best guess is that this is an OpenBLAS issue maybe? I can't reproduce it on my Mac.

@greptile-apps

greptile-apps Bot commented May 12, 2026

Copy link
Copy Markdown
Contributor

Reviews (5): Last reviewed commit: "remove unnecessary imports" | Re-trigger Greptile

blink1073 pushed a commit that referenced this pull request May 12, 2026
While working on #8065 I noticed that I had a kinda old spin version
installed. IMO spin is stable enough you can mark this as a lower bound.
Let's see if CI agrees.

@stefanv stefanv 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.

Very nice, thanks Nathan. I hope that CI target doesn't take too long running "many instances" of the tests in parallel :)

I need to look at the failure; never seen that one around before 🤔

assert y.dtype == np.dtype(dtype_out)


@pytest.mark.thread_unsafe

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 like the pattern you use below where you explain why; if you feel up to it everywhere.

Comment thread CONTRIBUTING.rst Resolved
Comment thread CONTRIBUTING.rst
library functions and built-in pytest fixtures as thread-unsafe
automatically. See the ``pytest-run-parallel`` `README
<https://github.com/Quansight-Labs/pytest-run-parallel#caveats>`_
for more information.

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.

These notes are great, thanks.

Co-authored-by: Stefan van der Walt <[email protected]>
@stefanv
stefanv merged commit 6019dc1 into scikit-image:main May 21, 2026
15 checks passed
@stefanv

stefanv commented May 21, 2026

Copy link
Copy Markdown
Member

Thanks, @ngoldbaum!

@stefanv stefanv added this to the 0.27 milestone May 21, 2026
@greptile-apps

greptile-apps Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Reviews (6): Last reviewed commit: "Fix scikit-image case" | Re-trigger Greptile

@greptile-apps

greptile-apps Bot commented May 21, 2026

Copy link
Copy Markdown
Contributor

Want your agent to iterate on Greptile's feedback? Try greploops.

blink1073 pushed a commit that referenced this pull request May 22, 2026
Thanks @stefanv for pointing these out in #8065. I should have deleted
them, they're leftover from #7678 and are unnecessary. In 3.14t, the
warnings module is thread-safe. In any case on 3.13t,
pytest-run-parallel will automatically mark tests that use the
`warnings` module as thread-unsafe. These marks predate that.
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.

3 participants