conf.py 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274
  1. # -*- coding: utf-8 -*-
  2. #
  3. # pip documentation build configuration file, created by
  4. # sphinx-quickstart on Tue Apr 22 22:08:49 2008
  5. #
  6. # This file is execfile()d with the current directory set to its containing dir
  7. #
  8. # Note that not all possible configuration values are present in this
  9. # autogenerated file.
  10. #
  11. # All configuration values have a default; values that are commented out
  12. # serve to show the default.
  13. import glob
  14. import os
  15. import re
  16. import sys
  17. on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
  18. docs_dir = os.path.dirname(os.path.dirname(__file__))
  19. # If extensions (or modules to document with autodoc) are in another directory,
  20. # add these directories to sys.path here. If the directory is relative to the
  21. # documentation root, use os.path.abspath to make it absolute, like shown here.
  22. sys.path.insert(0, docs_dir)
  23. # sys.path.append(os.path.join(os.path.dirname(__file__), '../'))
  24. # -- General configuration ----------------------------------------------------
  25. # Add any Sphinx extension module names here, as strings. They can be
  26. # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
  27. # extensions = ['sphinx.ext.autodoc']
  28. extensions = ['sphinx.ext.extlinks', 'pip_sphinxext', 'sphinx.ext.intersphinx']
  29. # intersphinx
  30. intersphinx_cache_limit = 0
  31. intersphinx_mapping = {
  32. 'pypug': ('https://packaging.python.org/', None),
  33. 'pypa': ('https://www.pypa.io/en/latest/', None),
  34. }
  35. # Add any paths that contain templates here, relative to this directory.
  36. templates_path = []
  37. # The suffix of source filenames.
  38. source_suffix = '.rst'
  39. # The encoding of source files.
  40. # source_encoding = 'utf-8'
  41. # The master toctree document.
  42. master_doc = 'index'
  43. # General information about the project.
  44. project = 'pip'
  45. copyright = '2008-2017, PyPA'
  46. # The version info for the project you're documenting, acts as replacement for
  47. # |version| and |release|, also used in various other places throughout the
  48. # built documents.
  49. #
  50. # The short X.Y version.
  51. version = release = 'dev'
  52. # Readthedocs seems to install pip as an egg (via setup.py install) which
  53. # is somehow resulting in "import pip" picking up an older copy of pip.
  54. # Rather than trying to force RTD to install pip properly, we'll simply
  55. # read the version direct from the __init__.py file. (Yes, this is
  56. # fragile, but it works...)
  57. pip_init = os.path.join(docs_dir, '..', 'src', 'pip', '__init__.py')
  58. with open(pip_init) as f:
  59. for line in f:
  60. m = re.match(r'__version__ = "(.*)"', line)
  61. if m:
  62. __version__ = m.group(1)
  63. # The short X.Y version.
  64. version = '.'.join(__version__.split('.')[:2])
  65. # The full version, including alpha/beta/rc tags.
  66. release = __version__
  67. break
  68. # We have this here because readthedocs plays tricks sometimes and there seems
  69. # to be a hiesenbug, related to the version of pip discovered. This is here to
  70. # help debug that if someone decides to do that in the future.
  71. print(version)
  72. # The language for content autogenerated by Sphinx. Refer to documentation
  73. # for a list of supported languages.
  74. # language = None
  75. # There are two options for replacing |today|: either, you set today to some
  76. # non-false value, then it is used:
  77. # today = ''
  78. # Else, today_fmt is used as the format for a strftime call.
  79. today_fmt = '%B %d, %Y'
  80. # List of documents that shouldn't be included in the build.
  81. # unused_docs = []
  82. # List of directories, relative to source directory, that shouldn't be searched
  83. # for source files.
  84. exclude_patterns = ['build/']
  85. # The reST default role (used for this markup: `text`) to use for all documents
  86. # default_role = None
  87. # If true, '()' will be appended to :func: etc. cross-reference text.
  88. # add_function_parentheses = True
  89. # If true, the current module name will be prepended to all description
  90. # unit titles (such as .. function::).
  91. # add_module_names = True
  92. # If true, sectionauthor and moduleauthor directives will be shown in the
  93. # output. They are ignored by default.
  94. # show_authors = False
  95. # The name of the Pygments (syntax highlighting) style to use.
  96. pygments_style = 'sphinx'
  97. # A list of ignored prefixes for module index sorting.
  98. # modindex_common_prefix = []
  99. extlinks = {
  100. 'issue': ('https://github.com/pypa/pip/issues/%s', '#'),
  101. 'pull': ('https://github.com/pypa/pip/pull/%s', 'PR #'),
  102. 'pypi': ('https://pypi.org/project/%s', ''),
  103. }
  104. # -- Options for HTML output --------------------------------------------------
  105. # The theme to use for HTML and HTML Help pages. Major themes that come with
  106. # Sphinx are currently 'default' and 'sphinxdoc'.
  107. html_theme = "pypa_theme"
  108. # Theme options are theme-specific and customize the look and feel of a theme
  109. # further. For a list of options available for each theme, see the
  110. # documentation.
  111. html_theme_options = {
  112. 'collapsiblesidebar': True,
  113. 'externalrefs': True,
  114. 'navigation_depth': 3,
  115. 'issues_url': 'https://github.com/pypa/pip/issues'
  116. }
  117. # Add any paths that contain custom themes here, relative to this directory.
  118. # The name for this set of Sphinx documents. If None, it defaults to
  119. # "<project> v<release> documentation".
  120. # html_title = None
  121. # A shorter title for the navigation bar. Default is the same as html_title.
  122. # html_short_title = None
  123. # The name of an image file (relative to this directory) to place at the top
  124. # of the sidebar.
  125. # html_logo = '_static/piplogo.png'
  126. # The name of an image file (within the static path) to use as favicon of the
  127. # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
  128. # pixels large.
  129. # html_favicon = 'favicon.png'
  130. # Add any paths that contain custom static files (such as style sheets) here,
  131. # relative to this directory. They are copied after the builtin static files,
  132. # so a file named "default.css" will overwrite the builtin "default.css".
  133. html_static_path = []
  134. # If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  135. # using the given strftime format.
  136. html_last_updated_fmt = '%b %d, %Y'
  137. # If true, SmartyPants will be used to convert quotes and dashes to
  138. # typographically correct entities.
  139. smart_quotes = False
  140. # Custom sidebar templates, maps document names to template names.
  141. html_sidebars = {
  142. '**': ['localtoc.html', 'relations.html'],
  143. 'index': ['localtoc.html']
  144. }
  145. # Additional templates that should be rendered to pages, maps page names to
  146. # template names.
  147. # html_additional_pages = {}
  148. # If false, no module index is generated.
  149. html_use_modindex = False
  150. # If false, no index is generated.
  151. html_use_index = False
  152. # If true, the index is split into individual pages for each letter.
  153. # html_split_index = False
  154. # If true, links to the reST sources are added to the pages.
  155. html_show_sourcelink = False
  156. # If true, an OpenSearch description file will be output, and all pages will
  157. # contain a <link> tag referring to it. The value of this option must be the
  158. # base URL from which the finished HTML is served.
  159. # html_use_opensearch = ''
  160. # If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
  161. # html_file_suffix = ''
  162. # Output file base name for HTML help builder.
  163. htmlhelp_basename = 'pipdocs'
  164. # -- Options for LaTeX output -------------------------------------------------
  165. # The paper size ('letter' or 'a4').
  166. # latex_paper_size = 'letter'
  167. # The font size ('10pt', '11pt' or '12pt').
  168. # latex_font_size = '10pt'
  169. # Grouping the document tree into LaTeX files. List of tuples
  170. # (source start file, target name, title, author, documentclass [howto/manual])
  171. latex_documents = [
  172. (
  173. 'index',
  174. 'pip.tex',
  175. u'pip Documentation',
  176. u'pip developers',
  177. 'manual',
  178. ),
  179. ]
  180. # The name of an image file (relative to this directory) to place at the top of
  181. # the title page.
  182. # latex_logo = None
  183. # For "manual" documents, if this is true, then toplevel headings are parts,
  184. # not chapters.
  185. # latex_use_parts = False
  186. # Additional stuff for the LaTeX preamble.
  187. # latex_preamble = ''
  188. # Documents to append as an appendix to all manuals.
  189. # latex_appendices = []
  190. # If false, no module index is generated.
  191. # latex_use_modindex = True
  192. # -- Options for Manual Pages -------------------------------------------------
  193. # List of manual pages generated
  194. man_pages = [
  195. (
  196. 'index',
  197. 'pip',
  198. u'package manager for Python packages',
  199. u'pip developers',
  200. 1
  201. )
  202. ]
  203. # Here, we crawl the entire man/commands/ directory and list every file with
  204. # appropriate name and details
  205. for fname in glob.glob('man/commands/*.rst'):
  206. fname_base = fname[4:-4]
  207. outname = 'pip-' + fname_base[13:]
  208. description = u'description of {} command'.format(
  209. outname.replace('-', ' ')
  210. )
  211. man_pages.append((fname_base, outname, description, u'pip developers', 1))