From b1071ba3f240d0cb15e7f334d43ed2e987f54415 Mon Sep 17 00:00:00 2001 From: Tim Monko Date: Tue, 21 Apr 2026 15:48:58 -0500 Subject: [PATCH] Update deprecation warning guidance --- docs/developers/contributing/index.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/developers/contributing/index.md b/docs/developers/contributing/index.md index da59ea962..5ba7b626b 100644 --- a/docs/developers/contributing/index.md +++ b/docs/developers/contributing/index.md @@ -147,9 +147,10 @@ Please also consider documenting any major features/changes in our #### Deprecation Warnings -When deprecating a feature, use `DeprecationWarning` instead of `FutureWarning`. -`FutureWarning` is silenced by Python's default warning filters, making it invisible -to library users. `DeprecationWarning` is the correct signal for developer-facing deprecations. +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. **In the code**, always pass `stacklevel=2` to `warnings.warn()` so the warning points to the caller's location rather than inside napari's internals.