Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build docs with Python 3 #8839

Merged
merged 2 commits into from
Sep 28, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ 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
# use ARCHIVE=1 VERSION=3 gh-pages to build the
# docs with a warning that this is not stable docs anymore.
python gh-pages.py $(VERSION)

texinfo:
Expand Down
14 changes: 10 additions & 4 deletions docs/gh-pages.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env python
from __future__ import print_function
"""Script to commit the doc build outputs into the github-pages repo.

Use:
Expand All @@ -14,7 +15,6 @@
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import print_function

import os
import shutil
Expand All @@ -33,6 +33,12 @@
pdf_dir = 'build/latex'
pages_repo = 'git@github.com:ipython/ipython-doc.git'


if sys.version_info[0] <= 3:
getcwd = os.getcwd
else:
getcwd = os.getcwdu

#-----------------------------------------------------------------------------
# Functions
#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -70,7 +76,7 @@ def sh3(cmd):
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()
here = getcwd()
cd(path)
sh('git checkout gh-pages')
cd(here)
Expand All @@ -85,7 +91,7 @@ def init_repo(path):
except IndexError:
tag = "dev"

startdir = os.getcwdu()
startdir = getcwd()
if not os.path.exists(pages_dir):
# init the repo
init_repo(pages_dir)
Expand Down Expand Up @@ -116,7 +122,7 @@ def init_repo(path):
try:
cd(pages_dir)
branch = sh2('git rev-parse --abbrev-ref HEAD').strip()
if branch != 'gh-pages':
if branch != b'gh-pages':
e = 'On %r, git branch is %r, MUST be "gh-pages"' % (pages_dir,
branch)
raise RuntimeError(e)
Expand Down
8 changes: 8 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
numpydoc
sphinx
pygments
oct2py
cython
nose
pymongo
fabric
9 changes: 9 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@

"""

elif os.environ.get('ARCHIVE', None):
rst_prolog = """
.. warning::

This documentation is for an old version of IPython.
You can find docs for newer versions `here <http://ipython.readthedocs.org/en/stable/>`_.

"""

# The master toctree document.
master_doc = 'index'

Expand Down