From 20af96a1b826f6956151d3d4e6bbc580d7e1d2ff Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 10 Dec 2013 08:39:02 -0500 Subject: [PATCH] Deprecate IPython-related Sphinx extensions --- lib/matplotlib/sphinxext/ipython_console_highlighting.py | 8 ++++++++ lib/matplotlib/sphinxext/ipython_directive.py | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/lib/matplotlib/sphinxext/ipython_console_highlighting.py b/lib/matplotlib/sphinxext/ipython_console_highlighting.py index c9bf1c1514ab..435046860541 100644 --- a/lib/matplotlib/sphinxext/ipython_console_highlighting.py +++ b/lib/matplotlib/sphinxext/ipython_console_highlighting.py @@ -20,6 +20,14 @@ from sphinx import highlighting +import warnings +warnings.warn(""" +The Sphinx extension ipython_console_highlighting has moved from +matplotlib to IPython, and its use in matplotlib is deprecated. +Change your import from 'matplotlib.sphinxext.ipython_directive' to +'IPython.sphinxext.ipython_directive.""", +matplotlib.cbook.mplDeprecation) + #----------------------------------------------------------------------------- # Global constants line_re = re.compile('.*?\n') diff --git a/lib/matplotlib/sphinxext/ipython_directive.py b/lib/matplotlib/sphinxext/ipython_directive.py index 63a8c5c21265..d2b3e20be2ec 100644 --- a/lib/matplotlib/sphinxext/ipython_directive.py +++ b/lib/matplotlib/sphinxext/ipython_directive.py @@ -79,6 +79,14 @@ matplotlib.use('Agg') +import warnings +warnings.warn(""" +The Sphinx ipython_directive has moved from matplotlib to IPython, and +its use within matplotlib is deprecated. Change your import from +'matplotlib.sphinxext.ipython_directive' to +'IPython.sphinxext.ipython_directive.""", +matplotlib.cbook.mplDeprecation) + # Our own try: from IPython import Config, InteractiveShell