Skip to content

Commit

Permalink
Workaround for LMDB import.
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefano Cossu committed Mar 31, 2018
1 parent 279873e commit c41fa19
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 3 additions & 2 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
# You can set these variables from the command line.
SPHINXOPTS =
# Workaround to prevent lmdb from throwing an exception when loaded from Sphinx
SPHINXBUILD = python -m sphinx
#SPHINXBUILD = sphinx-build
# Does not work with readthedocs unfortunately.
#SPHINXBUILD = python -m sphinx
SPHINXBUILD = sphinx-build
SPHINXPROJ = lakesuperior
SOURCEDIR = .
BUILDDIR = _build
Expand Down
23 changes: 12 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,20 @@

#sys.path.insert(0, os.path.abspath('../'))
sys.path.append(os.path.abspath('../'))

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

# LMDB raises an issue if imported by Sphinx. This bypasses the issue.
# https://github.com/dw/py-lmdb/issues/172
MOCK_MODULES = ['lmdb']
sys.modules.update((mod_name, MockModule()) for mod_name in MOCK_MODULES)

import lakesuperior.env_setup


# -- General configuration ------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
Expand Down Expand Up @@ -174,17 +186,6 @@
'Miscellaneous'),
]




# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}

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

MOCK_MODULES = ['lmdb']
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)

Empty file modified lsup-admin
100644 → 100755
Empty file.

0 comments on commit c41fa19

Please sign in to comment.