8000 Re-add a deprecated cbook.deprecation module for backward compatibility · matplotlib/matplotlib@c6419cf · GitHub
[go: up one dir, main page]

Skip to content

Commit c6419cf

Browse files
committed
Re-add a deprecated cbook.deprecation module for backward compatibility
1 parent 01910b5 commit c6419cf

File tree

4 files changed

+12
-1
lines changed

4 files changed

+12
-1
lines changed

.flake8

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ per-file-ignores =
5858
lib/matplotlib/backends/backend_*.py: F401
5959
lib/matplotlib/backends/qt_editor/formlayout.py: F401, F403
6060
lib/matplotlib/cbook/__init__.py: F401
61+
lib/matplotlib/cbook/deprecation.py: F401
6162
lib/matplotlib/font_manager.py: E221, E251, E501
6263
lib/matplotlib/image.py: F401, F403
6364
lib/matplotlib/lines.py: F401
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
``matplotlib.cbook.deprecation`` is deprecated
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
The module is considered internal and will be removed from the public API.

lib/matplotlib/_api/deprecation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def warn_deprecated(
105105
warning = _generate_deprecation_warning(
106106
since, message, name, alternative, pending, obj_type, addendum,
107107
removal=removal)
108-
from . import _warn_external
108+
from ..cbook import _warn_external
109109
_warn_external(warning, category=MatplotlibDeprecationWarning)
110110

111111

lib/matplotlib/cbook/deprecation.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# imports are for backward compatibility
2+
from matplotlib._api.deprecation import (
3+
MatplotlibDeprecationWarning, mplDeprecation, warn_deprecated, deprecated)
4+
5+
warn_deprecated("3.4",
6+
"The module matplotlib.cbook.deprecation is considered "
7+
"internal and it will be made private in the future.")

0 commit comments

Comments
 (0)
0