File tree Expand file tree Collapse file tree 6 files changed +35
-8
lines changed
prev_api_changes/api_changes_3.5.0 Expand file tree Collapse file tree 6 files changed +35
-8
lines changed Original file line number Diff line number Diff line change @@ -69,4 +69,6 @@ Colormaps and color sequences
6969Miscellaneous
7070=============
7171
72+ .. autoclass :: MatplotlibDeprecationWarning
73+
7274.. autofunction :: get_cachedir
Original file line number Diff line number Diff line change 1+ Deprecation aliases in cbook
2+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
4+ The module ``matplotlib.cbook.deprecation `` was previously deprecated in
5+ Matplotlib 3.4, along with deprecation-related API in ``matplotlib.cbook ``. Due
6+ to technical issues, ``matplotlib.cbook.MatplotlibDeprecationWarning `` and
7+ ``matplotlib.cbook.mplDeprecation `` did not raise deprecation warnings on use.
8+ Changes in Python have now made it possible to warn when these aliases are
9+ being used.
10+
11+ In order to avoid downstream breakage, these aliases will now warn, and their
12+ removal has been pushed from 3.6 to 3.8 to give time to notice said warnings.
13+ As replacement, please use `matplotlib.MatplotlibDeprecationWarning `.
Original file line number Diff line number Diff line change @@ -3,5 +3,4 @@ Removal of deprecations in ``cbook``
33
44The module ``cbook.deprecation `` is removed from the public API as it is
55considered internal. This also holds for deprecation-related re-imports in
6- ``cbook ``: ``deprecated ``, ``MatplotlibDeprecationWarning ``,
7- ``mplDeprecation ``, and ``warn_deprecated ``.
6+ ``cbook ``: ``deprecated ``, and ``warn_deprecated ``.
Original file line number Diff line number Diff line change @@ -47,16 +47,16 @@ corresponding ``Axes.add_*`` method.
4747~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4848
4949Historically, it has not been possible to filter
50- `.MatplotlibDeprecationWarning `\s by checking for ` DeprecationWarning `, since we
51- subclass `UserWarning ` directly.
50+ `~matplotlib .MatplotlibDeprecationWarning `\s by checking for
51+ ` DeprecationWarning `, since we subclass `UserWarning ` directly.
5252
5353The decision to not subclass `DeprecationWarning ` has to do with a decision
5454from core Python in the 2.x days to not show `DeprecationWarning `\s to users.
5555However, there is now a more sophisticated filter in place (see
5656https://www.python.org/dev/peps/pep-0565/).
5757
58- Users will now see `.MatplotlibDeprecationWarning ` only during interactive
59- sessions, and these can be silenced by the standard mechanism:
58+ Users will now see `~matplotlib .MatplotlibDeprecationWarning ` only during
59+ interactive sessions, and these can be silenced by the standard mechanism:
6060
6161.. code :: python
6262
Original file line number Diff line number Diff line change @@ -322,8 +322,8 @@ Introducing
3223221. Announce the deprecation in a new file
323323 :file: `doc/api/next_api_changes/deprecations/99999-ABC.rst ` where ``99999 ``
324324 is the pull request number and ``ABC `` are the contributor's initials.
325- 2. If possible, issue a `.MatplotlibDeprecationWarning ` when the deprecated
326- API is used. There are a number of helper tools for this:
325+ 2. If possible, issue a `~matplotlib .MatplotlibDeprecationWarning ` when the
326+ deprecated API is used. There are a number of helper tools for this:
327327
328328 - Use ``_api.warn_deprecated() `` for general deprecation warnings
329329 - Use the decorator ``@_api.deprecated `` to deprecate classes, functions,
Original file line number Diff line number Diff line change 3030from matplotlib import _api , _c_internal_utils
3131
3232
33+ @_api .caching_module_getattr
34+ class __getattr__ :
35+ # module-level deprecations
36+ MatplotlibDeprecationWarning = _api .deprecated (
37+ "3.6" , obj_type = "" ,
38+ alternative = "matplotlib.MatplotlibDeprecationWarning" )(
39+ property (lambda self : _api .deprecation .MatplotlibDeprecationWarning ))
40+ mplDeprecation = _api .deprecated (
41+ "3.6" , obj_type = "" ,
42+ alternative = "matplotlib.MatplotlibDeprecationWarning" )(
43+ property (lambda self : _api .deprecation .MatplotlibDeprecationWarning ))
44+
45+
3346def _get_running_interactive_framework ():
3447 """
3548 Return the interactive framework whose event loop is currently running, if
You can’t perform that action at this time.
0 commit comments