diff --git a/.travis.yml b/.travis.yml index f4329e9..65af556 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,10 +6,10 @@ before_install: - pip install -U pytest pytest-cov - pip install coveralls - pip install sphinx + - python setup.py build_sphinx install: - pip install pytest flaky . script: - py.test -s -v --cov=convoys . - - sphinx-build -M html docs/ docs/_build/ after_success: - coveralls diff --git a/docs/conf.py b/docs/conf.py index 0448b97..dc9f6d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -119,6 +119,12 @@ } +# Mock modules during doc generation +# TODO: would be nice if this is pulled automatically from setup.py +autodoc_mock_imports = ['autograd', 'autograd-gamma', 'emcee', 'matplotlib', + 'numpy', 'pandas', 'scipy'] + + # -- Extension configuration ------------------------------------------------- # -- Options for todo extension ---------------------------------------------- diff --git a/setup.py b/setup.py index 985bdb8..83ae91c 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ from setuptools import setup, find_packages +from sphinx.setup_command import BuildDoc long_description = ''' For more information, see @@ -26,4 +27,12 @@ 'pandas', 'numpy', 'scipy', - ]) + ], + + # Sphinx-specific setup + cmdclass={'build_sphinx': BuildDoc}, + command_options={ + 'build_sphinx': { + 'source_dir': ('setup.py', 'docs'), + 'build_dir': ('setup.py', 'docs/_build')}}, + )