Skip to content

Commit

Permalink
Merge pull request #5724 from pradyunsg/docs/reorganize
Browse files Browse the repository at this point in the history
Reorganize pip's docs folder
  • Loading branch information
pradyunsg authored Aug 24, 2018
2 parents eeacf0e + 20f672c commit 404838a
Show file tree
Hide file tree
Showing 31 changed files with 16 additions and 13 deletions.
1 change: 0 additions & 1 deletion docs/__init__.py

This file was deleted.

14 changes: 7 additions & 7 deletions docs/conf.py → docs/html/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,19 @@

on_rtd = os.environ.get('READTHEDOCS', None) == 'True'

docs_dir = os.path.dirname(os.path.dirname(__file__))
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
sys.path.insert(0, os.path.abspath(os.pardir))
sys.path.insert(0, docs_dir)
# sys.path.append(os.path.join(os.path.dirname(__file__), '../'))

# -- General configuration ----------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
# extensions = ['sphinx.ext.autodoc']
extensions = ['sphinx.ext.extlinks', 'docs.pipext', 'sphinx.ext.intersphinx']
extensions = ['sphinx.ext.extlinks', 'pip_sphinxext', 'sphinx.ext.intersphinx']

# intersphinx
intersphinx_cache_limit = 0
Expand Down Expand Up @@ -68,9 +69,8 @@
# Rather than trying to force RTD to install pip properly, we'll simply
# read the version direct from the __init__.py file. (Yes, this is
# fragile, but it works...)
root = os.path.dirname(os.path.dirname(__file__))
pip_init = os.path.join(root, 'src', 'pip', '__init__.py')

pip_init = os.path.join(docs_dir, '..', 'src', 'pip', '__init__.py')
with open(pip_init) as f:
for line in f:
m = re.match(r'__version__ = "(.*)"', line)
Expand Down Expand Up @@ -102,7 +102,7 @@

# List of directories, relative to source directory, that shouldn't be searched
# for source files.
exclude_patterns = ['build/', 'man/']
exclude_patterns = ['build/']

# The reST default role (used for this markup: `text`) to use for all documents
# default_role = None
Expand Down Expand Up @@ -253,7 +253,7 @@
# List of manual pages generated
man_pages = [
(
'man/pip',
'index',
'pip',
u'package manager for Python packages',
u'pip developers',
Expand All @@ -264,7 +264,7 @@
# Here, we crawl the entire man/commands/ directory and list every file with
# appropriate name and details
for fname in glob.glob('man/commands/*.rst'):
fname_base = fname[:-4]
fname_base = fname[4:-4]
outname = 'pip-' + fname_base[13:]
description = u'description of {} command'.format(
outname.replace('-', ' ')
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
Configuration
=============

This content is now covered in the :ref:`Configuration` section of the :doc:`User Guide <user_guide>`.
This content is now covered in the :ref:`Configuration` section of the :doc:`User Guide </user_guide>`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion docs/news.rst → docs/html/news.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
Release Notes
=============

.. include:: ../NEWS.rst
.. include:: ../../NEWS.rst
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 7 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ basepython = python3
commands = pytest --timeout 300 --cov=pip --cov-report=term-missing --cov-report=xml --cov-report=html tests/unit {posargs}

[testenv:docs]
# Don't skip install here since docs.pipext uses pip's internals.
# Don't skip install here since pip_sphinxext uses pip's internals.
deps = -r{toxinidir}/tools/docs-requirements.txt
basepython = python2.7
commands =
sphinx-build -W -d {envtmpdir}/doctrees -b html docs docs/build/html
sphinx-build -W -d {envtmpdir}/doctrees -b man docs docs/build/man
sphinx-build -W -d {envtmpdir}/doctrees/html -b html docs/html docs/build/html
# Having the conf.py in the docs/html is weird but needed because we
# can not use a different configuration directory vs source directory on RTD
# currently -- https://github.com/rtfd/readthedocs.org/issues/1543.
# That is why we have a "-c docs/html" in the next line.
sphinx-build -W -d {envtmpdir}/doctrees/man -b man docs/man docs/build/man -c docs/html

[testenv:packaging]
skip_install = True
Expand Down

0 comments on commit 404838a

Please sign in to comment.