Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the Docs apt module page is empty #48

Open
maphew opened this issue Jun 14, 2015 · 3 comments
Open

Read the Docs apt module page is empty #48

maphew opened this issue Jun 14, 2015 · 3 comments

Comments

@maphew
Copy link
Owner

maphew commented Jun 14, 2015

When I build the sphinx docs locally with make html there is a module page populated with content, but at http://apt.readthedocs.org/en/latest/apt.html the page is empty.

http://imgur.com/fo9TIYm

Under Builds, https://readthedocs.org/builds/apt/2900858/, there is an error with ctypes.

/var/build/user_builds/apt/checkouts/latest/docs/source/apt.rst:4: WARNING: autodoc: failed to import module u'apt'; the following exception was raised:
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/sphinx/ext/autodoc.py", line 385, in import_object
    __import__(self.modname)
  File "/var/build/user_builds/apt/checkouts/latest/apt.py", line 38, in <module>
    import knownpaths # for fetching Windows special folders
  File "/var/build/user_builds/apt/checkouts/latest/knownpaths.py", line 5, in <module>
    from ctypes import windll, wintypes
  File "/usr/lib/python2.7/ctypes/wintypes.py", line 23, in <module>
    class VARIANT_BOOL(_SimpleCData):
ValueError: _type_ 'v' not supported
maphew added a commit that referenced this issue Jun 14, 2015
http://apt.readthedocs.org/en/latest/apt.html the page is empty. Build error indicates failed import of ctypes is the problem.

---
Also reword copyright and author info, because "© Copyright 2015, Matt Wilkie, shoulders of giants." just doesn't work. Supposed to be "because of standing on shoulders of giants", but that just doesn't work in this context. ;-)
@maphew
Copy link
Owner Author

maphew commented Jun 14, 2015

test https://readthedocs.org/builds/apt/2958055/ failed.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/sphinx/cmdline.py", line 244, in main
    opts.warningiserror, opts.tags, opts.verbosity, opts.jobs)
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/sphinx/application.py", line 126, in __init__
    confoverrides or {}, self.tags)
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/sphinx/config.py", line 277, in __init__
    execfile_(filename, config)
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/sphinx/util/pycompat.py", line 128, in execfile_
    exec_(code, _globals)
  File "/home/docs/checkouts/readthedocs.org/user_builds/apt/envs/latest/local/lib/python2.7/site-packages/six.py", line 672, in exec_
    exec("""exec _code_ in _globs_, _locs_""")
  File "<string>", line 1, in <module>
  File "conf.py", line 22, in <module>
    class Mock(MagickMock):
NameError: name 'MagickMock' is not defined

Exception occurred:
  File "conf.py", line 22, in <module>
    class Mock(MagickMock):
NameError: name 'MagickMock' is not defined
The full traceback has been saved in /tmp/sphinx-err-fSZj7k.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

I think this means mock needs to be in requirements.txt

maphew added a commit that referenced this issue Jun 14, 2015
maphew added a commit that referenced this issue Jun 14, 2015
requirements.txt is doc-specific, not for whole project, so don't need
it at roor. Also, needed to activate venv on Admin Advanced Settings
page (https://readthedocs.org/dashboard/apt/advanced/); was misled into
thinking that was already set because the previous biuld error messages
already mentioned venv.
@maphew
Copy link
Owner Author

maphew commented Jun 14, 2015

...nope, still fails. much longer output though in addition to the same as above, not going to post all, here's the source: https://readthedocs.org/builds/apt/2958092/

However from "Requirement already satisfied (use --upgrade to upgrade): mock in /home/docs/checkouts/..." I think we can conclude requirement.txt is not the issue.

maphew added a commit that referenced this issue Jun 14, 2015
maphew added a commit that referenced this issue Jun 14, 2015
...kind of a pointless nicety since neither seem to work, but...
maphew added a commit that referenced this issue Jun 14, 2015
@maphew
Copy link
Owner Author

maphew commented Jun 14, 2015

Mock import now works, yay! but it looks like mock itself might need some patching.
https://readthedocs.org/builds/apt/2958151/

  File "/var/build/user_builds/apt/checkouts/latest/knownpaths.py", line 13, in GUID
    ("Data4", wintypes.BYTE * 8)
TypeError: unsupported operand type(s) for *: 'Mock' and 'int'

which leads to only 3 search hits, the most relevant about Mock missing (at least) a true division operator: https://mail.python.org/pipermail/python-bugs-list/2014-March/235709.html

I might have to give up on using automatic RTD and build and upload from local machine. :-/

maphew added a commit that referenced this issue Jun 21, 2015
...as per suggestion on Python.org bug tracker
http://bugs.python.org/issue16396

Another run at #48
maphew added a commit that referenced this issue Jun 21, 2015
maphew added a commit that referenced this issue Jun 21, 2015
maphew added a commit that referenced this issue Jun 21, 2015
maphew added a commit that referenced this issue Jun 21, 2015
After previous commit RTD build worked, and module docs pages were built as well.
maphew added a commit that referenced this issue Jun 21, 2015
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant