Skip to content

Commit

Permalink
workaround for RTD apidoc build
Browse files Browse the repository at this point in the history
  • Loading branch information
ungarj committed Feb 28, 2017
1 parent c75cef7 commit dff6bcc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
32 changes: 32 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
# import sys
# sys.path.insert(0, os.path.abspath('.'))

import sys
from mock import Mock as MagicMock

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

Expand Down Expand Up @@ -154,3 +156,33 @@

# numpydoc fix
numpydoc_show_class_members = False

# Mocking

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


MOCK_MODULES = [
'tilematrix',
'fiona',
'pyyaml',
'flask',
'Pillow',
'scipy',
'rasterio',
'rasterio.features',
'rasterio.warp',
'rasterio.warp.Resampling',
'rasterio.windows',
'rasterio.crs',
'matplotlib',
'matplotlib.pyplot',
'gdal',
'cached_property',
'pyproj',
'cachetools'
]
sys.modules.update((mod_name, Mock()) for mod_name in MOCK_MODULES)
1 change: 1 addition & 0 deletions doc/source/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
numpydoc>=0.6.0
sphinxcontrib-autodoc-doxygen>=0.3.2
mock
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from setuptools import setup

on_rtd = os.environ.get('READTHEDOCS') == 'True'

setup(
name='mapchete',
version='0.4',
Expand Down Expand Up @@ -50,7 +52,7 @@
'cached_property',
'pyproj',
'cachetools'
],
] if on_rtd else [],
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
Expand Down

0 comments on commit dff6bcc

Please sign in to comment.