rbtools.deprecation¶
Internal support for handling deprecations in RBTools.
The version-specific objects in this module are not considered stable between releases, and may be removed at any point. The base objects are considered stable.
Functions
|
Deprecate calls passing keyword-only arguments as positional arguments. |
Exceptions
Base class for a RBTools deprecation warning. |
|
alias of |
|
Deprecations for features removed in RBTools 4.0. |
|
Deprecations for features removed in RBTools 5.0. |
|
Deprecations for features removed in RBTools 6.0. |
- exception rbtools.deprecation.BaseRemovedInRBToolsVersionWarning[source]¶
Bases:
DeprecationWarning
Base class for a RBTools deprecation warning.
All version-specific deprecation warnings inherit from this, allowing callers to check for Review Board deprecations without being tied to a specific version.
- exception rbtools.deprecation.RemovedInRBTools40Warning[source]¶
Bases:
BaseRemovedInRBToolsVersionWarning
Deprecations for features removed in RBTools 4.0.
Note that this class will itself be removed in RBTools 4.0. If you need to check against RBTools deprecation warnings, please see
BaseRemovedInRBToolsVersionWarning
.
- exception rbtools.deprecation.RemovedInRBTools50Warning[source]¶
Bases:
BaseRemovedInRBToolsVersionWarning
Deprecations for features removed in RBTools 5.0.
Note that this class will itself be removed in RBTools 5.0. If you need to check against RBTools deprecation warnings, please see
BaseRemovedInRBToolsVersionWarning
.
- exception rbtools.deprecation.RemovedInRBTools60Warning[source]¶
Bases:
BaseRemovedInRBToolsVersionWarning
Deprecations for features removed in RBTools 6.0.
Note that this class will itself be removed in RBTools 6.0. If you need to check against RBTools deprecation warnings, please see
BaseRemovedInRBToolsVersionWarning
.
- rbtools.deprecation.deprecate_non_keyword_only_args(warning_cls: Type[BaseRemovedInRBToolsVersionWarning], message: Optional[str] = None) Callable[[_FuncT], _FuncT] [source]¶
Deprecate calls passing keyword-only arguments as positional arguments.
This decorator allows code transitioning to keyword-only arguments to continue working when passing values as positional arguments.
Upon the first call, it will record information about the signature of the function and then compare that to any future calls. If any positional argument values are passed to keyword-only arguments, the arguments will be rewritten to work correctly, and a deprecation warning will be emitted.
New in version 4.0.
- Parameters:
warning_cls (
type
) – The specific RBTools deprecation warning class to use. This must be a subclass ofBaseRemovedInRBToolsVersionWarning
.message (
str
, optional) – An optional message to use instead of the default.
- Returns:
The function decorator.
- Return type:
callable
- Raises:
AssertionError – The function being called does not provide keyword-only arguments.
- rbtools.deprecation.RemovedInNextRBToolsVersionWarning[source]¶
alias of
RemovedInRBTools50Warning