Skip to content

Commit

Permalink
Added mock import for koji in docs, because Readthedocs.io does not s…
Browse files Browse the repository at this point in the history
…upport it
  • Loading branch information
sarah256 committed Nov 9, 2018
1 parent 743dd8d commit 57ee351
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
11 changes: 9 additions & 2 deletions docs-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
-r requirements.txt
recommonmark
https://github.com/release-engineering/estuary-api/tarball/master#egg=estuary
fedmsg
fedmsg[commands]
fedmsg[consumers]
moksha.hub
PyOpenSSL
stomper
neomodel
requests
sphinx
sphinx_rtd_theme
14 changes: 14 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
import pkg_resources
from datetime import datetime

from unittest.mock import MagicMock


class Mock(MagicMock):
@classmethod
def __getattr__(cls, name):
return MagicMock()


MOCK_MODULES = ['koji', 'requests_kerberosrecommonmark', 'rpm', 'krb5']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
Expand Down Expand Up @@ -58,6 +70,8 @@
'sphinx.ext.githubpages',
]

# autodoc_mock_imports = ['koji', 'requests_kerberosrecommonmark']

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down

0 comments on commit 57ee351

Please sign in to comment.