chore: import upstream snapshot with attribution

This commit is contained in:
wehub-resource-sync
2026-07-13 12:38:34 +08:00
commit 0549b088a4
2405 changed files with 810255 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
from .uuid import generate_short_id, generate_uuid
class DeprecationError(Exception):
"""Raised when deprecating some older functions. This is strictly for use
while developing and will be removed from the codebase later."""
pass
def deprecate(reason: str = "This function is deprecated"):
"""Deprecation decorator. Provide `reason` to show why you're deprecating something.
NOTE: Decorating something with this will ensure that the function _will not run._
"""
import functools
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
raise DeprecationError(f"{func.__name__} is deprecated: `{reason}`")
return wrapper
return decorator
__all__ = [
"DeprecationError",
"deprecate",
"generate_short_id",
"generate_uuid",
]