8000 Merge pull request #2671 from mdboom/deprecate_ipython_directive · matplotlib/matplotlib@71c77f0 · GitHub
[go: up one dir, main page]

Skip to content

Commit 71c77f0

Browse files
committed
Merge pull request #2671 from mdboom/deprecate_ipython_directive
Deprecate IPython-related Sphinx extensions
2 parents fe96a1d + 0cdac1e commit 71c77f0

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

doc/api/api_changes.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,12 @@ original location:
4747
- mstream -> `from matplotlib import stream as mstream`
4848
- mtable -> `from matplotlib import table as mtable`
4949

50+
* The Sphinx extensions `ipython_directive` and
51+
`ipython_console_highlighting` have been moved to the IPython
52+
project itself. While they remain in matplotlib for this release,
53+
they have been deprecated. Update your extensions in `conf.py` to
54+
point to `IPython.sphinxext.ipython_directive` instead of
55+
`matplotlib.sphinxext.ipython_directive`.
5056

5157
* In :module:`~matplotlib.finance`, almost all functions have been deprecated and
5258
replaced with a pair of functions name `*_ochl` and `*_ohlc`. The former is

lib/matplotlib/sphinxext/ipython_console_highlighting.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@
2222
from pygments.token import Comment, Generic
2323

2424
from sphinx import highlighting
25+
import matplotlib
26+
27+
matplotlib.cbook.warn_deprecated("1.4", """
28+
The Sphinx extension ipython_console_highlighting has moved from
29+
matplotlib to IPython, and its use in matplotlib is deprecated.
30+
Change your import from 'matplotlib.sphinxext.ipython_directive' to
31+
'IPython.sphinxext.ipython_directive.""")
2532

2633
#-----------------------------------------------------------------------------
2734
# Global constants

lib/matplotlib/sphinxext/ipython_directive.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@
8080

8181
matplotlib.use('Agg')
8282

83+
matplotlib.cbook.warn_deprecated("1.4", """
84+
The Sphinx extension ipython_console_highlighting has moved from
85+
matplotlib to IPython, and its use in matplotlib is deprecated.
86+
Change your import from 'matplotlib.sphinxext.ipython_directive' to
87+
'IPython.sphinxext.ipython_directive.""")
88+
8389
# Our own
8490
try:
8591
from IPython import Config, InteractiveShell

0 commit comments

Comments
 (0)
0