Mike Posted October 6, 2017 Report Share Posted October 6, 2017 Hello! I'm starting to figure out how to use sphinx for my own documentation. I'm using autodoc and building the documentation from the command line. I keep getting import errors for modules such as Qt.py and maya.cmds whenever I try to build my code. I'm using the correct virtual env, the modules are installed in the venv. I'm at a loss! I've seen that you guys use sphinx for your documentation, any tips? Thanks! Link to comment Share on other sites More sharing options...
Mattias Lagergren Posted October 9, 2017 Report Share Posted October 9, 2017 Hi Mike, you should be able to use the mock module for this. See how we are using it here: https://bitbucket.org/ftrack/ftrack-connect-nuke-studio/src/b4ec5c12187b9749a372a810a293f68ed07b07af/doc/conf.py?at=master&fileviewer=file-view-default Link to comment Share on other sites More sharing options...
Martin Pengelly-Phillips Posted October 9, 2017 Report Share Posted October 9, 2017 Note that newer versions of Sphinx support this mocking directly via the autodoc_mock_imports setting. http://www.sphinx-doc.org/en/stable/ext/autodoc.html#confval-autodoc_mock_imports Link to comment Share on other sites More sharing options...
Mike Posted October 12, 2017 Author Report Share Posted October 12, 2017 Thanks guys! I've tried using the auto_mock_imports variable and it's doing the trick for the most part. There are a couple of stragglers but I think I can figure it out from here. I'll try to let you know how it goes. Link to comment Share on other sites More sharing options...
Mike Posted October 17, 2017 Author Report Share Posted October 17, 2017 The solution Mattias linked to worked perfectly. Not sure what went wrong with your suggestion, Marin, but it just didn't pick up everything. Thanks for the help! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.