Problem creating documentation with Sphinx

49 views
Skip to first unread message

Jezabeel

unread,
Aug 25, 2017, 7:32:17 AM8/25/17
to Kivy users support
Hello!

I'm starting to learn Python 3 and Kivy. All was going well untill I tried to document my project with Sphinx.

I keep getting the same warning about Kivy, actually about imports from kivy.

Attribute Error: module kivy has no attribute deps

I work on Windows 7, python 3.6.1, kivy 1.10.0

I have python, sphinx and kivy added to my PATH

Spinx creates documentatation, but only for the modules without imports from kivy.

Below is a screenshot of the warnings I receive.

I've been searching for any solution on the web, but nothing seems to work. I would appreciate any help or suggestions.

And if it's impossible to use Sphinx, I would also appreciate any suggestions on any other tool for documenting my project automatically. I work i n PyCharm community edition.


ZenCODE

unread,
Aug 25, 2017, 8:18:46 AM8/25/17
to Kivy users support
You can start by looking here:

    https://github.com/kivy/kivy/tree/master/doc

Particularly in the auto_build.py to create an ignore list. etc. Also look here:

    https://github.com/kivy/kivy/blob/master/kivy/__init__.py

for using environ.get('KIVY_DOC') and environ.get('KIVY_DOC_INCLUDE') and such like to prevent things being imported or executed when instantiated from the sphinx build process. You could probably set these from your build environment to prevent unwanted Kivy issues...

Because Sphinx uses live object introspection to generate the docs, it instantiates objects, and as Kivy uses OpenGL and assumes a graphics context, things like Window cannot work. So problematic areas need to be avoided manually sometimes. Not ideal, but the pro's outway the cons me thinks...:-)
 
Good luck. Shout if you need more...

Jezabeel

unread,
Aug 25, 2017, 1:15:39 PM8/25/17
to Kivy users support
Thank you very much for Your help! Setting 'KIVY_DOC_INCLUDE' to 1 in Environment variables stopped the problem with Sphinx trying to execute Kivy parts.

Now it started to show warnings, because it executes queries to sqlite database - I'll have to find a way to stop it from doing that :D
Reply all
Reply to author
Forward
0 new messages