-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expire deprecations in cbook.deprecation #22514
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
Conversation
c2e06ae
to
fb3a50e
Compare
The failing tests are an indication that these were not properly deprecated earlier (and that I didn't look carefully enough across the entire code base...). Should they still be removed or should they be properly deprecated now instead? |
I don't think we have or easily could have added a warning on importing the class via Also it's rather unlikely for end users to import MatplotlibDeprecationWarning. So let's continue with the removal as planned. The internal import errors are an oversight and should be fixed. |
fb3a50e
to
6f621c1
Compare
6f621c1
to
ebc9d65
Compare
I've fixed the failing tests and added release note. (Azure is not that happy, but I doubt it is my fault.) |
This removal hard breaks a seaborn function.
Curious what the basis for this claim was? https://github.com/search?q=%22from+matplotlib.cbook+import+MatplotlibDeprecationWarning%22&type=Code shows 2k+ direct imports of this class, and searching for alternate usage patterns turns up others as well.
I agree that this would have been hard! But IMO that puts the burden on matplotlib to deprecate with a bit more care (e.g., proactively searching for usage in downstream libraries, etc.). You are right that this was "properly documented", but it is mentioned in the middle of a very long list of API changes (there are >4000 words on https://matplotlib.org/stable/api/prev_api_changes/api_changes_3.4.0.html). Downstream libraries have the reasonable expectation that they can rely on unit test coverage to surface deprecation warnings, since matplotlib is usually good about that sort of thing. In the future, please boost the signal of any silent deprecations. |
We should back out the change that broke seaborn and sort out a way to loudly complain. This is a blocking issue for mpl36. |
Assuming that it is primarily the import of MatlabDeprecationWarning from cbook that is required (and that importing |
This was not possible in 3.4 as it supported Python 3.6; it is possible now with |
PR Summary
Expire deprecations in cbook.deprecation. Will add a release note, but was a bit confused which things actually are deprecated.
cbook.MatplotlibDeprecationWarning and cbook.mplDeprecation are deprecated based on the earlier release note:
However, it is possible to import cbook.MatplotlibDeprecationWarning and cbook.mplDeprecation and use them without any deprecation warnings. Is it still OK to removed them?
Btw, the current code gave a dual deprecation warning: :-)
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).