Deprecation decorator


License
MIT
Install
pip install depr==0.2.1

Documentation

Deprecate decorator

tests
package PyPI Package latest release PyPI Package monthly downloads PyPI Wheel Supported versions Supported implementations

Installation

pip install depr

Documentation

Simple decorator to deprecate functions in your codebase.

Can be used passing a reason for deprecation:

@deprecate(reason="Changed to a better way")
def function():
    pass

A callable with the new function to use:

@deprecate(replacement=other_callable)
def function():
     pass

Or just no options, and it will still raise a DeprecatationWarning using the deprecated function name:

@deprecate
def function():
    pass

Contributing

Contributions and ideas are of course welcome, to do so simply:

  • fork this project
  • make some changes branching from master
  • raise a PR to this repository
  • if the PR gets approved add yourself to CONTRIBUTORS

Testing

Use tox to run tests for all the supported platforms locally, and you will also get travis to run them for you as soon as you open a PR.