Skip to content

Commit 404838a

Browse files
authored
Merge pull request #5724 from pradyunsg/docs/reorganize
Reorganize pip's docs folder
2 parents eeacf0e + 20f672c commit 404838a

31 files changed

+16
-13
lines changed

docs/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

docs/conf.py renamed to docs/html/conf.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@
1818

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

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

2728
# -- General configuration ----------------------------------------------------
2829

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

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

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

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

107107
# The reST default role (used for this markup: `text`) to use for all documents
108108
# default_role = None
@@ -253,7 +253,7 @@
253253
# List of manual pages generated
254254
man_pages = [
255255
(
256-
'man/pip',
256+
'index',
257257
'pip',
258258
u'package manager for Python packages',
259259
u'pip developers',
@@ -264,7 +264,7 @@
264264
# Here, we crawl the entire man/commands/ directory and list every file with
265265
# appropriate name and details
266266
for fname in glob.glob('man/commands/*.rst'):
267-
fname_base = fname[:-4]
267+
fname_base = fname[4:-4]
268268
outname = 'pip-' + fname_base[13:]
269269
description = u'description of {} command'.format(
270270
outname.replace('-', ' ')
File renamed without changes.

docs/configuration.rst renamed to docs/html/development/configuration.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
Configuration
44
=============
55

6-
This content is now covered in the :ref:`Configuration` section of the :doc:`User Guide <user_guide>`.
6+
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.

docs/news.rst renamed to docs/html/news.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
Release Notes
33
=============
44

5-
.. include:: ../NEWS.rst
5+
.. 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.

tox.ini

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,16 @@ basepython = python3
1919
commands = pytest --timeout 300 --cov=pip --cov-report=term-missing --cov-report=xml --cov-report=html tests/unit {posargs}
2020

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

2933
[testenv:packaging]
3034
skip_install = True

0 commit comments

Comments
 (0)