Repository: python-pillow/Pillow

Issue:
There is no auto-generated docs
Auto-generated class docs are disappear from documentation. At least for [Image](https://pillow.readthedocs.org/reference/Image.html).



Discussion:
The latest ReadTheDocs build passed but shows some import errors:

https://readthedocs.org/builds/pillow/1906522/

Last "good" build was 1 week, 2 days ago:

https://readthedocs.org/builds/pillow/1879312/

The following "bad" build was 1 day, 15 hours ago:

https://readthedocs.org/builds/pillow/1903282/

That last "bad" build was from this commit: https://github.com/python-pillow/Pillow/commit/8a3302ba5d1e941d2db7772b6835461c671c4df9

I don't understand. This is last extension build: https://readthedocs.org/builds/pillow/1903313/ (building 'PIL._imaging' extension)
Looks like extension are builded successfully, but still can't be imported. Also there is a warning about always_inline, but I think this can be a root of the problem.

@hugovk Thanks for pointing where logs can be found. Can you replace full logs with just a links? They are too long.

@homm I've replaced the long logs replaced with links. I didn't realise they're publicly viewable, good that they are.

I also don't see why it should be failing. @aclark4life @irskep Any ideas?

Looks like 8a3302ba5d1e941d2db7772b6835461c671c4df9 broke `import _imaging`. 

So, the last "good" build was commit b8d2a55f3c7fb178b778ce5b8b328ebabefec864:
https://readthedocs.org/builds/pillow/1879312/

b8d2a55f3c7fb178b778ce5b8b328ebabefec86 is a parent of 8a3302ba5d1e941d2db7772b6835461c671c4df9, and 8a3302ba5d1e941d2db7772b6835461c671c4df9 was the first "bad" build:
https://readthedocs.org/builds/pillow/1903282/

I checked the "good" 8a3302ba5d1e941d2db7772b6835461c671c4df9 into a new branch in my repo and created an RTD project for my own repo.

Unsurprisingly the latest one failed:
https://readthedocs.org/builds/hugovk-pillow/1909066/

But the "good" b8d2a55f3c7fb178b778ce5b8b328ebabefec864 commit also failed:
https://readthedocs.org/builds/hugovk-pillow/1909067/

Perhaps an RTD environment change?

Can we split the docs so that pillow.readthedocs.org goes to the latest released docs, for now 2.6.1?

We can build docs for any branch. 

I just added 2.6.1, but not as pillow.readthedocs.org because it completely fails (unlike the other passes with ImportError):
https://readthedocs.org/builds/pillow/1913609/

I just upgraded my sphinx (which downloaded some new dependencies as well) and broke it OMM. Reverting to the old sphinx I had (1.2.2) didn't help. 

So, make inplace && make docs works, but not make install && make docs. 

This sounds like an installation issue we worked on a while back.

The thing that I don't understand is that it's importing Image from within the docs directory, so it should be looking at the installed version, not the version that's in the Pillow source directory. 

I'm pretty sure that it's something with a sphinx (or a dependency) upgrade, since I was working on docs last week in this install, and the version on the site was similarly working at that point. 

Ah, I just realized that the docs I was building last week were in a copy of my usual vm, which I still have hanging around. So I can probably track down the specific change, once I plug that drive in again. 

If you diff the "good" and "bad" builds above, you can see what's changed in Sphinx and dependencies' upgrades.  

FWIW, this is what I'm getting to the first error: 

```
(vpy27)erics@builder-1204-x64:~/Pillow$ make docs 2>&1 | more
make -C docs html
make[1]: Entering directory `/home/erics/Pillow/docs'
sphinx-build -b html -d _build/doctrees   . _build/html
Running Sphinx v1.2.1
loading pickled environment... not yet created
loading intersphinx inventory from http://docs.python.org/2/objects.inv...
building [html]: targets for 40 source files that are out of date
updating environment: 40 added, 0 changed, 0 removed
reading sources... [  2%] PIL
reading sources... [  5%] about
reading sources... [  7%] developer
reading sources... [ 10%] guides
reading sources... [ 12%] handbook/appendices
reading sources... [ 15%] handbook/concepts
reading sources... [ 17%] handbook/image-file-formats
reading sources... [ 20%] handbook/overview
reading sources... [ 22%] handbook/tutorial
reading sources... [ 25%] handbook/writing-your-own-file-decoder
reading sources... [ 27%] index
reading sources... [ 30%] installation
reading sources... [ 32%] original-readme
reading sources... [ 35%] porting-pil-to-pillow
reading sources... [ 37%] reference/ExifTags
reading sources... [ 40%] reference/Image
reading sources... [ 42%] reference/ImageChops
reading sources... [ 45%] reference/ImageCms
reading sources... [ 47%] reference/ImageColor
reading sources... [ 50%] reference/ImageDraw
reading sources... [ 52%] reference/ImageEnhance
reading sources... [ 55%] reference/ImageFile
reading sources... [ 57%] reference/ImageFilter
reading sources... [ 60%] reference/ImageFont
reading sources... [ 62%] reference/ImageGrab
reading sources... [ 65%] reference/ImageMath
reading sources... [ 67%] reference/ImageMorph
reading sources... [ 70%] reference/ImageOps
reading sources... [ 72%] reference/ImagePalette
reading sources... [ 75%] reference/ImagePath
reading sources... [ 77%] reference/ImageQt
reading sources... [ 80%] reference/ImageSequence
reading sources... [ 82%] reference/ImageStat
reading sources... [ 85%] reference/ImageTk
reading sources... [ 87%] reference/ImageWin
reading sources... [ 90%] reference/OleFileIO
reading sources... [ 92%] reference/PSDraw
reading sources... [ 95%] reference/PixelAccess
reading sources... [ 97%] reference/PyAccess
reading sources... [100%] reference/index

/home/erics/Pillow/docs/PIL.rst:10: WARNING: autodoc: failed to import module u'PIL.BdfFontFile'; the following exception was raised:
Traceback (most recent call last):
  File "/home/erics/vpy27/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 335, in import_object
    __import__(self.modname)
  File "/home/erics/Pillow/PIL/BdfFontFile.py", line 20, in <module>
    from PIL import Image
  File "/home/erics/Pillow/PIL/Image.py", line 63, in <module>
    from PIL import _imaging as core
ImportError: cannot import name _imaging
```

The diff shows that the working one (https://readthedocs.org/builds/pillow/1879312/) already had `Jinja2>=2.7.1`, and the non-working one (https://readthedocs.org/builds/pillow/1903282/)  had to download and build the whole sphinx package, including `Downloading/unpacking Jinja2>=2.3 (from sphinx==1.2.2)`.


Resolving patch:
diff --git a/docs/conf.py b/docs/conf.py
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -1,8 +1,4 @@
 # -*- coding: utf-8 -*-
-import os
-import sys
-
-sys.path.insert(0, os.path.abspath('../'))
 import PIL
 
 ### general configuration ###


Test patch: