Skip to content

Conversation

@robinjhuang
Copy link
Contributor

Added custom deprecation warning classes because DeprecationWarning is not visible unless the user opts in.

Closes Issue #159

@robinjhuang robinjhuang changed the title Added Custom Deprecation Warning classes. Custom Deprecation Warning classes. Oct 27, 2018
@robinjhuang
Copy link
Contributor Author

Added unit tests, so the previous code coverage issue should be resolved now. Let us know if you want anything else changed :)

@martonp and I are interested in Python events in New York. Please let us know about future events. We had a lot of fun at this hackathon.

Our emails:
marci93@gmail.com
robin.j.huang@gmail.com

CHANGES.rst Outdated
v40.5.0
-------

* #1545: Added custom deprecation warning classes because DeprecationWarning is not visible unless the user opts in.
Copy link
Member

Choose a reason for hiding this comment

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

There's a better way to add changelog entries. Please see these docs on how to use towncrier to author changelog entries.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks Jason. I'm a bit confused, should we be commiting the news fragment file? Or should we run towncrier to add the changes to the CHANGES.rst?

Copy link
Member

Choose a reason for hiding this comment

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

Commit the news fragment: one of the reasons for using towncrier is to avoid merge conflicts in CHANGES.rst.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ohhhh I see. Let me change that. Thank you!

@robinjhuang robinjhuang force-pushed the custom-deprecation-warnings branch from 71abc91 to 67124b3 Compare October 28, 2018 15:50
@pganssle pganssle force-pushed the custom-deprecation-warnings branch 4 times, most recently from 5c795d0 to d3b9c97 Compare October 28, 2018 21:38
Junhan Huang and others added 4 commits October 28, 2018 17:43
`DeprecationWarning` is not visible by default in the latest versions of CPython, so this switches the deprecation warnings in setuptools and pkg_resources over to custom classes derived from `Warning` instead. Fixes issue github issue pypa#159 Co-authored-by: Junhan Huang <robin.j.huang@gmail.com> Co-authored-by: Marton Pono <marci93@gmail.com>
These are tests to ensure that the specified deprecation warnings are raised when the functions are called. Co-authored-by: Junhan Huang <robin.j.huang@gmail.com> Co-authored-by: Marton Pono <marci93@gmail.com>
@pganssle pganssle force-pushed the custom-deprecation-warnings branch from d3b9c97 to 3a9dc2b Compare October 28, 2018 21:45
Copy link
Member

@pganssle pganssle left a comment

Choose a reason for hiding this comment

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

I have tweaked some of the details of this implementation and cleaned up the git commit history a bit, so it's ready to merge.

@pganssle pganssle merged commit 566f3aa into pypa:master Oct 29, 2018
@pganssle pganssle mentioned this pull request Nov 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants