Skip to content

Deprecation policy using time-based windows for removal - #1138

Open
TimMonko wants to merge 27 commits into
napari:mainfrom
TimMonko:deprecation-policy
Open

TimMonko wants to merge 27 commits into
napari:mainfrom
TimMonko:deprecation-policy

Conversation

@TimMonko

@TimMonko TimMonko commented Sep 21, 2026 •

Copy link
Copy Markdown
Member

References and relevant issues

Description

Time based deprecation policy with a quarterly floor for removal for hard deprecations and a soft deprecation state as well. Formalizes the process to make it easier to search and maintain. This is intended to be a concrete proposal to enable better discussion.

State Warning category Who sees it Window required? Message must say
Hard FutureWarning Everyone, including end users Yes "may be removed as early as YYYY-QN"
Soft DeprecationWarning Developers only — Python silences this category for library users, but pytest shows it No "there are no current plans to remove it"

Alternatives

  1. Grzegorz has in mind a bi-annual removal period which is locked more closely to certain dates (not holidays, not conference season).
  2. Consider adding PendingDeprecationWarning
  3. One quarter minimum default instead of 2

Follow-ups

  1. Clean up old napari/src (about 20 deprecations)
  2. Sync with Add detection of deprecated properties, create warning in EventedModel napari#9473
  3. Autogenerate a document with all the deprecations and their windows to be served in the API docs

@github-actions github-actions Bot added the documentation Improvements or additions to documentation label Sep 21, 2026

@brisvag brisvag left a comment

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.

Nice @TimMonko, love it!

We probably want to add CI or something in release-tools generate_release that does this check automagically!

Comment on lines +143 to 148
Deprecating or changing existing API follows the [deprecation
policy](napari-deprecation-policy). When deprecating a feature, use
`FutureWarning` instead of `DeprecationWarning`.
`DeprecationWarning` is
[silenced by Python's default warning filters](https://docs.python.org/3/library/warnings.html#warning-categories),
making it invisible to library users.

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.

Might be worth mentioninng that for some things we do want to use Deprecation warning, mainly for stuff that is "discouraged" but not planned to be removed yet (e.g: the viewer.scene.camera vs viewer.camera stuff we recently did).

This way, the deprecations will be seen by CI and by static type checkers, but will not spam GUI users.

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 originally had a separate "how to do deprecations" file that I didn't include here -- mostly because I want to clean up napari/src first. So I missed this bit (as you see in the policy its mentioned). I'll make sure I properly mark the to-dos

Comment on lines +7 to +9
This policy is about *notice*. It does not prevent napari from making breaking
changes — it commits us to telling you about them in advance, on a schedule you
can plan around.

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.

Maybe a mention of how this stems from/relates to EffVer here would be good!

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.

Do you think I should move the EffVer section up that is two sections down? Or was this a comment from reading through in order.

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.

I think just a link would be nice :)

Comment on lines +84 to +88
- **Behaviour and default changes.** If the *name* stays but the result changes,
the same window applies. This matters more than it may appear: napari prioritises
scientific accuracy, so a changed default can change what a researcher sees in
their data and therefore is as important, if not more so, than a removed function
because otherwise the change is silent.

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.

How does this look in practice?

Say we change the way colormap maps colors so the colors are slightly different. Do we fire a warnign any time anyones uses a colormap for 2 quarters, and only after that make the change?

This is the kind of problem that EffVer specifically refers to when it says that SemVer doesn't really work, since ANY change is a breaking change, even bug fixes... (as mentioned below, I see now)

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 this is a great question! There was much support for this idea, in concept, at the core team meeting yesterday. The important thing that we agree is that, especially as a visualization, changes to behavior/defaults is more insidious than deprecations because they can completely change workflow.

Say we change the way colormap maps colors so the colors are slightly different. Do we fire a warnign any time anyones uses a colormap for 2 quarters, and only after that make the change?

I thought above this quite a bit, because Python now has PendingDeprecationWarning, I think in pre-1.0 this is just too lofty of a goal. However, I would consider maybe a UserWarning when the thing is changed, and keep it for 2 releases.

However, a simpler solution, for now at least, is to have good tooling and good practiced use of .. versionchanged so that we can autogenerate an API doc that could even be served from the help menu or something, with a homepage tooltip to check it out. Then people could look through added, changed, removed, deprecated listings.

@TimMonko TimMonko modified the milestones: 0.9.2, 0.10.0 Sep 24, 2026
@brisvag brisvag added the Full docs preview/ready to merge Adding this label will trigger a full docs build for previewing changes. Also @napari-bot make html label Oct 14, 2026
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

TimMonko and others added 2 commits October 15, 2026 16:15
Co-authored-by: Lundy Bernard <lundybernard@users.noreply.github.com>
@brisvag brisvag removed the Full docs preview/ready to merge Adding this label will trigger a full docs build for previewing changes. Also @napari-bot make html label Oct 26, 2026
@brisvag

brisvag commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Given the lack of review from other core team members, I'm going to postpone merging this to the next release.

@brisvag brisvag removed this from the 0.10.0 milestone Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation

Projects

Status: No status

3 participants