title: How do I configure sphinx properly with autodoc in python 3.5?
body: <p>This is the first time I give sphinx a try so I'm following this guide: <a href="https://daler.github.io/sphinxdoc-test/includeme.html" rel="nofollow noreferrer">https://daler.github.io/sphinxdoc-test/includeme.html</a>. Running <code>make html</code> with <a href="https://gist.github.com/fedebarabas/a91ea0db9702d3ab7b8018d71cce41f9" rel="nofollow noreferrer">this Makefile</a> fails with <code>Error 1</code> showing the warning <code>DeprecationWarning: 'U' mode is deprecated</code>.</p>
  
  <p>Here's the complete traceback from the sphinx log file:</p>
  
  <pre><code># Sphinx version: 1.4.9
  # Python version: 3.5.2 (CPython)
  # Docutils version: 0.12 release
  # Jinja2 version: 2.8
  # Last messages:
  #   Running Sphinx v1.4.9
  #   loading pickled environment...
  #   done
  #   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:
  #   0 added, 2 changed, 0 removed
  #   reading sources... [ 50%] mainGUI
  #   reading sources... [100%] modules
  # Loaded extensions:
  #   sphinx.ext.autodoc (1.4.9) from /usr/local/lib/python3.5/dist-packages/sphinx/ext/autodoc.py
  #   alabaster (0.7.9) from /home/federico/.local/lib/python3.5/site-packages/alabaster/__init__.py
  Traceback (most recent call last):
    File "/usr/local/lib/python3.5/dist-packages/sphinx/cmdline.py", line 244, in main
      app.build(opts.force_all, filenames)
    File "/usr/local/lib/python3.5/dist-packages/sphinx/application.py", line 297, in build
      self.builder.build_update()
    File "/usr/local/lib/python3.5/dist-packages/sphinx/builders/__init__.py", line 251, in build_update
      'out of date' % len(to_build))
    File "/usr/local/lib/python3.5/dist-packages/sphinx/builders/__init__.py", line 265, in build
      self.doctreedir, self.app))
    File "/usr/local/lib/python3.5/dist-packages/sphinx/environment.py", line 569, in update
      self._read_serial(docnames, app)
    File "/usr/local/lib/python3.5/dist-packages/sphinx/environment.py", line 589, in _read_serial
      self.read_doc(docname, app)
    File "/usr/local/lib/python3.5/dist-packages/sphinx/environment.py", line 738, in read_doc
      encoding=self.config.source_encoding)
    File "/usr/local/lib/python3.5/dist-packages/sphinx/io.py", line 107, in __init__
      FileInput.__init__(self, *args, **kwds)
    File "/home/federico/.local/lib/python3.5/site-packages/docutils/io.py", line 236, in __init__
      self.source = open(source_path, mode, **kwargs)
  DeprecationWarning: 'U' mode is deprecated
  </code></pre>
  
  <p>And sphinx doesn't load the documentation embedded in the code.</p>
  
  <p>I've been reading that the structure of the project may be responsible but it seems like mine is ok:</p>
  
  <pre><code>project/
      docs/
          Makefile
          source/
              conf.py
              index.rst
              modules.rst
      project/
          __init__.py
          foo/
              __init__.py
              modA.py 
              modB.py
          bar/
              __init__.py
              modC.py 
              modD.py
  </code></pre>
  
  <p>Within for instance modA.py I import code like this:</p>
  
  <pre><code>import project.foo.modB
  </code></pre>
  
  <p>Relevant bits of some files:</p>
  
  <p>conf.py:</p>
  
  <pre><code>...
  sys.path.insert(0, os.path.abspath('../..'))
  ...
  </code></pre>
  
  <p>index.rst:</p>
  
  <pre><code>.. toctree::
     :maxdepth: 2
  
     modules
  </code></pre>
  
  <p>modules.rst:</p>
  
  <pre><code>Modules
  *******
  
  Foo
  ===
  
  .. automodule:: project.foo.modA
     :members:
  </code></pre>
  
  <p>What am I missing here? The imports work fine in the interpreter:</p>
  
  <pre><code>import os
  import sys
  sys.path.append(os.path.join('/home', 'federico', 'project'))
  import project.foo.modB
  </code></pre>