-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Cannot autogenerate API documentation for a project that uses numpy and matplotlib #1803
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
Comments
You want to check the box next to " Give the virtual environment access to the global site-packages dir." in the Advanced Settings for your project on ReadTheDocs. This will give sphinx access to slightly outdated versions of numpy and matplotlib -- you won't need to mock them anymore. |
Thanks for the suggestion, but I already had that box checked. I don't know if others can see my advanced settings, but here is the path. I also downgraded my local version of matplotlib to 1.3.1 and verified that I can still build the API documentation on my local machine. I then toggled the box next to "Install your project inside a virtualenv using setup.py install" on and off, but it did not help. Still stuck... |
Okay, so your build is using numpy and matplotlib on read the docs? One other thing to check is the Sphinx version. Try pinning sphinx==1.2.3. The latest released version of Sphinx has a bug that breaks some uses of autodoc. On Wed, Nov 4, 2015 at 9:55 AM, Benjamin Reedlunn
|
I doubt this is an issue with Sphinx 1.3.x. The issue is mocking isn't complete, looking at your SO post. You'll need to fully mock out the dictionary, or supply a dummy object that can mock the version return. |
I actually do not know how to check whether my build is using numpy and matplotlib on the read the docs server. I would like it to, since that would simplify things, but I cannot figure out how to make that work. I just tried pinning sphinx==1.2.3 and it did use version 1.2.3, but the API documentation did not auto-generate. Yes, I realize I have not completed the mocking of the dictionary or the version return. At first glance, it just looked like a lot of work, and I was hoping for another way. If there isn't, that's fine. I can figure out how to mock those things, plus any others that turn up. |
To check if you have numpy and matplotlib installed, add some lines to your sphinx conf.py file. Here's what I did for xray: https://github.com/xray/xray/blob/52d38a7796eb1003fd3cc18660063c9c7a4e5938/doc/conf.py#L18-L24 |
I just added your suggestions to my Oh man! I just realized that if I click on the build commands it opens up and shows me the output from the command. I wish I had figured that out before. Now I should be able to properly troubleshoot this. |
It turns out my Anyways, I've gotten my API documentation to build, but I had to do something strange. If I make sure to
Does anyone know what is going on here? I don't mind having |
Might be worth trying conda, as it makes the scientific python stack much easier to install. |
This might be a case of mocking out those sub-dependencies as well, or of course, as @ericholscher said, use conda. Closing this due to inactivity, but feel free to reopen. |
Tried checking boxes described in this thread - readthedocs/readthedocs.org#1803
I originally posted this on stack overflow, but I have not gotten any replies there, so I thought I would post it here.
I am able to use Sphinx to auto generate my project's API documentation locally, but I run into trouble when I try to use ReadTheDocs. When ReadTheDocs builds the documentation, the API pages are all blank (see this, for example). After I read this blog entry, I realized I should try to mock things like numpy and matplotlib. So I added the following line to my
conf.py
With that addition, I cannot build the API documentation locally or on ReadTheDocs, because I set a bunch of matplotlib.rcParam (a dictionary) values, and I check the version of matplotlib using
matplotlib.__version__.split(".")
. For more details see my stack overflow post and my code on github. These issues are likely possible to fix, but they look like a pain from reading the mock documentation.Perhaps there is a better way. From reading issue #1671 it looks like numpy and matplotlib are now installed on the readthedoc servers, but I have not had any luck building my API documentation when I turn off mocking in
conf.py
and delete the reference to my "pip requirements file" under my project's Advanced Settings.Can anyone give me a hand?
P.S. I think I would be able to troubleshoot things more easily if ReadTheDocs let me see the full sphinx output when it is trying to build my documentation. Otherwise, I am left trying to reproduce an issue locally with an unknown cause.
The text was updated successfully, but these errors were encountered: