Skip to content

Improve inserted docstring note of deprecated_func - #8095

Merged
lagru merged 6 commits into
scikit-image:mainfrom
lagru:depr-func-nicer-doc
Apr 27, 2026
Merged

lagru merged 6 commits into
scikit-image:mainfrom
lagru:depr-func-nicer-doc

Conversation

@lagru

@lagru lagru commented Mar 16, 2026

Copy link
Copy Markdown
Member

Description

Prompted by #8057 (comment). Instead of prepending an plain note, deprecate_func now uses the deprecation directive and inserts it after the short summary on the first line.

Not time tracking this, since it just bothered me.

Checklist

Release note

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

...

@lagru
lagru requested review from mkcor and stefanv March 16, 2026 08:17
@lagru lagru added 🔧 type: Maintenance Refactoring and maintenance of internals 🚀 Quick win Trivial, small, easy to address or review labels Mar 16, 2026
@lagru

lagru commented Mar 16, 2026 •

Copy link
Copy Markdown
Member Author
Screenshots of before and after Before image

Ignore the highlighted text (that was me searching for deprecated in the page).

@greptile-apps

This comment was marked as outdated.

Comment thread src/_skimage2/_shared/utils.py Resolved
@lagru
lagru requested a review from blink1073 April 26, 2026 12:11
@greptile-apps

This comment was marked as low quality.

Comment thread src/_skimage2/_shared/utils.py Resolved
@greptile-apps

This comment was marked as low quality.

Comment thread src/_skimage2/_shared/utils.py Resolved
)

expected_doc = """\
Dummy function used in `test_deprecate_func`.

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.

Indentation?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I think I remember, that this is actually explicit Python behavior pre v3.13. That's why I only call cleandoc conditionally on the Python version in

if sys.version_info[:2] >= (3, 13):
expected_doc = inspect.cleandoc(expected_doc) + "\n"

@stefanv

stefanv commented Apr 26, 2026

Copy link
Copy Markdown
Member

Go ahead and merge when you're ready.

@lagru
lagru merged commit bfc1cdb into scikit-image:main Apr 27, 2026
19 of 21 checks passed
@stefanv stefanv added this to the 0.27 milestone Apr 27, 2026
@lagru
lagru deleted the depr-func-nicer-doc branch April 27, 2026 20:59
@greptile-apps

greptile-apps Bot commented Apr 27, 2026

Copy link
Copy Markdown
Contributor

Reviews (5): Last reviewed commit: "Note TODO post Python 3.12" | Re-trigger Greptile

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

🚀 Quick win Trivial, small, easy to address or review 🔧 type: Maintenance Refactoring and maintenance of internals

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants