Repository: pandas-dev/pandas

Issue:
Doc build failing with IPython 7.0
Looks like a regression upstream in IPython: 
https://github.com/ipython/ipython/issues/11362

We've temporarily pinned the doc build to 6.5. Will need to remove that pin when a fixed IPython is released.

```
Running Sphinx v1.8.1
/Users/taugspurger/Envs/pandas-dev/lib/python3.7/site-packages/sphinx/application.py:402: RemovedInSphinx20Warning: app.info() is now deprecated. Use sphinx.util.logging instead.
  RemovedInSphinx20Warning)
Initializing Spelling Checker
loading pickled environment... done
[autosummary] generating autosummary for: 10min.rst, advanced.rst, api.rst, basics.rst, categorical.rst, comparison_with_r.rst, comparison_with_sas.rst, comparison_with_sql.rst, comparison_with_stata.rst, computation.rst, ..., r_interface.rst, release.rst, reshaping.rst, sparse.rst, text.rst, timedeltas.rst, timeseries.rst, tutorials.rst, visualization.rst, whatsnew.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 2 source files that are out of date
updating environment: 2 added, 0 changed, 0 removed
reading sources... [ 50%] cookbook

>>>-------------------------------------------------------------------------
Exception in /Users/taugspurger/sandbox/pandas/doc/source/cookbook.rst at block ending on line 485
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-88-f383d2261d3f> in <module>
----> 1 avg_weight += sum(x[x['size'] == 'M'].weight * 1.25)

NameError: name 'avg_weight' is not defined
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-89-f72d4d450698> in <module>
----> 1 avg_weight += sum(x[x['size'] == 'L'].weight)

NameError: name 'avg_weight' is not defined
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-90-ec76bd1aa2cb> in <module>
----> 1 avg_weight /= len(x)

NameError: name 'avg_weight' is not defined
  File "<ipython-input-91-204b3859f54f>", line 1
    return pd.Series(['L',avg_weight,True], index=['size', 'weight', 'adult'])
                                                                              ^
SyntaxError: 'return' outside function

<<<-------------------------------------------------------------------------


Exception occurred:
  File "/Users/taugspurger/Envs/pandas-dev/lib/python3.7/site-packages/IPython/sphinxext/ipython_directive.py", line 567, in process_input
    raise RuntimeError('Non Expected exception in `{}` line {}'.format(filename, lineno))
RuntimeError: Non Expected exception in `/Users/taugspurger/sandbox/pandas/doc/source/cookbook.rst` line 485
The full traceback has been saved in /var/folders/hz/f43khqfn7b1b1g8z_z6y3bsw0000gp/T/sphinx-err-kh0o4bnl.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
```


Discussion:
https://github.com/ipython/ipython/issues/11362
IPython 7.1.1 is out, with this fixed. To close this issue we need two things

1. Update our `doc/source/conf.py` to include `ipython_warning_is_error = False`
2. remove the IPython version pin in `ci/deps/travis-36-doc.yaml`

Resolving patch:
diff --git a/doc/source/conf.py b/doc/source/conf.py
--- a/doc/source/conf.py
+++ b/doc/source/conf.py
@@ -388,6 +388,7 @@
                         category=FutureWarning)
 
 
+ipython_warning_is_error = False
 ipython_exec_lines = [
     'import numpy as np',
     'import pandas as pd',


Test patch: