-
Notifications
You must be signed in to change notification settings - Fork 53
Deprecation framework (draft)
A draft for technical aspects of https://github.com/coala/cEPs/issues/30
Code deprecation should be using warnings.warn
with DeprecationWarning
.
warnings.warn
is a layer on top of logging
, that allows configuration per class of warning.
Users do not need to see code deprecation messages, and DeprecationWarning
messages are by default ignored, and thus not pushed into the logging layer.
The test runner should run the tests with DeprecationWarning
emitted, so that developers are forced to see them.
coala can add a layer above warnings.warn
which takes adds higher level deprecation functions like forced deprecation policy/schedule. e.g. it could require that deprecation warnings are fixed before a nominated date/version, after which the test runner will stop ignoring it and show an exception.