hack-house/.venv/lib/python3.12/site-packages/sanic/logging/deprecation.py
leetcrypt bb1d662ee1 chore: rename project coven → hack-house ⛧
Rebrand the Rust client crate (coven/ → hh/, package+binary "hack-house"),
README, CLI strings, and branch (coven → hack-house). Gitea repo renamed
cmd-chat → hack-house to match. Crypto/server logic unchanged; selftest +
golden-vector test still green, binary is now `hack-house`.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-05-30 13:29:14 -07:00

34 lines
934 B
Python

from warnings import warn
from sanic.helpers import is_atty
from sanic.logging.color import Colors
def deprecation(message: str, version: float): # no cov
"""
Add a deprecation notice
Example when a feature is being removed. In this case, version
should be AT LEAST next version + 2
.. code-block:: python
deprecation("Helpful message", 99.9)
Example when a feature is deprecated but not being removed:
.. code-block:: python
deprecation("Helpful message", 0)
Args:
message (str): Deprecation message
version (float): Version when the feature will be removed
"""
version_display = f" v{version}" if version else ""
version_info = f"[DEPRECATION{version_display}] "
if is_atty():
version_info = f"{Colors.RED}{version_info}"
message = f"{Colors.YELLOW}{message}{Colors.END}"
warn(version_info + message, DeprecationWarning)