Add version-specific deprecation warnings and flag all for 2.0.
Review Request #10260 — Created Oct. 22, 2018 and submitted
This introduces a new
djblets.deprecation
class, which currently
definesDeprecationWarning
subclasses for Djblets, and a utility
function for defining warn-on-access deprecated arguments for functions,
signal handlers, etc. The warnings are the meat of this change, and
include a base class,BaseRemovedInDjbletsVersionWarning
, a
subclass specific to Djblets 2.0,RemovedInDjblets20Warning
, and
an alias for the version-specific warning,
RemovedInNextDjbletsVersionWarning
.These allow us to specify when exactly a particular feature will be
removed, so it's clear to consumers and so we can easily locate them
when getting ready to remove features. It also helps keep us consistent
with when we actually remove deprecated features.All current
DeprecationWarnings
have been updated to use the 2.0
warning. Some of the messages referred to Djblets 0.9 or 1.0, and we
clearly never got rid of that code for those versions, so those have
been updated to reference 2.0, where they'll actually be removed.
All unit tests pass.
- Change Summary:
-
Fixed an import that didn't make it into the commit.
- Commit:
-
f1b22afa9aee405c80474cf7da5f503866e47f9de08a6aadbf182b681d909a7b086e64af4dff0c9c
- Diff:
-
Revision 2 (+143 -28)
Checks run (2 succeeded)
- Description:
-
This introduces a new
djblets.deprecation
class, which currentlydefines DeprecationWarning
subclasses for Djblets, and a utilityfunction for defining warn-on-access deprecated arguments for functions, signal handlers, etc. The warnings are the meat of this change, and ~ include a base class, RemovedInNextDjbletsVersionWarning
, and a~ subclass specific to Djblets 2.0, RemovedInDjblets20Warning
.~ include a base class, BaseRemovedInDjbletsVersionWarning
, a~ subclass specific to Djblets 2.0, RemovedInDjblets20Warning
, and+ an alias for the version-specific warning, + RemovedInNextDjbletsVersionWarning
.These allow us to specify when exactly a particular feature will be
removed, so it's clear to consumers and so we can easily locate them when getting ready to remove features. It also helps keep us consistent with when we actually remove deprecated features. All current
DeprecationWarnings
have been updated to use the 2.0warning. Some of the messages referred to Djblets 0.9 or 1.0, and we clearly never got rid of that code for those versions, so those have been updated to reference 2.0, where they'll actually be removed.