Skip to content

Commit

Permalink
remove class deprecation decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
NiklasNeugebauer committed Jan 22, 2025
1 parent 1025c19 commit 21dcb93
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions rosys/helpers/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,3 @@ def wrapper(*args, **kwargs):
return wrapper
return decorator


def deprecated_class(*, remove_in_version: str | None = None, stacklevel: int = 2) -> Callable:
"""Mark a class as deprecated."""
def decorator(cls: type) -> type:
original_init = cls.__init__

def new_init(self, *args, **kwargs):
warnings.warn(
f'The class "{cls.__name__}" is deprecated and will be removed in '
f'{("RoSys " + remove_in_version) if remove_in_version else "a future version"}.',
category=DeprecationWarning,
stacklevel=stacklevel,
)
original_init(self, *args, **kwargs)

cls.__init__ = new_init
return cls
return decorator

0 comments on commit 21dcb93

Please sign in to comment.