Merge branch '1.6-release'

This commit is contained in:
Takeshi KOMIYA 2017-05-13 15:42:28 +09:00
commit 78a20617b5
9 changed files with 36 additions and 16 deletions

View File

@ -80,6 +80,7 @@ Bugs fixed
longtable class or not (refs #3686)
* #3725: Todo looks different from note in LaTeX output
* #3479: stub-columns have no effect in LaTeX output
* #3738: Nonsensical code in theming.py
Testing
--------
@ -344,6 +345,8 @@ Bugs fixed
* #3702: LaTeX writer styles figure legends with a hard-coded ``\small``
* #3708: LaTeX writer allows irc scheme
* #3717: Stop enforcing that favicon's must be .ico
* #3731, #3732: Protect isenumclass predicate against non-class arguments
* #3320: Warning about reference target not being found for container types
Testing
--------

View File

@ -510,11 +510,18 @@ Let us now list some macros from the package file
.. hint::
As an experimental feature, Sphinx can use user-defined template file for
LaTeX source if you have a file named ``_templates/latex.tex_t`` on your
project. Now all template variables are unstable and undocumented. They
will be changed in future version.
LaTeX source if you have a file named ``_templates/latex.tex_t`` in your
project.
.. versionadded:: 1.5
currently all template variables are unstable and undocumented.
Additional files ``longtable.tex_t``, ``tabulary.tex_t`` and
``tabular.tex_t`` can be added to ``_templates/`` to configure some aspects
of table rendering (such as the caption position).
.. versionadded:: 1.6
currently all template variables are unstable and undocumented.
.. raw:: latex

View File

@ -203,9 +203,9 @@ class Sphinx(object):
self.config.setup(self)
else:
raise ConfigError(
_("'setup' that is specified in the conf.py has not been "
"callable. Please provide a callable `setup` function "
"in order to behave as a sphinx extension conf.py itself.")
_("'setup' as currently defined in conf.py isn't a Python callable. "
"Please modify its definition to make it a callable function. This is "
"needed for conf.py to behave as a Sphinx extension.")
)
# now that we know all config values, collect them from conf.py
@ -416,7 +416,7 @@ class Sphinx(object):
def connect(self, event, callback):
# type: (unicode, Callable) -> int
listener_id = self.events.connect(event, callback)
logger.debug('[app] connecting event %r: %r', event, callback, listener_id)
logger.debug('[app] connecting event %r: %r [id=%s]', event, callback, listener_id)
return listener_id
def disconnect(self, listener_id):
@ -462,7 +462,7 @@ class Sphinx(object):
def set_translator(self, name, translator_class):
# type: (unicode, Type[nodes.NodeVisitor]) -> None
logger.info(bold(_('A Translator for the %s builder is changed.') % name))
logger.info(bold(_('Change of translator for the %s builder.') % name))
self.registry.add_translator(name, translator_class)
def add_node(self, node, **kwds):

View File

@ -135,7 +135,7 @@ class PyXrefMixin(object):
split_contnode = bool(contnode and contnode.astext() == target)
results = []
for sub_target in sub_targets:
for sub_target in filter(None, sub_targets):
if split_contnode:
contnode = nodes.Text(sub_target)

View File

@ -50,9 +50,8 @@ def verify_required_extensions(app, requirements):
for extname, reqversion in iteritems(requirements):
extension = app.extensions.get(extname)
if extension is None:
logger.warning(_('needs_extensions config value specifies a '
'version requirement for extension %s, but it is '
'not loaded'), extname)
logger.warning(_('The %s extension is required by needs_extensions settings,'
'but it is not loaded.'), extname)
continue
if extension.version == 'unknown version' or reqversion > extension.version:

View File

@ -233,8 +233,8 @@ class HTMLThemeFactory(object):
target = entry_point.load()
if callable(target):
themedir = target()
if not isinstance(path, string_types):
logger.warning(_('Theme extension %r does not response correctly.') %
if not isinstance(themedir, string_types):
logger.warning(_('Theme extension %r does not respond correctly.') %
entry_point.module_name)
else:
themedir = target

View File

@ -142,7 +142,7 @@ def isenumclass(x):
"""Check if the object is subclass of enum."""
if enum is None:
return False
return issubclass(x, enum.Enum)
return inspect.isclass(x) and issubclass(x, enum.Enum)
def isenumattribute(x):

View File

@ -29,3 +29,10 @@ module
.. py:class:: ModTopLevel
* Link to :py:class:`ModNoModule`
.. py:function:: foo(x, y)
:param x: param x
:type x: int
:param y: param y
:type y: tuple(str, float)

View File

@ -109,7 +109,11 @@ def test_domain_py_xrefs(app, status, warning):
'ModTopLevel', 'class')
assert_refnode(refnodes[6], 'module_b.submodule', 'ModTopLevel',
'ModNoModule', 'class')
assert len(refnodes) == 7
assert_refnode(refnodes[7], False, False, 'int', 'obj')
assert_refnode(refnodes[8], False, False, 'tuple', 'obj')
assert_refnode(refnodes[9], False, False, 'str', 'obj')
assert_refnode(refnodes[10], False, False, 'float', 'obj')
assert len(refnodes) == 11
@pytest.mark.sphinx('dummy', testroot='domain-py')