python readthedocs how to satisfy the requirement sip (or pyqt)

后端 未结 1 959
甜味超标
甜味超标 2021-01-18 17:12

I want to publish the documentation of my project https://bitbucket.org/oaltun/opn in readthedocs.org.

The build fails. There are different errors shown in the log

相关标签:
1条回答
  • 2021-01-18 17:56

    The trick is to mock these interfaces:

    import mock 
    MOCK_MODULES = ['sip', 'PyQt4', 'PyQt4.QtGui']
    sys.modules.update((mod_name, mock.MagicMock()) for mod_name in MOCK_MODULES)
    

    Note that you must also mock the root package 'PyQt4' or will get an ImportError.

    0 讨论(0)
提交回复
热议问题