From edef2f0bf74aea2badd2a78ed70a7a294ff5a562 Mon Sep 17 00:00:00 2001 From: Christophe Siraut Date: Tue, 31 Oct 2017 19:38:53 +0100 Subject: [PATCH] use virtualenv for sphinx builds --- .gitignore | 1 + install_sphinx_venv.sh | 5 +++++ publish.py | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 .gitignore create mode 100755 install_sphinx_venv.sh diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ceb386 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +venv diff --git a/install_sphinx_venv.sh b/install_sphinx_venv.sh new file mode 100755 index 0000000..d0276f4 --- /dev/null +++ b/install_sphinx_venv.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +virtualenv venv +venv/bin/pip install https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz +venv/bin/pip install sphinx recommonmark diff --git a/publish.py b/publish.py index 29778dd..a313221 100755 --- a/publish.py +++ b/publish.py @@ -166,7 +166,9 @@ def publish_sphinx(module): checkout_dir = os.path.join(checkouts_directory, module.get('name')) output_dir = os.path.join(web_directory, module.get('name')) build_dir = os.path.join(checkout_dir, '_build/html') - os.system('cd %s && make html' % checkout_dir) + cmd = '%s/venv/bin/sphinx-build -b html -d _build/doctrees . _build/html' % os.getcwd() + os.system('cd %s && %s' % (checkout_dir, cmd)) + shutil.rmtree(output_dir) shutil.copytree(build_dir, output_dir)