From b7100c07d9b9ba14f16fbe30f1338dc3bdc3b320 Mon Sep 17 00:00:00 2001 From: Jonathan Ballet Date: Wed, 26 Nov 2014 15:01:24 +0100 Subject: [PATCH] Build doc in Travis --- .travis.yml | 24 ++++++++++++++++++++---- setup.py | 5 +++++ 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index e372ddce..9e07cc6c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,12 +25,22 @@ install: # Install whatever was just built. The filename is tricky to figure # out because wheels mangle the version in certain ways. Replicate # some of that mangling here. - pip install dist/Nevow-"$(python setup.py --version | tr - _)"-py27-none-any.whl + pip install 'dist/Nevow-"$(python setup.py --version | tr - _)"-py27-none-any.whl' + + # Also install the extra documentation requirements. Unfortunately, it + # seems pip doesn't automatically handle that case when installing from + # a built file. + pip install Sphinx elif [ "${MODE}" == "sdist" ]; then # Build and install a normal source distribution python setup.py sdist - pip install dist/Nevow-"$(python setup.py --version)".tar.gz + pip install 'dist/Nevow-"$(python setup.py --version)".tar.gz' + + # Also install the extra documentation requirements. Unfortunately, it + # seems pip doesn't automatically handle that case when installing from + # a built file. + pip install Sphinx elif [ "${MODE}" == "inplace" ]; then # Don't actually install anything. Just update the environment to make @@ -38,15 +48,21 @@ install: # directly against that. This is kind of a "control" case. These # results should be very similar to the results for any of the # installation cases. + # Note that we also install the documentation requirements. - pip install --editable . + pip install --editable '.[doc]' elif [ "${MODE}" == "source" ]; then # Install directly from the git checkout. - pip install . + pip install '.' + + # Also install the extra documentation requirements. Unfortunately, it + # seems this can't be specified to the install command above. + pip install Sphinx fi script: - "trial formless nevow" + - "cd doc; make html" diff --git a/setup.py b/setup.py index 18609421..f94056ee 100644 --- a/setup.py +++ b/setup.py @@ -90,5 +90,10 @@ install_requires=[ "twisted>=13.0", ], + extras_require={ + 'doc': [ + 'Sphinx', + ], + }, zip_safe=False, )