|
@@ -32,22 +32,25 @@ try:
|
|
|
except ModuleNotFoundError:
|
|
|
# if dissolve is not installed, then just provide a basic implementation
|
|
|
# of its replace_me decorator
|
|
|
- def replace_me(since=None):
|
|
|
+ def replace_me(since=None, remove_in=None):
|
|
|
def decorator(func):
|
|
|
import warnings
|
|
|
|
|
|
- if since is not None:
|
|
|
- warnings.warn(
|
|
|
- f"{func.__name__} is deprecated since {since}; use 'dissolve migrate' to update your code",
|
|
|
- DeprecationWarning,
|
|
|
- stacklevel=2,
|
|
|
- )
|
|
|
+ m = f"{func.__name__} is deprecated"
|
|
|
+ if since is not None and remove_in is not None:
|
|
|
+ m += f" since {since} and will be removed in {remove_in}"
|
|
|
+ elif since is not None:
|
|
|
+ m += f" since {since}"
|
|
|
+ elif remove_in is not None:
|
|
|
+ m += f" and will be removed in {remove_in}"
|
|
|
else:
|
|
|
- warnings.warn(
|
|
|
- f"{func.__name__} is deprecated; use 'dissolve migrate' to update your code",
|
|
|
- DeprecationWarning,
|
|
|
- stacklevel=2,
|
|
|
- )
|
|
|
+ m += " and will be removed in a future version"
|
|
|
+
|
|
|
+ warnings.warn(
|
|
|
+ m,
|
|
|
+ DeprecationWarning,
|
|
|
+ stacklevel=2,
|
|
|
+ )
|
|
|
return func
|
|
|
|
|
|
return decorator
|