Skip to content

Commit

Permalink
close "Read the Docs apt module page is empty", #48
Browse files Browse the repository at this point in the history
RTD requires modules relying on Windows-only DLLs etc. be "mocked". It
doesn't need to be able to actually run the code, just process for
docstrings etc.

Initially I thought it was ctypes itself that needed to be mocked, but
it turns out I needed to work closer to home and _mock the module which
calls ctypes_, `knownpaths.py`.

Thank you to @Dunes on Stack Overflow, whose comment I thought was
off-track and not going to help. However it gave just enough of a
turning to my mind and path of investigation to land me in the right
place after all. Not all teachings look like teaching!

http://stackoverflow.com/questions/30950870/mock-import-of-ctypes-fails-with-unsupported-operand-on-read-the-docs
  • Loading branch information
maphew committed Jun 21, 2015
1 parent 0c45193 commit 03b048b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import os
import shlex

# Read The Docs requires modules relying on Windows-only DLLs etc. be "mocked".
# https://read-the-docs.readthedocs.org/en/latest/faq.html#i-get-import-errors-on-libraries-that-depend-on-c-modules
try:
from unittest.mock import MagicMock #py3 import
Expand Down
4 changes: 2 additions & 2 deletions docs/source/index.rst.leo
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<vnodes>
<v t="maphew.20150613204824.4"><vh>@persistence</vh>
<v t="maphew.20150613204824.5" a="E"><vh>@data:@auto conf.py</vh>
<v t="maphew.20150620221605.6"><vh>@gnxs</vh></v>
<v t="maphew.20150620221605.8"><vh>@gnxs</vh></v>
</v>
</v>
<v t="maphew.20150601230033.5" a="E"><vh>Apt - Read The Docs</vh>
Expand All @@ -27,7 +27,7 @@
<t tx="maphew.20150613204824.4"></t>
<t tx="maphew.20150613204824.5">gnx: maphew.20150613204824.2
</t>
<t tx="maphew.20150620221605.6">gnx: maphew.20150613204824.3
<t tx="maphew.20150620221605.8">gnx: maphew.20150613204824.3
unl: conf declarations
</t>
</tnodes>
Expand Down

0 comments on commit 03b048b

Please sign in to comment.