Sphinx - autodoc import error

158 views
Skip to first unread message

johan Borgström

unread,
Jul 29, 2015, 8:05:17 AM7/29/15
to Python Programming for Autodesk Maya
Hi,

I am using Sphinx to create documentation and I get import errors when building. I use Mock in the conf.py file:

import mock
 
for mod in ['maya', 'maya.cmds', 'maya.OpenMaya', 'maya.api.OpenMaya', 'pymel', 'pymel.core', 'maya.mel', 'pm']:
    sys.modules[mod] = mock.MagicMock()


It works fine for most of the modules but when I add maya.OpenMayaUI to the list the build process crashes. I am really new to Sphinx, so any tips or ideas are welcomed!

Best,
Johan

Justin Israel

unread,
Jul 29, 2015, 3:27:37 PM7/29/15
to Python Programming for Autodesk Maya

I've never tried to mock Maya's modules. Is it a seg fault crash, or a python crash? I forget if Mock needs to import and inspect it. Does it import properly even?


--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/9916ae08-7d47-44f7-876f-feb3af7014b0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

katrin schmid

unread,
Jul 29, 2015, 11:19:47 PM7/29/15
to python_in...@googlegroups.com
hi,
we use working maya mocs modules, too.
Useful for testing, too, in some cases.
What is defined in your OpenMayaUI module?
Regards,
katrin
 
Gesendet: Mittwoch, 29. Juli 2015 um 12:27 Uhr
Von: "Justin Israel" <justin...@gmail.com>
An: "Python Programming for Autodesk Maya" <python_in...@googlegroups.com>
Betreff: Re: [Maya-Python] Sphinx - autodoc import error

johan Borgström

unread,
Jul 30, 2015, 7:55:53 AM7/30/15
to Python Programming for Autodesk Maya, jo...@petfactory.se
Hi Justin and Katrin,

Thanks for your replies!

The error was in one of my scripts that were using the maya.OpenMayaUI module. When I removed that script the import of all the modules works fine.

Best Regards,
Johan
Reply all
Reply to author
Forward
0 new messages