From 887020f966ae2a710e86a91b6a9468b91b0c10f1 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Thu, 1 Aug 2019 18:45:23 -0400 Subject: [PATCH 1/4] build sphinx through setup.py --- .travis.yml | 2 +- setup.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f4329e9..ce93686 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,6 @@ install: - pip install pytest flaky . script: - py.test -s -v --cov=convoys . - - sphinx-build -M html docs/ docs/_build/ + - python setup.py build_sphinx after_success: - coveralls diff --git a/setup.py b/setup.py index 985bdb8..a491e4a 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')}}, +) From 14529ae911efd5398d02fae10e937a2e97303318 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Fri, 2 Aug 2019 09:32:28 -0400 Subject: [PATCH 2/4] mock imports so doc building has no dependencies --- docs/conf.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index 0448b97..6fc03d2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -119,6 +119,11 @@ } +# 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 ---------------------------------------------- From a53f293e7c89c1fa6b7786a9d361d70028e35506 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Fri, 2 Aug 2019 09:36:14 -0400 Subject: [PATCH 3/4] build doc before installing --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ce93686..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 . - - python setup.py build_sphinx after_success: - coveralls From 46039a2c9fda0e408cccf3f9555b2aeabd1aad44 Mon Sep 17 00:00:00 2001 From: Erik Bernhardsson Date: Fri, 2 Aug 2019 09:36:47 -0400 Subject: [PATCH 4/4] hound --- docs/conf.py | 3 ++- setup.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6fc03d2..dc9f6d9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -121,7 +121,8 @@ # 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'] +autodoc_mock_imports = ['autograd', 'autograd-gamma', 'emcee', 'matplotlib', + 'numpy', 'pandas', 'scipy'] # -- Extension configuration ------------------------------------------------- diff --git a/setup.py b/setup.py index a491e4a..83ae91c 100644 --- a/setup.py +++ b/setup.py @@ -35,4 +35,4 @@ 'build_sphinx': { 'source_dir': ('setup.py', 'docs'), 'build_dir': ('setup.py', 'docs/_build')}}, -) + )