upgrade logilab-common/deprecation.py to include structured information
To be able to use RedBaron/other tool to create script to do code modification and auto generate MRs we need structured data.
Luckily, we use logilab.common.deprecation a lot for some generic deprecation functionalities (renaming, removing, moving) on some specific python part (callables, modules, class, ...) so we know what we are doing.
But this information isn't stored inside the DeprecationWarning we emits and we are still stucked with parsing the string contained in the DeprecationWarning.
To avoid that, we need to include structured data in those DeprecationWarning, this could look like:
- creating custom DeprecationWarning classes with custom attributes
- things like: warning.operation = "rename", warning.kind = "callable", warning.old_name = "old_name", warning.new_name = "new_name", warning.line = 42, warning.column = 42 (I'm not sure we'll have the column information)
- all those attributes might be in a metadata attribute (maybe in form of a dictionary)