Skip to content

Commit

Permalink
Fixes readthedocs documentation (#278)
Browse files Browse the repository at this point in the history
* update conf

* Added requirements file

* updated reqs file

* update reqs

* catch pyspark import exception to make docs build

* try mocking out pyspark

* revert pyspark import change

* format code

* Show Python style violates in check_format.sh
  • Loading branch information
dcrankshaw authored Sep 2, 2017
1 parent b6ea450 commit 781a398
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 2 additions & 0 deletions bin/check_format.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ if [ $num_py_violations -eq 0 ]; then
echo "Passed Python PEP8 check"
else
echo "Found $num_py_violations Python PEP8 format violations"
find . -name '*.py' -print | egrep -v "yapf|ycm|googletest" \
| xargs python $CLIPPER_ROOT/bin/yapf/yapf -d
exit 1
fi

Expand Down
16 changes: 14 additions & 2 deletions clipper_admin/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,22 @@

import sys
import os
import shlex
# import shlex

import sphinx_rtd_theme

from mock import Mock as MagicMock


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


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

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
Expand Down Expand Up @@ -115,7 +127,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# html_static_path = ['_static']

# -- Options for HTMLHelp output ------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions clipper_admin/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
requests==2.18.4
subprocess32==3.2.7
pyyaml==3.12
docker==2.5.1
kubernetes==3.0.0
six==1.10.0
mock

0 comments on commit 781a398

Please sign in to comment.