Python deprecation factory ensuring useful warnings and docstrings for different deprecations.
Python3 deprecation factory. Automatically write boilerplate code for many kinds of deperecations through python decorators.
Breaking things is important! Breaking other's things is just mean!
The goal of deprecations is to warn other library writers that their code is about to break so you can keep making agressive changes to your own.
Often when you want to deprecate a feature, you end up following a procedure similar to
- Make the useful modification to your code.
- Decide on when the old behaviour should be switched over.
- Add warnings INSIDE your function to warn users.
- Change the function signature to something non-sensical to detect the default behaviour.
- Add messages in the documentation.
Finally, when the behaviour is official depreprecated, you need to do all these changes again.
- Remove the warnings.
- Remove the documentation messages.
- Remove the old behaviour.
- Change the function signature back to something useful.
The goal of this library is to allow you to shortcut steps 3-9. You shouldn't have to revisit the deprecation long after you completed implementing your new features
This library modifies function signatures and docstrings to make the current version of the function appear in autocompletions and on the automatically generated documentation.
The library will point the user to their line of code, so that they can make the appropriate modifications.
It is even safe to leave the deprecators in place after the threshold version has been reached. The decorator will behave as a no-op and your library will use the updated version of your code. Deprecations should not have to be blockers for your development.
- Deprecator for change of default values in
kwargspassed as positional arguments too!
- Transitionning to keyword only arguments.
- Swapping the order of positional arguments
- Feature requests are welcome!
- Input sanitization.
- Mark Harfouche
None yet. Why not be the first?
How to contribute
Ready to contribute? We use the standard github contribution model. Scikit-Image has a great writeup on how to setup your environment. Adapt it for our environment.
- Deprecated arguments appear in order for Python 3.5 as well.
- New deprecator for changing the default value of
kwards. Handles arguments passed as positional argumnets too.
- First release on PyPi
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size deprecation_factory-0.1.4-py3-none-any.whl (8.2 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size deprecation_factory-0.1.4.tar.gz (28.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for deprecation_factory-0.1.4-py3-none-any.whl
Hashes for deprecation_factory-0.1.4.tar.gz