Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ipython 3.0 broke my readthedocs build #7941

Closed
njsmith opened this issue Mar 3, 2015 · 11 comments · Fixed by #7954
Closed

ipython 3.0 broke my readthedocs build #7941

njsmith opened this issue Mar 3, 2015 · 11 comments · Fixed by #7954
Milestone

Comments

@njsmith
Copy link
Contributor

njsmith commented Mar 3, 2015

Not sure if this is a bug but it sure was annoying.

patsy.readthedocs.org uses IPython.sphinxext.ipython_directive and IPython.sphinxext.ipython_console_highlighting. It installs these by providing RTD with a requirements.txt which contains the string ipython, so pip install ipython happens.

When 3.0 arrived on PyPI, this stopped working: suddenly my RTD builds are failing. Grovelling through the logs reveals that the pip install ipython went through fine, but then trying to import the sphinx extensions bailed out saying that I have to install jsonschema. Okay, fine, I added that to requirements.txt. Now it bailed out complaining about the lack of mistune. Okay, google says that should be pip installable too, so I added that to requirements.txt too. Now it seems to be working? But it seems like you have some broken install_requires or something?

@jenshnielsen
Copy link
Contributor

The same think happened for the matplotlib docs build.

IPython defines a number of additional targets here that can be installed with pip as

pip install ipython[...]

The intention is that the default one should only install dependencies needed for the ipython terminal.
It seems to me that jsonschema and mistune should be added to the doc target.

@takluyver
Copy link
Member

Hmm. It shouldn't really require those, but ipython_console_highlighting imports from ..nbconvert.utils.lexers import IPyLexer. Nbconvert pulls in mistune and nbformat, and the latter pulls in jsonschema.

Probably the best fix would be to move the lexers to somewhere that both nbconvert and sphinxext can import them.

@njsmith
Copy link
Contributor Author

njsmith commented Mar 3, 2015

Is the [doc] target for using ipython to build docs, or for building
ipython's docs? Is this target documented anywhere?

Someone might also want to double-check that these are the only packages
missing from that dependency list. The error messages complained about the
"notebook" needing these extra packages, and some of the other
notebook-related packages listed in setup.py are installed on RTD for
unrelated reasons (e.g. jinja2), so the dependencies might have been
satisfied by accident.
On Mar 3, 2015 12:51 AM, "Jens Hedegaard Nielsen" notifications@github.com
wrote:

The same think happened for the matplotlib docs build.

IPython defines a number of additional targets here
https://github.com/ipython/ipython/blob/master/setup.py#L251 that can
be installed with pip as

pip install ipython[...]

The intention is that the default one should only install dependencies
needed for the ipython terminal.
It seems to me that jsonschema and mistune should be added to the doc
target.


Reply to this email directly or view it on GitHub
#7941 (comment).

@takluyver
Copy link
Member

I think the doc target is for building IPython's own docs, but I don't think this is written down anywhere.

@minrk
Copy link
Member

minrk commented Mar 3, 2015

When some nbconvert handlers depended on sphinx, we tried to make sure it wasn't imported unless those actual exporters were being used. We should probably do the same with mistune.

@minrk
Copy link
Member

minrk commented Mar 3, 2015

@takluyver I dealt with the mistune import in #7953. Where do you think the lexers should go, keeping in mind the repo split? utils?

@takluyver
Copy link
Member

Hmm, that's tricky. It doesn't feel like something that should be in utils, but putting it in either nbconvert or sphinxext introduces a dependency that shouldn't really be there (nbconvert highlighting shouldn't depend on Sphinx; sphinx highlighting shouldn't depend on nbformat), and I don't want to start splitting out every little module into its own package. Not sure.

@minrk
Copy link
Member

minrk commented Mar 3, 2015

Maybe in IPython.utils (part of the utils that stays with IPython Prime), or IPython.lib.

I've never really known what IPython.lib was for...

@takluyver
Copy link
Member

AIUI, IPython.utils was inteded for generic utility functions, and IPython.lib for things specifically relevant to IPython - so things like get_ipython_dir(), which is actually in utils, 'should' be in lib. But we've never really enforced any distinction. So lib would probably make sense for this. And it's fine for both of those pieces to depend on 'IPython Prime' (great name).

@minrk
Copy link
Member

minrk commented Mar 3, 2015

lib makes sense, then.

takluyver added a commit to takluyver/ipython that referenced this issue Mar 3, 2015
Closes ipythongh-7941

I've left a backwards compatibility module in
IPython.nbconvert.utils.lexers - I don't know if anyone is importing it
directly, but since we put it in entry points, we should probably
consider it public API.
takluyver added a commit to takluyver/ipython that referenced this issue Mar 3, 2015
Closes ipythongh-7941

I've left a backwards compatibility module in
IPython.nbconvert.utils.lexers - I don't know if anyone is importing it
directly, but since we put it in entry points, we should probably
consider it public API.
@minrk minrk added this to the 3.1 milestone Mar 4, 2015
@njsmith
Copy link
Contributor Author

njsmith commented Mar 4, 2015

Thanks!
On Mar 4, 2015 10:48 AM, "Min RK" notifications@github.com wrote:

Closed #7941 #7941 via #7954
#7954.


Reply to this email directly or view it on GitHub
#7941 (comment).

ssanderson pushed a commit to quantopian/ipython that referenced this issue Mar 4, 2015
Closes ipythongh-7941

I've left a backwards compatibility module in
IPython.nbconvert.utils.lexers - I don't know if anyone is importing it
directly, but since we put it in entry points, we should probably
consider it public API.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants