[Python-modules-commits] [sphinx] 01/03: New upstream version 1.6.4
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Tue Sep 26 07:29:35 UTC 2017
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch debian/master
in repository sphinx.
commit 8e62ba62dc3b39c1acdee849b84aea9c04166703
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date: Tue Sep 26 10:15:49 2017 +0300
New upstream version 1.6.4
---
CHANGES | 33 +++++++++
EXAMPLES | 17 +----
MANIFEST.in | 1 +
PKG-INFO | 3 +-
Sphinx.egg-info/PKG-INFO | 3 +-
Sphinx.egg-info/SOURCES.txt | 6 ++
Sphinx.egg-info/requires.txt | 4 +-
doc/builders.rst | 8 +-
doc/domains.rst | 18 +++--
doc/ext/autodoc.rst | 7 ++
doc/extdev/appapi.rst | 22 ++++++
doc/extdev/envapi.rst | 4 -
doc/tutorial.rst | 6 +-
sphinx/__init__.py | 6 +-
sphinx/application.py | 2 +-
sphinx/builders/epub3.py | 29 ++++----
sphinx/builders/html.py | 12 ++-
sphinx/cmdline.py | 2 +-
sphinx/domains/cpp.py | 37 +++++-----
sphinx/environment/__init__.py | 5 +-
sphinx/ext/autodoc.py | 20 +++--
sphinx/ext/doctest.py | 32 ++++----
sphinx/ext/graphviz.py | 40 +++++-----
sphinx/locale/fr/LC_MESSAGES/sphinx.po | 2 +-
sphinx/make_mode.py | 10 +--
sphinx/pycode/pgen2/tokenize.py | 2 +-
sphinx/roles.py | 20 ++++-
sphinx/testing/util.py | 2 +-
sphinx/texinputs/sphinx.sty | 4 +-
sphinx/texinputs_win/Makefile_t | 86 ++++++++++++++++++++++
sphinx/themes/nature/static/nature.css_t | 2 +-
sphinx/transforms/post_transforms/images.py | 2 +-
sphinx/util/compat.py | 2 +-
sphinx/util/fileutil.py | 2 +-
sphinx/util/logging.py | 40 +++++++++-
sphinx/util/parallel.py | 1 +
sphinx/writers/latex.py | 5 +-
tests/roots/test-default_role/conf.py | 3 +
tests/roots/test-default_role/foo.rst | 4 +
tests/roots/test-default_role/index.rst | 6 ++
tests/roots/test-ext-graphviz/index.rst | 5 ++
.../roots/test-ext-intersphinx-cppdomain/index.rst | 2 +
tests/roots/test-latex-index/conf.py | 3 +
tests/roots/test-latex-index/index.rst | 12 +++
.../expects/complex_spanning_cell.tex | 10 +--
tests/roots/test-latex-table/expects/gridtable.tex | 8 +-
tests/test_autodoc.py | 5 +-
tests/test_build_latex.py | 9 +++
tests/test_directive_only.py | 2 +-
tests/test_environment_toctree.py | 18 +++--
tests/test_ext_graphviz.py | 52 ++++++++++++-
tests/test_ext_intersphinx.py | 6 ++
tests/test_markup.py | 41 +++++++++++
tests/test_util_inventory.py | 2 +
tests/test_util_logging.py | 24 ++++++
55 files changed, 551 insertions(+), 158 deletions(-)
diff --git a/CHANGES b/CHANGES
index 487bee7..25f6363 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,36 @@
+Release 1.6.4 (released Sep 26, 2017)
+=====================================
+
+Features added
+--------------
+
+* #3926: Add ``autodoc_warningiserror`` to suppress the behavior of ``-W``
+ option during importing target modules on autodoc
+
+Bugs fixed
+----------
+
+* #3924: docname lost after dynamically parsing RST in extension
+* #3946: Typo in sphinx.sty (this was a bug with no effect in default context)
+* :pep: and :rfc: does not supports ``default-role`` directive (refs: #3960)
+* #3960: default_role = 'guilabel' not functioning
+* Missing ``texinputs_win/Makefile`` to be used in latexpdf builder on windows.
+* #4026: nature: Fix macOS Safari scrollbar color
+* #3877: Fix for C++ multiline signatures.
+* #4006: Fix crash on parallel build
+* #3969: private instance attributes causes AttributeError
+* #4041: C++, remove extra name linking in function pointers.
+* #4038: C, add missing documentation of ``member`` role.
+* #4044: An empty multicolumn cell causes extra row height in PDF output
+* #4049: Fix typo in output of sphinx-build -h
+* #4062: hashlib.sha1() must take bytes, not unicode on Python 3
+* Avoid indent after index entries in latex (refs: #4066)
+* #4070: crashes when the warning message contains format strings
+* #4067: Return non-zero exit status when make subprocess fails
+* #4055: graphviz: the :align: option does not work for SVG output
+* #4055: graphviz: the :align: center option does not work for latex output
+* #4051: ``warn()`` function for HTML theme outputs 'None' string
+
Release 1.6.3 (released Jul 02, 2017)
=====================================
diff --git a/EXAMPLES b/EXAMPLES
index 805f0ed..682c05c 100644
--- a/EXAMPLES
+++ b/EXAMPLES
@@ -37,7 +37,6 @@ Documentation using the classic theme
* mpmath: http://mpmath.org/doc/current/
* OpenEXR: http://excamera.com/articles/26/doc/index.html
* OpenGDA: http://www.opengda.org/gdadoc/html/
-* openWNS: http://docs.openwns.org/
* Pioneers and Prominent Men of Utah: http://pioneers.rstebbing.com/
* PyCantonese: http://pycantonese.org/
* Pyevolve: http://pyevolve.sourceforge.net/
@@ -64,9 +63,7 @@ Documentation using a customized version of the classic theme
* CakePHP: http://book.cakephp.org/2.0/en/index.html
* Chaco: http://docs.enthought.com/chaco/
* Chef: https://docs.chef.io/index.html
-* Djagios: http://djagios.org/
* EZ-Draw: http://pageperso.lif.univ-mrs.fr/~edouard.thiel/ez-draw/doc/en/html/ez-manual.html
-* GetFEM++: http://home.gna.org/getfem/
* Google or-tools:
https://or-tools.googlecode.com/svn/trunk/documentation/user_manual/index.html
* GPAW: https://wiki.fysik.dtu.dk/gpaw/
@@ -132,11 +129,10 @@ Documentation using another builtin theme
http://docs.pylonsproject.org/projects/pyramid/en/latest/ (pyramid)
* Quex: http://quex.sourceforge.net/doc/html/main.html
* Satchmo: http://docs.satchmoproject.com/en/latest/ (sphinx_rtd_theme)
-* Setuptools: http://pythonhosted.org/setuptools/ (nature)
+* Setuptools: https://setuptools.readthedocs.io/en/latest/ (nature)
* SimPy: http://simpy.readthedocs.org/en/latest/
* Spring Python: http://docs.spring.io/spring-python/1.2.x/sphinx/html/ (nature)
-* sqlparse: http://python-sqlparse.googlecode.com/svn/docs/api/index.html
- (agogo)
+* sqlparse: https://sqlparse.readthedocs.io/en/latest/ (sphinx_rtd_theme)
* Sylli: http://sylli.sourceforge.net/ (nature)
* Tuleap Open ALM: https://tuleap.net/doc/en/ (nature)
* Valence: http://docs.valence.desire2learn.com/ (haiku)
@@ -161,15 +157,12 @@ Documentation using a custom theme/integrated in a site
* GeoServer: http://docs.geoserver.org/
* gevent: http://www.gevent.org/
* GHC - Glasgow Haskell Compiler: http://downloads.haskell.org/~ghc/master/users-guide/
-* Glashammer: http://glashammer.org/
-* Istihza (Turkish Python documentation project): http://belgeler.istihza.com/py2/
* Lasso: http://lassoguide.com/
* Manage documentation such as source code (fr): http://redaction-technique.org/
* MathJax: http://docs.mathjax.org/en/latest/
* MirrorBrain: http://mirrorbrain.org/docs/
* MyHDL: http://docs.myhdl.org/en/latest/
* nose: http://nose.readthedocs.org/en/latest/
-* NoTex: https://www.notex.ch/overview/
* ObjectListView: http://objectlistview.sourceforge.net/python/
* Open ERP: https://doc.odoo.com/
* OpenCV: http://docs.opencv.org/
@@ -189,8 +182,8 @@ Documentation using a custom theme/integrated in a site
* Selenium: http://docs.seleniumhq.org/docs/
* Self: http://www.selflanguage.org/
* Substance D: http://docs.pylonsproject.org/projects/substanced/en/latest/
-* Tablib: http://tablib.org/
* SQLAlchemy: http://www.sqlalchemy.org/docs/
+* Sylius: http://docs.sylius.org/
* tinyTiM: http://tinytim.sourceforge.net/docs/2.0/
* Ubuntu packaging guide: http://packaging.ubuntu.com/html/
* Werkzeug: http://werkzeug.pocoo.org/docs/
@@ -204,11 +197,9 @@ Homepages and other non-documentation sites
* A personal page: http://www.dehlia.in/
* Benoit Boissinot: http://bboissin.appspot.com/
-* lunarsite: http://lunaryorn.de/
* The Wine Cellar Book: http://www.thewinecellarbook.com/doc/en/
* UC Berkeley Advanced Control Systems course:
http://msc.berkeley.edu/tomizuka/me233spring13/
-* VOR: http://www.vor-cycling.be/
Books produced using Sphinx
@@ -227,7 +218,7 @@ Books produced using Sphinx
http://www.amazon.co.jp/dp/4048689525/
* "Python Professional Programming" (in Japanese):
http://www.amazon.co.jp/dp/4798032948/
-* "Die Wahrheit des Sehens. Der DEKALOG von Krzysztof Kieślowski":
+* "Die Wahrheit des Sehens. Der DEKALOG von Krzysztof Kie?lowski":
http://www.hasecke.eu/Dekalog/
* The "Varnish Book":
http://book.varnish-software.com/4.0/
diff --git a/MANIFEST.in b/MANIFEST.in
index 6fe5c7d..d478724 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -18,6 +18,7 @@ include sphinx/locale/.tx/config
recursive-include sphinx/templates *
recursive-include sphinx/texinputs *
+recursive-include sphinx/texinputs_win *
recursive-include sphinx/themes *
recursive-include sphinx/pycode/pgen2 *.c *.pyx
recursive-include sphinx/locale *.js *.pot *.po *.mo
diff --git a/PKG-INFO b/PKG-INFO
index bbfd6a1..ba48857 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,13 @@
Metadata-Version: 1.1
Name: Sphinx
-Version: 1.6.3
+Version: 1.6.4
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg at python.org
License: BSD
Download-URL: https://pypi.python.org/pypi/Sphinx
+Description-Content-Type: UNKNOWN
Description:
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
diff --git a/Sphinx.egg-info/PKG-INFO b/Sphinx.egg-info/PKG-INFO
index bbfd6a1..ba48857 100644
--- a/Sphinx.egg-info/PKG-INFO
+++ b/Sphinx.egg-info/PKG-INFO
@@ -1,12 +1,13 @@
Metadata-Version: 1.1
Name: Sphinx
-Version: 1.6.3
+Version: 1.6.4
Summary: Python documentation generator
Home-page: http://sphinx-doc.org/
Author: Georg Brandl
Author-email: georg at python.org
License: BSD
Download-URL: https://pypi.python.org/pypi/Sphinx
+Description-Content-Type: UNKNOWN
Description:
Sphinx is a tool that makes it easy to create intelligent and beautiful
documentation for Python projects (or other documents consisting of multiple
diff --git a/Sphinx.egg-info/SOURCES.txt b/Sphinx.egg-info/SOURCES.txt
index 6e88e4c..cf5d6a6 100644
--- a/Sphinx.egg-info/SOURCES.txt
+++ b/Sphinx.egg-info/SOURCES.txt
@@ -447,6 +447,7 @@ sphinx/texinputs/sphinx.sty
sphinx/texinputs/sphinxhowto.cls
sphinx/texinputs/sphinxmanual.cls
sphinx/texinputs/sphinxmulticell.sty
+sphinx/texinputs_win/Makefile_t
sphinx/themes/agogo/layout.html
sphinx/themes/agogo/theme.conf
sphinx/themes/agogo/static/agogo.css_t
@@ -725,6 +726,9 @@ tests/roots/test-circular/sub.rst
tests/roots/test-config/conf.py
tests/roots/test-correct-year/conf.py
tests/roots/test-correct-year/contents.rst
+tests/roots/test-default_role/conf.py
+tests/roots/test-default_role/foo.rst
+tests/roots/test-default_role/index.rst
tests/roots/test-directive-code/caption.rst
tests/roots/test-directive-code/classes.rst
tests/roots/test-directive-code/conf.py
@@ -912,6 +916,8 @@ tests/roots/test-latex-babel/bar.rst
tests/roots/test-latex-babel/conf.py
tests/roots/test-latex-babel/foo.rst
tests/roots/test-latex-babel/index.rst
+tests/roots/test-latex-index/conf.py
+tests/roots/test-latex-index/index.rst
tests/roots/test-latex-table/complex.rst
tests/roots/test-latex-table/conf.py
tests/roots/test-latex-table/index.rst
diff --git a/Sphinx.egg-info/requires.txt b/Sphinx.egg-info/requires.txt
index 3e0a985..6159289 100644
--- a/Sphinx.egg-info/requires.txt
+++ b/Sphinx.egg-info/requires.txt
@@ -3,8 +3,8 @@ Jinja2>=2.3
Pygments>=2.0
docutils>=0.11
snowballstemmer>=1.1
-babel>=1.3,!=2.0
-alabaster>=0.7,<0.8
+babel!=2.0,>=1.3
+alabaster<0.8,>=0.7
imagesize
requests>=2.0.0
setuptools
diff --git a/doc/builders.rst b/doc/builders.rst
index 9aad16a..5344287 100644
--- a/doc/builders.rst
+++ b/doc/builders.rst
@@ -423,8 +423,8 @@ instructions.
.. class:: CheckExternalLinksBuilder
This builder scans all documents for external links, tries to open them with
- :mod:`urllib2`, and writes an overview which ones are broken and redirected
- to standard output and to :file:`output.txt` in the output directory.
+ ``requests``, and writes an overview which ones are broken and redirected to
+ standard output and to :file:`output.txt` in the output directory.
.. autoattribute:: name
@@ -432,6 +432,10 @@ instructions.
.. autoattribute:: supported_image_types
+ .. versionchanged:: 1.5
+
+ Since Sphinx-1.5, the linkcheck builder comes to use requests module.
+
.. module:: sphinx.builders.xml
.. class:: XMLBuilder
diff --git a/doc/domains.rst b/doc/domains.rst
index 838f408..2dc01c0 100644
--- a/doc/domains.rst
+++ b/doc/domains.rst
@@ -473,7 +473,7 @@ The C Domain
The C domain (name **c**) is suited for documentation of C API.
-.. rst:directive:: .. c:function:: type name(signature)
+.. rst:directive:: .. c:function:: function prototype
Describes a C function. The signature should be given as in C, e.g.::
@@ -485,7 +485,7 @@ The C domain (name **c**) is suited for documentation of C API.
Note that you don't have to backslash-escape asterisks in the signature, as
it is not parsed by the reST inliner.
-.. rst:directive:: .. c:member:: type name
+.. rst:directive:: .. c:member:: declaration
Describes a C struct member. Example signature::
@@ -508,7 +508,7 @@ The C domain (name **c**) is suited for documentation of C API.
Describes a C type (whether defined by a typedef or struct). The signature
should just be the type name.
-.. rst:directive:: .. c:var:: type name
+.. rst:directive:: .. c:var:: declaration
Describes a global C variable. The signature should include the type, such
as::
@@ -524,14 +524,14 @@ Cross-referencing C constructs
The following roles create cross-references to C-language constructs if they are
defined in the documentation:
-.. rst:role:: c:data
-
- Reference a C-language variable.
-
.. rst:role:: c:func
Reference a C-language function. Should include trailing parentheses.
+.. rst:role:: c:member
+
+ Reference a C-language member of a struct.
+
.. rst:role:: c:macro
Reference a "simple" C macro, as defined above.
@@ -540,6 +540,10 @@ defined in the documentation:
Reference a C-language type.
+.. rst:role:: c:data
+
+ Reference a C-language variable.
+
The C++ Domain
--------------
diff --git a/doc/ext/autodoc.rst b/doc/ext/autodoc.rst
index 62079c9..1f1892d 100644
--- a/doc/ext/autodoc.rst
+++ b/doc/ext/autodoc.rst
@@ -386,6 +386,13 @@ There are also new config values that you can set:
This config value only requires to declare the top-level modules that
should be mocked.
+.. confval:: autodoc_warningiserror
+
+ This value controls the behavior of :option:`sphinx-build -W` during
+ importing modules.
+ If ``False`` is given, autodoc forcely suppresses the error if the imported
+ module emits warnings. By default, ``True``.
+
Docstring preprocessing
-----------------------
diff --git a/doc/extdev/appapi.rst b/doc/extdev/appapi.rst
index a27340d..ce856d0 100644
--- a/doc/extdev/appapi.rst
+++ b/doc/extdev/appapi.rst
@@ -454,6 +454,28 @@ The application object also provides support for emitting leveled messages.
.. automethod:: Sphinx.debug2
+Sphinx runtime information
+--------------------------
+
+The application object also provides runtime information as attributes.
+
+.. attribute:: srcdir
+
+ Source directory.
+
+.. attribute:: confdir
+
+ Directory containing ``conf.py``.
+
+.. attribute:: doctreedir
+
+ Directory for storing pickled doctrees.
+
+.. attribute:: outdir
+
+ Directory for storing built document.
+
+
.. _events:
Sphinx core events
diff --git a/doc/extdev/envapi.rst b/doc/extdev/envapi.rst
index 729725f..442cfde 100644
--- a/doc/extdev/envapi.rst
+++ b/doc/extdev/envapi.rst
@@ -19,10 +19,6 @@ Build environment API
Source directory.
- .. attribute:: confdir
-
- Directory containing ``conf.py``.
-
.. attribute:: doctreedir
Directory for storing pickled doctrees.
diff --git a/doc/tutorial.rst b/doc/tutorial.rst
index ffabbd9..4dcee9e 100644
--- a/doc/tutorial.rst
+++ b/doc/tutorial.rst
@@ -153,9 +153,9 @@ very general sense) in any :dfn:`domain`. A domain is a collection of object
types that belong together, complete with markup to create and reference
descriptions of these objects.
-The most prominent domain is the Python domain. To e.g. document the Python
-built-in function ``enumerate()``, you would add this to one of your source
-files::
+The most prominent domain is the Python domain. For example, to document
+Python's built-in function ``enumerate()``, you would add this to one of your
+source files::
.. py:function:: enumerate(sequence[, start=0])
diff --git a/sphinx/__init__.py b/sphinx/__init__.py
index e838616..be114cf 100644
--- a/sphinx/__init__.py
+++ b/sphinx/__init__.py
@@ -34,13 +34,13 @@ if 'PYTHONWARNINGS' not in os.environ:
warnings.filterwarnings('ignore', "'U' mode is deprecated",
DeprecationWarning, module='docutils.io')
-__version__ = '1.6.3'
-__released__ = '1.6.3' # used when Sphinx builds its own docs
+__version__ = '1.6.4'
+__released__ = '1.6.4' # used when Sphinx builds its own docs
# version info for better programmatic use
# possible values for 3rd element: 'alpha', 'beta', 'rc', 'final'
# 'final' has 0 as the last element
-version_info = (1, 6, 3, 'final', 0)
+version_info = (1, 6, 4, 'final', 0)
package_dir = path.abspath(path.dirname(__file__))
diff --git a/sphinx/application.py b/sphinx/application.py
index 27dfeb2..0d6d3d0 100644
--- a/sphinx/application.py
+++ b/sphinx/application.py
@@ -250,7 +250,7 @@ class Sphinx(object):
user_locale_dirs, self.config.language, domains=['sphinx'],
charset=self.config.source_encoding):
catinfo.write_mo(self.config.language)
- locale_dirs = [None, path.join(package_dir, 'locale')] + user_locale_dirs
+ locale_dirs = [None, path.join(package_dir, 'locale')] + user_locale_dirs # type: ignore # NOQA
else:
locale_dirs = []
self.translator, has_translation = locale.init(locale_dirs, self.config.language)
diff --git a/sphinx/builders/epub3.py b/sphinx/builders/epub3.py
index 6256b0f..fb2a71b 100644
--- a/sphinx/builders/epub3.py
+++ b/sphinx/builders/epub3.py
@@ -85,40 +85,37 @@ class Epub3Builder(_epub_base.EpubBuilder):
def validate_config_value(self):
# <package> lang attribute, dc:language
if not self.app.config.epub_language:
- self.app.warn(
- 'conf value "epub_language" (or "language") '
- 'should not be empty for EPUB3')
+ logger.warning('conf value "epub_language" (or "language") '
+ 'should not be empty for EPUB3')
# <package> unique-identifier attribute
if not xmlname_checker().match(self.app.config.epub_uid):
- self.app.warn('conf value "epub_uid" should be XML NAME for EPUB3')
+ logger.warning('conf value "epub_uid" should be XML NAME for EPUB3')
# dc:title
if not self.app.config.epub_title:
- self.app.warn(
- 'conf value "epub_title" (or "html_title") '
- 'should not be empty for EPUB3')
+ logger.warning('conf value "epub_title" (or "html_title") '
+ 'should not be empty for EPUB3')
# dc:creator
if not self.app.config.epub_author:
- self.app.warn('conf value "epub_author" should not be empty for EPUB3')
+ logger.warning('conf value "epub_author" should not be empty for EPUB3')
# dc:contributor
if not self.app.config.epub_contributor:
- self.app.warn('conf value "epub_contributor" should not be empty for EPUB3')
+ logger.warning('conf value "epub_contributor" should not be empty for EPUB3')
# dc:description
if not self.app.config.epub_description:
- self.app.warn('conf value "epub_description" should not be empty for EPUB3')
+ logger.warning('conf value "epub_description" should not be empty for EPUB3')
# dc:publisher
if not self.app.config.epub_publisher:
- self.app.warn('conf value "epub_publisher" should not be empty for EPUB3')
+ logger.warning('conf value "epub_publisher" should not be empty for EPUB3')
# dc:rights
if not self.app.config.epub_copyright:
- self.app.warn(
- 'conf value "epub_copyright" (or "copyright")'
- 'should not be empty for EPUB3')
+ logger.warning('conf value "epub_copyright" (or "copyright")'
+ 'should not be empty for EPUB3')
# dc:identifier
if not self.app.config.epub_identifier:
- self.app.warn('conf value "epub_identifier" should not be empty for EPUB3')
+ logger.warning('conf value "epub_identifier" should not be empty for EPUB3')
# meta ibooks:version
if not self.app.config.version:
- self.app.warn('conf value "version" should not be empty for EPUB3')
+ logger.warning('conf value "version" should not be empty for EPUB3')
def content_metadata(self):
# type: () -> Dict
diff --git a/sphinx/builders/html.py b/sphinx/builders/html.py
index 540125b..90e4574 100644
--- a/sphinx/builders/html.py
+++ b/sphinx/builders/html.py
@@ -605,7 +605,7 @@ class StandaloneHTMLBuilder(Builder):
# additional pages from conf.py
for pagename, template in self.config.html_additional_pages.items():
- self.info(' ' + pagename, nonl=1)
+ logger.info(' ' + pagename, nonl=1)
self.handle_page(pagename, {}, template)
# the search page
@@ -898,7 +898,6 @@ class StandaloneHTMLBuilder(Builder):
outfilename=None, event_arg=None):
# type: (unicode, Dict, unicode, unicode, Any) -> None
ctx = self.globalcontext.copy()
- ctx['warn'] = self.warn
# current_page_name is backwards compatibility
ctx['pagename'] = ctx['current_page_name'] = pagename
ctx['encoding'] = self.config.html_output_encoding
@@ -931,6 +930,13 @@ class StandaloneHTMLBuilder(Builder):
return False
ctx['hasdoc'] = hasdoc
+ def warn(*args, **kwargs):
+ # type: (Any, Any) -> unicode
+ """Simple warn() wrapper for themes."""
+ self.warn(*args, **kwargs)
+ return '' # return empty string
+ ctx['warn'] = warn
+
ctx['toctree'] = lambda **kw: self._get_local_toctree(pagename, **kw)
self.add_sidebars(pagename, ctx)
ctx.update(addctx)
@@ -1188,7 +1194,7 @@ class SingleFileHTMLBuilder(StandaloneHTMLBuilder):
# additional pages from conf.py
for pagename, template in self.config.html_additional_pages.items():
- self.info(' ' + pagename, nonl=1)
+ logger.info(' ' + pagename, nonl=1)
self.handle_page(pagename, {}, template)
if self.config.html_use_opensearch:
diff --git a/sphinx/cmdline.py b/sphinx/cmdline.py
index 7b6cf08..79a69cd 100644
--- a/sphinx/cmdline.py
+++ b/sphinx/cmdline.py
@@ -169,7 +169,7 @@ def main(argv):
help='Do emit colored output (default: auto-detect)')
group.add_option('-N', '--no-color', dest='color',
action='store_const', const='no',
- help='Do not emit colored output (default: auot-detect)')
+ help='Do not emit colored output (default: auto-detect)')
group.add_option('-w', metavar='FILE', dest='warnfile',
help='write warnings (and errors) to given file')
group.add_option('-W', action='store_true', dest='warningiserror',
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index b1e83a0..f8a77ce 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -2408,6 +2408,10 @@ class ASTType(ASTBase):
if (self.decl.require_space_after_declSpecs() and
len(text_type(self.declSpecs)) > 0):
signode += nodes.Text(' ')
+ # for paramters that don't really declare new names we get 'markType',
+ # this should not be propagated, but be 'noneIsName'.
+ if mode == 'markType':
+ mode = 'noneIsName'
self.decl.describe_signature(signode, mode, env, symbol)
@@ -4582,8 +4586,11 @@ class CPPObject(ObjectDescription):
if ast.objectType == 'enumerator':
self._add_enumerator_to_parent(ast)
- self.options['tparam-line-spec'] = 'tparam-line-spec' in self.options
- self.describe_signature(signode, ast, self.options)
+ # note: handle_signature may be called multiple time per directive,
+ # if it has multiple signatures, so don't mess with the original options.
+ options = dict(self.options)
+ options['tparam-line-spec'] = 'tparam-line-spec' in self.options
+ self.describe_signature(signode, ast, options)
return ast
def before_content(self):
@@ -4816,12 +4823,12 @@ class CPPDomain(Domain):
name = 'cpp'
label = 'C++'
object_types = {
- 'class': ObjType(l_('class'), 'class'),
- 'function': ObjType(l_('function'), 'func'),
- 'member': ObjType(l_('member'), 'member'),
- 'type': ObjType(l_('type'), 'type'),
- 'concept': ObjType(l_('concept'), 'concept'),
- 'enum': ObjType(l_('enum'), 'enum'),
+ 'class': ObjType(l_('class'), 'class', 'type', 'typeOrConcept'),
+ 'function': ObjType(l_('function'), 'function', 'func', 'type', 'typeOrConcept'),
+ 'member': ObjType(l_('member'), 'member', 'var'),
+ 'type': ObjType(l_('type'), 'type', 'typeOrConcept'),
+ 'concept': ObjType(l_('concept'), 'concept', 'typeOrConcept'),
+ 'enum': ObjType(l_('enum'), 'enum', 'type', 'typeOrConcept'),
'enumerator': ObjType(l_('enumerator'), 'enumerator')
}
@@ -4955,16 +4962,10 @@ class CPPDomain(Domain):
return True
if declTyp == 'templateParam':
return True
- if typ == 'var' or typ == 'member':
- return declTyp in ['var', 'member']
- if typ in ['enum', 'enumerator', 'function', 'class', 'concept']:
- return declTyp == typ
- validForType = ['enum', 'class', 'function', 'type']
- if typ == 'typeOrConcept':
- return declTyp == 'concept' or declTyp in validForType
- if typ == 'type':
- return declTyp in validForType
- print("Type is %s" % typ)
+ objtypes = self.objtypes_for_role(typ)
+ if objtypes and declTyp in objtypes:
+ return True
+ print("Type is %s, declType is %s" % (typ, declTyp))
assert False
if not checkType():
warner.warn("cpp:%s targets a %s (%s)."
diff --git a/sphinx/environment/__init__.py b/sphinx/environment/__init__.py
index 70fdbae..126a962 100644
--- a/sphinx/environment/__init__.py
+++ b/sphinx/environment/__init__.py
@@ -18,6 +18,7 @@ import codecs
import fnmatch
import warnings
from os import path
+from copy import copy
from collections import defaultdict
from six import BytesIO, itervalues, class_types, next
@@ -664,6 +665,7 @@ class BuildEnvironment(object):
self.temp_data['docname'] = docname
# defaults to the global default, but can be re-set in a document
+ self.temp_data['default_role'] = self.config.default_role
self.temp_data['default_domain'] = \
self.domains.get(self.config.primary_domain)
@@ -946,6 +948,7 @@ class BuildEnvironment(object):
"""Apply all post-transforms."""
try:
# set env.docname during applying post-transforms
+ backup = copy(self.temp_data)
self.temp_data['docname'] = docname
transformer = SphinxTransformer(doctree)
@@ -953,7 +956,7 @@ class BuildEnvironment(object):
transformer.add_transforms(self.app.post_transforms)
transformer.apply_transforms()
finally:
- self.temp_data.clear()
+ self.temp_data = backup
# allow custom references to be resolved
self.app.emit('doctree-resolved', doctree, docname)
diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py
index c50b553..bb5f783 100644
--- a/sphinx/ext/autodoc.py
+++ b/sphinx/ext/autodoc.py
@@ -654,7 +654,8 @@ class Documenter(object):
logger.debug('[autodoc] import %s', self.modname)
with warnings.catch_warnings():
warnings.filterwarnings("ignore", category=ImportWarning)
- __import__(self.modname)
+ with logging.skip_warningiserror(not self.env.config.autodoc_warningiserror):
+ __import__(self.modname)
parent = None
obj = self.module = sys.modules[self.modname]
logger.debug('[autodoc] => %r', obj)
@@ -851,7 +852,7 @@ class Documenter(object):
self.add_line(line, src[0], src[1])
def get_object_members(self, want_all):
- # type: (bool) -> Tuple[bool, List[Tuple[unicode, object]]]
+ # type: (bool) -> Tuple[bool, List[Tuple[unicode, Any]]]
"""Return `(members_check_module, members)` where `members` is a
list of `(membername, member)` pairs of the members of *self.object*.
@@ -961,14 +962,20 @@ class Documenter(object):
self.options.special_members is not ALL and \
membername in self.options.special_members:
keep = has_doc or self.options.undoc_members
+ elif (namespace, membername) in attr_docs:
+ if want_all and membername.startswith('_'):
+ # ignore members whose name starts with _ by default
+ keep = self.options.private_members and \
+ (has_doc or self.options.undoc_members)
+ else:
+ # keep documented attributes
+ keep = True
+ isattr = True
+ print(membername, keep)
elif want_all and membername.startswith('_'):
# ignore members whose name starts with _ by default
keep = self.options.private_members and \
(has_doc or self.options.undoc_members)
- elif (namespace, membername) in attr_docs:
- # keep documented attributes
- keep = True
- isattr = True
else:
# ignore undocumented members if :undoc-members: is not given
keep = has_doc or self.options.undoc_members
@@ -1883,6 +1890,7 @@ def setup(app):
app.add_config_value('autodoc_default_flags', [], True)
app.add_config_value('autodoc_docstring_signature', True, True)
app.add_config_value('autodoc_mock_imports', [], True)
+ app.add_config_value('autodoc_warningiserror', True, True)
app.add_event('autodoc-process-docstring')
app.add_event('autodoc-process-signature')
app.add_event('autodoc-skip-member')
diff --git a/sphinx/ext/doctest.py b/sphinx/ext/doctest.py
index 42363fd..4110d9c 100644
--- a/sphinx/ext/doctest.py
+++ b/sphinx/ext/doctest.py
@@ -134,12 +134,12 @@ class TestDirective(Directive):
_("missing '+' or '-' in '%s' option.") % option,
line=self.lineno)
continue
- if option_name not in doctest.OPTIONFLAGS_BY_NAME: # type: ignore
+ if option_name not in doctest.OPTIONFLAGS_BY_NAME:
self.state.document.reporter.warning(
_("'%s' is not a valid option.") % option_name,
line=self.lineno)
continue
- flag = doctest.OPTIONFLAGS_BY_NAME[option[1:]] # type: ignore
+ flag = doctest.OPTIONFLAGS_BY_NAME[option[1:]]
node['options'][flag] = (option[0] == '+')
if self.name == 'doctest' and 'pyversion' in self.options:
try:
@@ -148,7 +148,7 @@ class TestDirective(Directive):
operand, option_version = [item.strip() for item in option.split()]
running_version = platform.python_version()
if not compare_version(running_version, option_version, operand):
- flag = doctest.OPTIONFLAGS_BY_NAME['SKIP'] # type: ignore
+ flag = doctest.OPTIONFLAGS_BY_NAME['SKIP']
node['options'][flag] = True # Skip the test
except ValueError:
self.state.document.reporter.warning(
@@ -188,7 +188,7 @@ class TestoutputDirective(TestDirective):
}
-parser = doctest.DocTestParser() # type: ignore
+parser = doctest.DocTestParser()
# helper classes
@@ -240,14 +240,14 @@ class TestCode(object):
self.code, self.type, self.lineno, self.options)
-class SphinxDocTestRunner(doctest.DocTestRunner): # type: ignore
- def summarize(self, out, verbose=None):
+class SphinxDocTestRunner(doctest.DocTestRunner):
+ def summarize(self, out, verbose=None): # type: ignore
# type: (Callable, bool) -> Tuple[int, int]
string_io = StringIO()
old_stdout = sys.stdout
sys.stdout = string_io
try:
- res = doctest.DocTestRunner.summarize(self, verbose) # type: ignore
+ res = doctest.DocTestRunner.summarize(self, verbose)
finally:
sys.stdout = old_stdout
out(string_io.getvalue())
@@ -257,7 +257,7 @@ class SphinxDocTestRunner(doctest.DocTestRunner): # type: ignore
module_globals=None):
# type: (unicode, Any) -> Any
# this is overridden from DocTestRunner adding the try-except below
- m = self._DocTestRunner__LINECACHE_FILENAME_RE.match(filename)
+ m = self._DocTestRunner__LINECACHE_FILENAME_RE.match(filename) # type: ignore
if m and m.group('name') == self.test.name:
try:
example = self.test.examples[int(m.group('examplenum'))]
@@ -268,7 +268,7 @@ class SphinxDocTestRunner(doctest.DocTestRunner): # type: ignore
pass
else:
return example.source.splitlines(True)
- return self.save_linecache_getlines(filename, module_globals)
+ return self.save_linecache_getlines(filename, module_globals) # type: ignore
# the new builder -- use sphinx-build.py -b doctest to run
@@ -379,8 +379,8 @@ Doctest summary
self.cleanup_runner = SphinxDocTestRunner(verbose=False,
optionflags=self.opt)
- self.test_runner._fakeout = self.setup_runner._fakeout
- self.cleanup_runner._fakeout = self.setup_runner._fakeout
+ self.test_runner._fakeout = self.setup_runner._fakeout # type: ignore
+ self.cleanup_runner._fakeout = self.setup_runner._fakeout # type: ignore
if self.config.doctest_test_doctest_blocks:
def condition(node):
@@ -466,7 +466,7 @@ Doctest summary
if not examples:
return True
# simulate a doctest with the code
- sim_doctest = doctest.DocTest(examples, {}, # type: ignore
+ sim_doctest = doctest.DocTest(examples, {},
'%s (%s code)' % (group.name, what),
filename_str, 0, None)
sim_doctest.globs = ns
@@ -487,7 +487,7 @@ Doctest summary
if len(code) == 1:
# ordinary doctests (code/output interleaved)
try:
- test = parser.get_doctest(
+ test = parser.get_doctest( # type: ignore
doctest_encode(code[0].code, self.env.config.source_encoding), {}, # type: ignore # NOQA
group.name, filename_str, code[0].lineno)
except Exception:
@@ -507,9 +507,9 @@ Doctest summary
output = code[1] and code[1].code or ''
options = code[1] and code[1].options or {}
# disable <BLANKLINE> processing as it is not needed
- options[doctest.DONT_ACCEPT_BLANKLINE] = True # type: ignore
+ options[doctest.DONT_ACCEPT_BLANKLINE] = True
# find out if we're testing an exception
- m = parser._EXCEPTION_RE.match(output)
+ m = parser._EXCEPTION_RE.match(output) # type: ignore
if m:
exc_msg = m.group('msg')
else:
@@ -546,6 +546,6 @@ def setup(app):
app.add_config_value('doctest_global_cleanup', '', False)
app.add_config_value(
'doctest_default_flags',
- doctest.DONT_ACCEPT_TRUE_FOR_1 | doctest.ELLIPSIS | doctest.IGNORE_EXCEPTION_DETAIL, # type: ignore # NOQA
+ doctest.DONT_ACCEPT_TRUE_FOR_1 | doctest.ELLIPSIS | doctest.IGNORE_EXCEPTION_DETAIL,
False)
return {'version': sphinx.__display_version__, 'parallel_read_safe': True}
diff --git a/sphinx/ext/graphviz.py b/sphinx/ext/graphviz.py
index a1565a1..2a83474 100644
--- a/sphinx/ext/graphviz.py
+++ b/sphinx/ext/graphviz.py
@@ -246,14 +246,14 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
if alt is None:
alt = node.get('alt', self.encode(code).strip())
imgcss = imgcls and 'class="%s"' % imgcls or ''
+ if 'align' in node:
+ self.body.append('<div align="%s" class="align-%s">' %
+ (node['align'], node['align']))
if format == 'svg':
svgtag = '''<object data="%s" type="image/svg+xml">
<p class="warning">%s</p></object>\n''' % (fname, alt)
self.body.append(svgtag)
else:
- if 'align' in node:
- self.body.append('<div align="%s" class="align-%s">' %
- (node['align'], node['align']))
with open(outfn + '.map', 'rb') as mapfile:
imgmap = mapfile.readlines()
if len(imgmap) == 2:
@@ -266,8 +266,8 @@ def render_dot_html(self, node, code, options, prefix='graphviz',
self.body.append('<img src="%s" alt="%s" usemap="#%s" %s/>\n' %
(fname, alt, mapname, imgcss))
self.body.extend([item.decode('utf-8') for item in imgmap])
- if 'align' in node:
- self.body.append('</div>\n')
+ if 'align' in node:
+ self.body.append('</div>\n')
raise nodes.SkipNode
@@ -286,24 +286,26 @@ def render_dot_latex(self, node, code, options, prefix='graphviz'):
raise nodes.SkipNode
is_inline = self.is_inline(node)
- if is_inline:
- para_separator = ''
- else:
- para_separator = '\n'
- if fname is not None:
- post = None # type: unicode
- if not is_inline and 'align' in node:
+ if not is_inline:
+ pre = ''
+ post = ''
+ if 'align' in node:
if node['align'] == 'left':
- self.body.append('{')
- post = '\\hspace*{\\fill}}'
+ pre = '{'
+ post = r'\hspace*{\fill}}'
elif node['align'] == 'right':
- self.body.append('{\\hspace*{\\fill}')
+ pre = r'{\hspace*{\fill}'
post = '}'
- self.body.append('%s\\includegraphics{%s}%s' %
- (para_separator, fname, para_separator))
- if post:
- self.body.append(post)
+ elif node['align'] == 'center':
+ pre = r'{\hfill'
+ post = r'\hspace*{\fill}}'
+ self.body.append('\n%s' % pre)
+
+ self.body.append(r'\includegraphics{%s}' % fname)
+
+ if not is_inline:
+ self.body.append('%s\n' % post)
raise nodes.SkipNode
diff --git a/sphinx/locale/fr/LC_MESSAGES/sphinx.po b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
index fd1ae66..6f6492b 100644
--- a/sphinx/locale/fr/LC_MESSAGES/sphinx.po
+++ b/sphinx/locale/fr/LC_MESSAGES/sphinx.po
@@ -356,7 +356,7 @@ msgstr "précédent"
#: sphinx/builders/html.py:1313
#, python-format
msgid "%s %s documentation"
-msgstr "documentation %s %s"
+msgstr "Documentation %s %s"
#: sphinx/builders/latex.py:199 sphinx/builders/texinfo.py:217
msgid " (in "
diff --git a/sphinx/make_mode.py b/sphinx/make_mode.py
index 9fe7ece..e7962db 100644
--- a/sphinx/make_mode.py
+++ b/sphinx/make_mode.py
@@ -18,6 +18,7 @@ from __future__ import print_function
import os
import sys
+import subprocess
from os import path
import sphinx
@@ -196,16 +197,14 @@ class Make(object):
if self.run_generic_build('latex') > 0:
return 1
with cd(self.builddir_join('latex')):
- os.system('%s all-pdf' % self.makecmd)
- return 0
+ return subprocess.call([self.makecmd, 'all-pdf'])
def build_latexpdfja(self):
# type: () -> int
if self.run_generic_build('latex') > 0:
return 1
with cd(self.builddir_join('latex')):
- os.system('%s all-pdf-ja' % self.makecmd)
- return 0
... 858 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx.git
More information about the Python-modules-commits
mailing list