ZenCODE,
I've been working with Yoel on the same project and adding that line works, but doing this for all the places that are affecting our the Sphinx docs might be troublesome. I traced it down and made an example kivy app/script (a.k.a. "main.py") that shows the basic issue that is affecting the garden module (it's the garden.graph module)
The code below runs fine via "python ./main.py". It just opens a Kivy app window with nothing in it.
from kivy.app import App
from kivy.uix.widget import Widget
class MyClass(Widget):
def __init__(self, **kwargs):
super(MyClass, self).__init__(**kwargs)
class MyDocTestApp(App):
'''The main application
'''
test = MyClass()
if __name__ == '__main__':
app = MyDocTestApp()
app.run()
When running Sphinx against this code I would expect some
Sphinx html documents with a the docs for "MyDocTestApp" in them.
FYI: The Sphinx docs are being generated via:
1. One time only: run "sphinx-quickstart" with some options. This is done one time only to quickly generate the generic Sphinx documentation files/templates.
2. One time only: make some modifications to the Sphinx conf.py file, mostly so it will properly reference the python/kivy project directory to document.
3. sphinx-apidoc with some options is run to rebuild the documentation trees/etc.
4. "make html" is run to build the documentation
When executing "make html" The
failure that occurs (that causes the documemtation to have no content) is:
[CRITICAL] [App ] Unable to get a Window, abort.
/<path to my Sphinx templates>/main.rst:4: WARNING: autodoc: failed to import module u'main'; the module executes module level statement and it might call sys.exit().If I replace this line of code:
super(MyClass, self).__init__(**kwargs)
with:
pass
there are no errors and the Sphinx html documentation generates correctly. Any ideas what is causing Sphinx to choke on this line.?
I traced down the error message in the Sphinx package and it's using "__import__"