Skip to content

__version__ access should raise an appropriate warning category #487

Closed

Description

@flying-sheep

I’d expect a DeprecationWarning or FutureWarning, not a generic UserWarning that can’t be filtered.

warnings.warn(
"The '__version__' attribute is deprecated and will be removed in"
" MarkupSafe 3.1. Use feature detection, or"
' `importlib.metadata.version("markupsafe")`, instead.',
stacklevel=2,
)

Background: scverse/session-info2#96

Activity

  1. added this to the 3.0.3 milestone on May 29, 2025
  2. locked as resolved and limited conversation to collaborators on Jun 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions