Skip to content

Comments

Make doctest-plus work with spin#7786

Merged
stefanv merged 10 commits intoscikit-image:mainfrom
stefanv:spin-doctest-plus
May 1, 2025
Merged

Make doctest-plus work with spin#7786
stefanv merged 10 commits intoscikit-image:mainfrom
stefanv:spin-doctest-plus

Conversation

@stefanv
Copy link
Member

@stefanv stefanv commented Apr 29, 2025

/cc @lagru

Closes #7784

@stefanv stefanv added the 🤖 type: Infrastructure CI, packaging, tools and automation label Apr 30, 2025
lagru added 2 commits April 30, 2025 14:02
--import-mode="importlib" is necessary to successfully collect doctests.
Otherwise, the doctest-plus plugin will fail because it finds doctests
in skimage/ which don't exist at runtime. E.g, `brief_pythran.py` which
exists as a file but is only available at runtime with `brief_cy`.

However, there's no need to deviate from the default import mode if
doctests are not collected.
I don't really see a reason not to do so. And it may catch errors
earlier locally.

The argument pattern is copied from what other spin commands do. E.g.,
spin install --no-editable.
Copy link
Member

@lagru lagru left a comment

Choose a reason for hiding this comment

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

Works great. Thanks!

I fixed what I think might have been a small logic hiccup and tweaked the interface a bit (more in the commit messages). Is there a reason not to enable doctesting by default?

Please tweak further or revert if you want!

lagru added 2 commits April 30, 2025 14:17
instead of only when `--doctest` option is passed to spin. E.g. users
might accidentally use `spin test -- --doctest-...`.
Since the current proposal is to enable doctests by default, we don't
need to tell contributors how to run those.
@stefanv stefanv merged commit b536ee4 into scikit-image:main May 1, 2025
22 of 23 checks passed
@stefanv stefanv added this to the 0.26 milestone May 1, 2025
matthew-brett added a commit to matthew-brett/scikit-image that referenced this pull request Jul 7, 2025
* origin/main:
  Deprecate estimate method in favor of class constructor (scikit-image#7771)
  Temporary fix for Visual Studio & Clang incompatibility in Windows image (scikit-image#7835)
  Address deprecations in Pillow 11.3 (scikit-image#7828)
  Remove unused & obsolete `legacy_datasets`, `legacy_registry` vars (scikit-image#7677)
  Draft migration guide for skimage2 (scikit-image#7785)
  Do not report failure in wheels sub-recipe (scikit-image#7806)
  Use consistent wording in property description. (scikit-image#7804)
  Add intensity_median to regionprops (scikit-image#7745)
  CI: Update pypa/gh-action-pypi-publish to v1.12.4 for attestations on PyPI (scikit-image#7793)
  Document output dtype for transform.resize. (scikit-image#7792)
  Use `cibuildwheel` to build WASM/Pyodide wheels for `scikit-image`, push nightlies to Anaconda.org (scikit-image#7440)
  DOC: Include missing gain parameter in adjust_gamma equation (scikit-image#7763)
  Temporarily pin to `pyodide-build==0.30.0`, and ensure that the correct xbuildenvs are used (scikit-image#7788)
  Deprecate old names & attributes in RegionProperties (scikit-image#7778)
  Pin JasonEtco/create-an-issue action to SHA for v2.9.2 (scikit-image#7787)
  Make doctest-plus work with spin (scikit-image#7786)
  Report failures on main via issue (scikit-image#7752)
  Use `workers` instead of alternate parameter names (scikit-image#7302)
  Fix f-string in otsu plot (scikit-image#7780)
  Further document use of regionprops function and fix terms. (scikit-image#7518)
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.

pytest-doctestplus fails with editable install

2 participants