Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement DeprecatedVariable for deprecating module level variables #35

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

radeklat
Copy link
Contributor

  • Add class DeprecatedVariable
  • Abstract warning check into _get_warning_class()
  • Abstract warning raising into _warn_user()
  • Abstract docstring wrapping into _wrap_doctring()
  • Implement tests for DeprecatedVariable
  • Update README to mention DeprecatedVariable

+ Add class `DeprecatedVariable`
* Abstract warning check into `_get_warning_class()`
* Abstract warning raising into `_warn_user()`
* Abstract docstring wrapping into `_wrap_doctring()`
+ Implement tests for `DeprecatedVariable`
* Update README to mention `DeprecatedVariable`
@codecov-io
Copy link

codecov-io commented Jul 11, 2018

Codecov Report

Merging #35 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #35   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files           1      1           
  Lines          83    110   +27     
  Branches       16     20    +4     
=====================================
+ Hits           83    110   +27
Impacted Files Coverage Δ
deprecation.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c9f228e...f786b50. Read the comment docs.

@briancurtin
Copy link
Owner

Cool! Thanks for writing this up! I have a few things to think about and will try to get you a review for this in the next few days.

deprecated_in, removed_in, current_version
)

class TemporaryClass(obj.__class__):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is going to blow up even for things like SOME_THING_TO_BE_DEPRECATED = True.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(I don't think that using a wrapper object on the object-to-be-deprecated is a promising way to handle this personally. You need to do stuff to the module object instead).

@Julian
Copy link

Julian commented Dec 29, 2018

Don't think this is the right approach personally, but Twisted, which is the best implementor of this functionality that I'm aware of, is as usual a decent place to use as a cheat sheet for this functionality IMHO.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants