From 19e942b48009bec7231a9ecddbe59c33600bdc27 2016-08-11 22:49:16 From: Matthias Bussonnier Date: 2016-08-11 22:49:16 Subject: [PATCH] Clean documentation process We don't push on ghpages anymore. --- diff --git a/docs/Makefile b/docs/Makefile index 46add14..a6546d0 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -29,7 +29,6 @@ help: @echo " info Texinfo files and run them through makeinfo" @echo " changes an overview over all changed/added/deprecated items" @echo " linkcheck check all external links for integrity (takes a long time)" - @echo " gh-pages clone IPython docs in ./gh-pages/ , build doc, autocommit" @echo @echo "Compound utility targets:" @echo "pdf latex and then runs the PDF generation" @@ -108,16 +107,6 @@ htmlhelp: @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in build/htmlhelp." -qthelp: - mkdir -p build/qthelp - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) build/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/IPython.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/IPython.qhc" - latex: api autoconfig mkdir -p build/latex build/doctrees $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) build/latex @@ -139,15 +128,6 @@ linkcheck: @echo "Link check complete; look for any errors in the above output " \ "or in build/linkcheck/output.rst." -nightly: dist - rsync -avH --delete dist/ ipython:www/doc/nightly - -gh-pages: clean html - # if VERSION is unspecified, it will be dev - # For releases, VERSION should be just the major version, - # e.g. VERSION=2 make gh-pages - $(PYTHON) gh-pages.py $(VERSION) - texinfo: mkdir -p $(BUILDDIR)/texinfo $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo diff --git a/docs/gh-pages.py b/docs/gh-pages.py deleted file mode 100755 index 2db0d31..0000000 --- a/docs/gh-pages.py +++ /dev/null @@ -1,135 +0,0 @@ -#!/usr/bin/env python -"""Script to commit the doc build outputs into the github-pages repo. - -Use: - - gh-pages.py [tag] - -If no tag is given, the current output of 'git describe' is used. If given, -that is how the resulting directory will be named. - -In practice, you should use either actual clean tags from a current build or -something like 'current' as a stable URL for the most current version of the """ - -#----------------------------------------------------------------------------- -# Imports -#----------------------------------------------------------------------------- -from __future__ import print_function - -import os -import shutil -import sys -from os import chdir as cd -from os.path import join as pjoin - -from subprocess import Popen, PIPE, CalledProcessError, check_call - -#----------------------------------------------------------------------------- -# Globals -#----------------------------------------------------------------------------- - -pages_dir = 'gh-pages' -html_dir = 'build/html' -pdf_dir = 'build/latex' -pages_repo = 'git@github.com:ipython/ipython-doc.git' - -#----------------------------------------------------------------------------- -# Functions -#----------------------------------------------------------------------------- -def sh(cmd): - """Execute command in a subshell, return status code.""" - return check_call(cmd, shell=True) - - -def sh2(cmd): - """Execute command in a subshell, return stdout. - - Stderr is unbuffered from the subshell.x""" - p = Popen(cmd, stdout=PIPE, shell=True) - out = p.communicate()[0] - retcode = p.returncode - if retcode: - raise CalledProcessError(retcode, cmd) - else: - return out.rstrip() - - -def sh3(cmd): - """Execute command in a subshell, return stdout, stderr - - If anything appears in stderr, print it out to sys.stderr""" - p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True) - out, err = p.communicate() - retcode = p.returncode - if retcode: - raise CalledProcessError(retcode, cmd) - else: - return out.rstrip(), err.rstrip() - - -def init_repo(path): - """clone the gh-pages repo if we haven't already.""" - sh("git clone %s %s"%(pages_repo, path)) - here = os.getcwdu() - cd(path) - sh('git checkout gh-pages') - cd(here) - -#----------------------------------------------------------------------------- -# Script starts -#----------------------------------------------------------------------------- -if __name__ == '__main__': - # The tag can be given as a positional argument - try: - tag = sys.argv[1] - except IndexError: - tag = "dev" - - startdir = os.getcwdu() - if not os.path.exists(pages_dir): - # init the repo - init_repo(pages_dir) - else: - # ensure up-to-date before operating - cd(pages_dir) - sh('git checkout gh-pages') - sh('git pull') - cd(startdir) - - dest = pjoin(pages_dir, tag) - - # don't `make html` here, because gh-pages already depends on html in Makefile - # sh('make html') - if tag != 'dev': - # only build pdf for non-dev targets - #sh2('make pdf') - pass - - # This is pretty unforgiving: we unconditionally nuke the destination - # directory, and then copy the html tree in there - shutil.rmtree(dest, ignore_errors=True) - shutil.copytree(html_dir, dest) - if tag != 'dev': - #shutil.copy(pjoin(pdf_dir, 'ipython.pdf'), pjoin(dest, 'ipython.pdf')) - pass - - try: - cd(pages_dir) - branch = sh2('git rev-parse --abbrev-ref HEAD').strip() - if branch != 'gh-pages': - e = 'On %r, git branch is %r, MUST be "gh-pages"' % (pages_dir, - branch) - raise RuntimeError(e) - - sh('git add -A %s' % tag) - sh('git commit -m"Updated doc release: %s"' % tag) - print() - print('Most recent 3 commits:') - sys.stdout.flush() - sh('git --no-pager log --oneline HEAD~3..') - finally: - cd(startdir) - - print() - print('Now verify the build in: %r' % dest) - print("If everything looks good, 'git push'")