Repository: pandas-dev/pandas

Issue:
DOC: doc/make.py uses IPython promptManager, which is removed from IPython 5.x
When I build document as described in contributing guideline below,
http://pandas-docs.github.io/pandas-docs-travis/contributing.html#building-the-documentation

it makes an error like this.

```
AttributeError: "'InteractiveShell' object has no attribute 'prompt_manager'"
```

This file uses removed class, from IPython 5.x (promptManager)
http://ipython.readthedocs.io/en/stable/whatsnew/version5.html

file: doc/sphinxext/ipython_sphinxext/ipython_directive.py

``` python
 805         if not self.state.document.current_source in self.seen_docs:
 806             self.shell.IP.history_manager.reset()
 807             self.shell.IP.execution_count = 1
 808             self.shell.IP.prompt_manager.width = 0
 809             self.seen_docs.add(self.state.document.current_source)
 810
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS

commit: a0d05dbf7477df863486d82a0cdd4e3e93023864
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: ko_KR.UTF-8
LOCALE: ko_KR.UTF-8

pandas: 0.18.1+356.ga0d05db.dirty
nose: 1.3.7
pip: 8.1.2
setuptools: 25.1.6
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.1
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None

I'm currently on pandas sprint at PyCon APAC, so i will send pull request today if possible.

DOC: doc/make.py uses IPython promptManager, which is removed from IPython 5.x
When I build document as described in contributing guideline below,
http://pandas-docs.github.io/pandas-docs-travis/contributing.html#building-the-documentation

it makes an error like this.

```
AttributeError: "'InteractiveShell' object has no attribute 'prompt_manager'"
```

This file uses removed class, from IPython 5.x (promptManager)
http://ipython.readthedocs.io/en/stable/whatsnew/version5.html

file: doc/sphinxext/ipython_sphinxext/ipython_directive.py

``` python
 805         if not self.state.document.current_source in self.seen_docs:
 806             self.shell.IP.history_manager.reset()
 807             self.shell.IP.execution_count = 1
 808             self.shell.IP.prompt_manager.width = 0
 809             self.seen_docs.add(self.state.document.current_source)
 810
```
#### output of `pd.show_versions()`
## INSTALLED VERSIONS

commit: a0d05dbf7477df863486d82a0cdd4e3e93023864
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 15.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: ko_KR.UTF-8
LOCALE: ko_KR.UTF-8

pandas: 0.18.1+356.ga0d05db.dirty
nose: 1.3.7
pip: 8.1.2
setuptools: 25.1.6
Cython: 0.24.1
numpy: 1.11.1
scipy: 0.18.0
statsmodels: None
xarray: None
IPython: 5.1.0
sphinx: 1.4.1
patsy: None
dateutil: 2.5.3
pytz: 2016.6.1
blosc: None
bottleneck: None
tables: 3.2.3.1
numexpr: 2.6.1
matplotlib: 1.5.1
openpyxl: None
xlrd: None
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.8
boto: None
pandas_datareader: None

I'm currently on pandas sprint at PyCon APAC, so i will send pull request today if possible.



Discussion:

Resolving patch:
diff --git a/doc/sphinxext/ipython_sphinxext/ipython_directive.py b/doc/sphinxext/ipython_sphinxext/ipython_directive.py
--- a/doc/sphinxext/ipython_sphinxext/ipython_directive.py
+++ b/doc/sphinxext/ipython_sphinxext/ipython_directive.py
@@ -802,10 +802,14 @@ def setup(self):
         # reset the execution count if we haven't processed this doc
         #NOTE: this may be borked if there are multiple seen_doc tmp files
         #check time stamp?
-        if not self.state.document.current_source in self.seen_docs:
+        if self.state.document.current_source not in self.seen_docs:
             self.shell.IP.history_manager.reset()
             self.shell.IP.execution_count = 1
-            self.shell.IP.prompt_manager.width = 0
+            try:
+                self.shell.IP.prompt_manager.width = 0
+            except AttributeError:
+                # GH14003: class promptManager has removed after IPython 5.x
+                pass
             self.seen_docs.add(self.state.document.current_source)
 
         # and attach to shell so we don't have to pass them around


Test patch: