Allow Djblets's deprecation support to be used in other products.

Review Request #12813 — Created Jan. 26, 2023 and submitted — Latest diff uploaded

Information

Djblets
release-3.x

Reviewers

Djblets has a lot of useful deprecation code, from the warning classes
to the argument checkers, which currently all explicitly specify
"Djblets" in any messages.

These are now built to be consumed. A new
BaseRemovedInProductVersionWarning class has been added, which
contains the base warning code, and introduces a product field.
BaseRemovedInDjbletsVersionWarning now subclasses this, filling in
product.

Both deprecated_arg_value() and deprecate_non_keyword_only_args()
can be used by consumers along with the new base class.

Unit tests passed.

Made use of the new deprecation abilities in Review Board.

Diff Revision 1 (Latest)

Commits

First Last Summary ID Author
Allow Djblets's deprecation support to be used in other products.
Djblets has a lot of useful deprecation code, from the warning classes to the argument checkers, which currently all explicitly specify "Djblets" in any messages. These are now built to be consumed. A new `BaseRemovedInProductVersionWarning` class has been added, which contains the base warning code, and introduces a `product` field. `BaseRemovedInDjbletsVersionWarning` now subclasses this, filling in `product`. Both `deprecated_arg_value()` and `deprecate_non_keyword_only_args()` can be used by consumers along with the new base class.
3246d9ced6b75c96220527b4bd93e22d100bf96c Christian Hammond
djblets/deprecation.py
Loading...