Skip to content

Doctest migration in PRs & on all platforms - #8141

Merged
stefanv merged 5 commits into
scikit-image:mainfrom
lagru:doctest-migration-in-prs
May 20, 2026
Merged

stefanv merged 5 commits into
scikit-image:mainfrom
lagru:doctest-migration-in-prs

Conversation

@lagru

@lagru lagru commented May 4, 2026

Copy link
Copy Markdown
Member

I noticed in #8057 that our current setup doesn't catch failing examples in our migration guide. So I propose to doctest the migration guide as part of our regular test workflows. That way we catch errors early while working on the migration example and we also test it on all platforms!

Follow-up to #8133.

Release note (optional)

...

lagru added 2 commits May 4, 2026 16:49
Moving the jinja2 import out of migration_utils.py allows running
doctest_migration.py in the CI without having to install doc
dependencies.
@lagru
lagru requested a review from matthew-brett May 4, 2026 14:58
@lagru lagru added the 🤖 type: Infrastructure CI, packaging, tools and automation label May 4, 2026
@greptile-apps

greptile-apps Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "Doctest migration in PRs & on all platfo..." | Re-trigger Greptile

Comment thread .github/workflows/test-linux.yaml Resolved
Comment thread .github/workflows/test-windows.yaml Resolved
@matthew-brett

Copy link
Copy Markdown
Contributor

Ah yes - this was a version of the changes I reverted in #8133 from a comment by @stefanv . He thought it was not necessary to test on all platforms. Sorry for my ignorance - but why can this not be achieved with:

diff --git a/.github/workflows/test-linux.yaml b/.github/workflows/test-linux.yaml
index dd7b6a3fa..847d2f712 100644
--- a/.github/workflows/test-linux.yaml
+++ b/.github/workflows/test-linux.yaml
@@ -128,6 +128,10 @@ jobs:
         run: |
           $PYTEST --doctest-plus --showlocals --pyargs skimage ./tests
 
+      - name: Run Skimage2 migration doctests
+        run: |
+          python doc/tools/doctest_migration.py
+
       - name: Check benchmarks
         run: |
           asv check -v -E existing

Conflicts:
.github/workflows/test-linux.yaml
@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

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

@lagru

lagru commented May 19, 2026

Copy link
Copy Markdown
Member Author

Sorry for my ignorance - but why can this not be achieved with: [...]

@matthew-brett I don't follow what you are confused about. The change you suggest in your comment is exactly what I included (now patched after recent updates to our linux workflows).

If you are asking about the other changes, see the description of f69cfda.

In these workflows, skimage is not installed because it is build with
`spin build`.
@lagru

lagru commented May 19, 2026

Copy link
Copy Markdown
Member Author

a comment by @stefanv . He thought it was not necessary to test on all platforms.

I disagree with @stefanv here (without having looked for his commend).

Right now we only test it the migration examples on main. So mistakes we make during porting are only discovered after merging PRs.

I'm less set on testing on all platforms, but I think it would be prudent to avoid platform-specific errors sneaking through.

@greptile-apps

greptile-apps Bot commented May 19, 2026

Copy link
Copy Markdown
Contributor

Reviews (3): Last reviewed commit: "Use `spin run --` to invoke doctest_migr..." | Re-trigger Greptile

Stéfan & Steven suggested this rename because the old one seemed
ambiguous to them.
@lagru
lagru requested a review from stefanv May 20, 2026 06:41
@greptile-apps

greptile-apps Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

Reviews (4): Last reviewed commit: "Rename to `run_migration_doctests.py`" | Re-trigger Greptile

@stefanv
stefanv merged commit c1ad8c7 into scikit-image:main May 20, 2026
27 checks passed
@stefanv

stefanv commented May 20, 2026 •

Copy link
Copy Markdown
Member

Thanks! And sorry for my earlier misunderstanding around what this script does. The renaming makes it very clear 🙏

@stefanv stefanv added this to the 0.27 milestone May 20, 2026
@lagru
lagru deleted the doctest-migration-in-prs branch May 21, 2026 06:50
matthew-brett added a commit to matthew-brett/scikit-image that referenced this pull request May 21, 2026
* origin/main: (254 commits)
  Refactor, document migration utilities (scikit-image#8184)
  ci: improve handling of pr labels (scikit-image#8169)
  Doctest migration in PRs & on all platforms (scikit-image#8141)
  Update SKIP 4 (import hierarchy, backporting, testing) (scikit-image#8097)
  One page per function / class in HTML docs for skimage2 (scikit-image#8154)
  Pin minimum pytest to 9 (scikit-image#8174)
  docs: make source install instructions more discoverable and add build requirements to top level requirements file (scikit-image#8165)
  Drop `--maxfail=5` from local pytest config (scikit-image#8170)
  Use standard C99 static inline instead of `__inline` (scikit-image#8159)
  Fix structural_similarity win_size / gaussian_weights conflict (scikit-image#8162)
  Unwrap seed refactor (scikit-image#8142)
  ci: Remove llvm build and add ccache support on windows (scikit-image#8164)
  Document warn_external in contributing guide (scikit-image#8163)
  CI: Fix emscripten dependencies and clean up wheel test commands (scikit-image#8147)
  Test only changed subpackages (scikit-image#8103)
  Fix nightlies: update deprecated scipy call, fix underdetermined test
  Fix minkowski distanced invocation for SciPy >= 1.18 (scikit-image#8157)
  Port `structural_similarly` to ski2 (scikit-image#8104)
  make spin build requirement a lower bound (scikit-image#8158)
  Drop Python 3.11 Support (scikit-image#8153)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🤖 type: Infrastructure CI, packaging, tools and automation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants