Skip to content

RTD: fix savefig dir creation #1155

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

Merged
merged 2 commits into from
Dec 7, 2016
Merged

Conversation

fmaussion
Copy link
Member

@fmaussion fmaussion commented Dec 7, 2016

I've had a hard time finding out what was going on with missing RTD plots since we updated the packages until I came across this: ipython/ipython#8733

The proposed fix creates the @savefig directory if not there. It works locally but I'm not sure if it will work on RTD (they might use a custom build directory).

The other changes are minor tweaks to remove some build warnings and/or making use of the latest sphinx Makefile. I also removed a part of the conf.py which I think is not needed anymore.

@shoyer do you remember what the inspect.findsource monkeypatch was good for?

clean:
rm -rf $(BUILDDIR)/*
rm -rf generated/*
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is still useful for clearing pages generated by sphinx for API docs.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will put it back again


# Monkey patch inspect.findsource to work around a Python bug that manifests on
# RTD. Copied from IPython.core.ultratb.
# Reference: https://github.com/ipython/ipython/issues/1456
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see this page for the reference -- it's quite likely that this is no longer an issue now that we've updated ipython for our RTD builds.

('index', 'xarray', u'xarray Documentation',
u'xarray Developers', 'xarray', 'One line description of project.',
('index', 'xarray', 'xarray Documentation',
'xarray Developers', 'xarray', 'N-D labeled arrays and datasets in Python.',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Last time I tried (quite a while ago), the tex build did not work.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it does not appear as download option on RTD either. It's not very useful anyway...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's because I disabled that build on RTD :)

@fmaussion fmaussion merged commit 4213304 into pydata:master Dec 7, 2016
@fmaussion
Copy link
Member Author

OK, so this fix worked locally but not on RTD because RTD uses another build directory:

/home/docs/checkouts/readthedocs.org/user_builds/xray/checkouts/latest/doc/plotting.rst:None: WARNING: image file not readable: ../../../../../readthedocs/templates/sphinx/_static/plotting_example_existing_axes.png

This is really annoying. I'll try to dig into another possible fix mentioned here: ipython/ipython#8733 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants