Skip to content

__version__ access should raise an appropriate warning category #487

@flying-sheep

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions