[Python-checkins] release: use Sphinx in a virtualenv to build docs

benjamin.peterson python-checkins at python.org
Wed Dec 10 20:27:06 CET 2014


https://hg.python.org/release/rev/1d0865572238
changeset: 91:1d0865572238
user: Benjamin Peterson <benjamin at python.org>
date: Wed Dec 10 14:26:36 2014 -0500
summary:
 use Sphinx in a virtualenv to build docs
files:
 release.py | 12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/release.py b/release.py
--- a/release.py
+++ b/release.py
@@ -14,6 +14,7 @@
 import readline
 import subprocess
 import shutil
+import tempfile
 
 from contextlib import contextmanager
 
@@ -307,9 +308,14 @@
 def build_docs():
 """Build and tarball the documentation"""
 print("Building docs")
- with changed_dir('Doc'):
- run_cmd(['make', 'dist'])
- return os.path.abspath('dist')
+ with tempfile.TemporaryDirectory() as venv:
+ run_cmd(['virtualenv', venv])
+ pip = os.path.join(venv, 'bin', 'pip')
+ run_cmd([pip, 'install', 'Sphinx'])
+ sphinx_build = os.path.join(venv, 'bin', 'sphinx-build')
+ with changed_dir('Doc'):
+ run_cmd(['make', 'dist', 'SPHINXBUILD=' + sphinx_build])
+ return os.path.abspath('dist')
 
 def upload(tag, username):
 """scp everything to dinsdale"""
-- 
Repository URL: https://hg.python.org/release


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /