diff --git a/build.sh b/build.sh index 2b961e1..00c9b5e 100755 --- a/build.sh +++ b/build.sh @@ -28,9 +28,11 @@ install_build_tests() { } run_build_tests() { - coverage run --source=vdirsyncer/,tests/ --module pytest if [ "$TRAVIS" = "true" ]; then + coverage run --source=vdirsyncer/,tests/ --module pytest coveralls + else + py.test fi } @@ -42,11 +44,34 @@ run_build_style() { flake8 vdirsyncer tests } +install_build_docs() { + $PIP_INSTALL sphinx sphinx_rtd_theme + $PIP_INSTALL -e . +} + +run_build_docs() { + cd docs + make html +} + [ -n "$BUILD" ] || BUILD=tests [ -n "$DAV_SERVER" ] || DAV_SERVER=radicale [ -n "$REQUIREMENTS" ] || REQUIREMENTS=release COMMAND="$1" +if [ -z "$COMMAND" ]; then + echo "Usage:" + echo "build.sh run # run build" + echo "build.sh install # install dependencies" + echo + echo "Environment variable combinations:" + echo "BUILD=tests # install and run tests" + echo " # (using Radicale, see .travis.yml for more)" + echo "BUILD=style # install and run stylechecker (flake8)" + echo "BUILD=docs # install sphinx and build HTML docs" + exit 1 +fi + TESTSERVER_BASE=./tests/storage/dav/servers/ install_builds() { diff --git a/docs/conf.py b/docs/conf.py index a043b1b..52a96e4 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -28,7 +28,14 @@ version = '.'.join(release.split('.')[:2]) # The short X.Y version. exclude_patterns = ['_build'] pygments_style = 'sphinx' -html_theme = 'default' + +import os +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + +if not on_rtd: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] html_static_path = ['_static'] htmlhelp_basename = 'vdirsyncerdoc'