diff --git a/src/coaster/app.py b/src/coaster/app.py index 8cb48656..9c9d7658 100644 --- a/src/coaster/app.py +++ b/src/coaster/app.py @@ -20,6 +20,7 @@ Union, cast, ) +from typing_extensions import deprecated import itsdangerous from flask.json.provider import DefaultJSONProvider @@ -217,7 +218,9 @@ class QuartRotatingKeySecureCookieSessionInterface(QuartSecureCookieSessionInter # Flask version is also available with an unprefixed name -RotatingKeySecureCookieSessionInterface = FlaskRotatingKeySecureCookieSessionInterface +RotatingKeySecureCookieSessionInterface = deprecated( + "Renamed to FlaskRotatingKeySecureCookieSessionInterface" +)(FlaskRotatingKeySecureCookieSessionInterface) # --- App init utilities --------------------------------------------------------------- diff --git a/src/coaster/sqlalchemy/markdown.py b/src/coaster/sqlalchemy/markdown.py index bd6023b7..80d601a6 100644 --- a/src/coaster/sqlalchemy/markdown.py +++ b/src/coaster/sqlalchemy/markdown.py @@ -3,6 +3,7 @@ from __future__ import annotations from typing import Any, Callable, Optional, Union +from typing_extensions import deprecated import sqlalchemy as sa from markupsafe import Markup @@ -170,4 +171,6 @@ class CustomMarkdownComposite(MarkdownComposite): # Compatibility name -MarkdownColumn = markdown_column +MarkdownColumn = deprecated("MarkdownColumn has been renamed to markdown_column")( + markdown_column +) diff --git a/src/coaster/views/classview.py b/src/coaster/views/classview.py index 5a0f2293..dab096d5 100644 --- a/src/coaster/views/classview.py +++ b/src/coaster/views/classview.py @@ -9,7 +9,6 @@ from __future__ import annotations -import warnings from collections.abc import Awaitable, Collection, Coroutine from functools import partial, update_wrapper, wraps from inspect import iscoroutinefunction @@ -33,6 +32,7 @@ Self, TypeAlias, TypeVar, + deprecated, get_original_bases, ) @@ -782,13 +782,9 @@ def __init__(self) -> None: self.view_args = {} @property + @deprecated("current_handler has been renamed to current_method") def current_handler(self) -> ViewMethodBind: """Deprecated name for :attr:`current_method`.""" - warnings.warn( - "current_handler has been renamed to current_method", - DeprecationWarning, - stacklevel=2, - ) return self.current_method def __eq__(self, other: object) -> bool: