mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge branch '1.8'
This commit is contained in:
commit
0a99a58e12
@ -6,6 +6,6 @@ jobs:
|
||||
working_directory: /sphinx
|
||||
steps:
|
||||
- checkout
|
||||
- run: /python3.4/bin/pip install -U pip setuptools
|
||||
- run: /python3.4/bin/pip install -U .[test,websupport]
|
||||
- run: make test PYTHON=/python3.4/bin/python
|
||||
- run: /python3.5/bin/pip install -U pip setuptools
|
||||
- run: /python3.5/bin/pip install -U .[test,websupport]
|
||||
- run: make test PYTHON=/python3.5/bin/python
|
||||
|
7
CHANGES
7
CHANGES
@ -37,6 +37,9 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* html: search box overrides to other elements if scrolled
|
||||
* #5325: latex: cross references has been broken by multiply labeled objects
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
@ -307,6 +310,10 @@ Features added
|
||||
Bugs fixed
|
||||
----------
|
||||
|
||||
* #5320: intersphinx: crashed if invalid url given
|
||||
* #5326: manpage: crashed when invalid docname is specified as ``man_pages``
|
||||
* #5322: autodoc: ``Any`` typehint causes formatting error
|
||||
|
||||
Testing
|
||||
--------
|
||||
|
||||
|
@ -362,7 +362,7 @@ There are also new config values that you can set:
|
||||
.. confval:: autodoc_default_options
|
||||
|
||||
The default options for autodoc directives. They are applied to all autodoc
|
||||
directives automatically. It must be a dictionally which maps option names
|
||||
directives automatically. It must be a dictionary which maps option names
|
||||
to the values. For example::
|
||||
|
||||
autodoc_default_options = {
|
||||
|
@ -73,6 +73,10 @@ class ManualPageBuilder(Builder):
|
||||
|
||||
for info in self.config.man_pages:
|
||||
docname, name, description, authors, section = info
|
||||
if docname not in self.env.all_docs:
|
||||
logger.warning(__('"man_pages" config value references unknown '
|
||||
'document %s'), docname)
|
||||
continue
|
||||
if isinstance(authors, string_types):
|
||||
if authors:
|
||||
authors = [authors]
|
||||
|
@ -156,9 +156,7 @@ class Graphviz(SphinxDirective):
|
||||
line=self.lineno)]
|
||||
node = graphviz()
|
||||
node['code'] = dotcode
|
||||
node['options'] = {
|
||||
'docname': path.splitext(self.state.document.current_source)[0],
|
||||
}
|
||||
node['options'] = {'docname': self.env.docname}
|
||||
|
||||
if 'graphviz_dot' in self.options:
|
||||
node['options']['graphviz_dot'] = self.options['graphviz_dot']
|
||||
|
@ -410,14 +410,19 @@ def inspect_main(argv):
|
||||
# type: (unicode) -> None
|
||||
print(msg, file=sys.stderr)
|
||||
|
||||
filename = argv[0]
|
||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||
for key in sorted(invdata or {}):
|
||||
print(key)
|
||||
for entry, einfo in sorted(invdata[key].items()):
|
||||
print('\t%-40s %s%s' % (entry,
|
||||
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
||||
einfo[2]))
|
||||
try:
|
||||
filename = argv[0]
|
||||
invdata = fetch_inventory(MockApp(), '', filename) # type: ignore
|
||||
for key in sorted(invdata or {}):
|
||||
print(key)
|
||||
for entry, einfo in sorted(invdata[key].items()):
|
||||
print('\t%-40s %s%s' % (entry,
|
||||
einfo[3] != '-' and '%-40s: ' % einfo[3] or '',
|
||||
einfo[2]))
|
||||
except ValueError as exc:
|
||||
print(exc.args[0] % exc.args[1:])
|
||||
except Exception as exc:
|
||||
print('Unknown error: %r' % exc)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -81,6 +81,10 @@ div.sphinxsidebar input {
|
||||
font-size: 1em;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox form.search {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
div.sphinxsidebar #searchbox input[type="text"] {
|
||||
float: left;
|
||||
width: 80%;
|
||||
|
@ -546,8 +546,10 @@ class Signature(object):
|
||||
qualname = annotation.__qualname__
|
||||
elif getattr(annotation, '__forward_arg__', None):
|
||||
qualname = annotation.__forward_arg__
|
||||
else:
|
||||
elif getattr(annotation, '__origin__', None):
|
||||
qualname = self.format_annotation(annotation.__origin__) # ex. Union
|
||||
else:
|
||||
qualname = repr(annotation).replace('typing.', '')
|
||||
elif hasattr(annotation, '__qualname__'):
|
||||
qualname = '%s.%s' % (module, annotation.__qualname__)
|
||||
else:
|
||||
|
@ -1858,8 +1858,11 @@ class LaTeXTranslator(nodes.NodeVisitor):
|
||||
self.body.append(self.hypertarget(id, anchor=anchor))
|
||||
|
||||
# skip if visitor for next node supports hyperlink
|
||||
next_node = node
|
||||
while isinstance(next_node, nodes.target):
|
||||
next_node = next_node.next_node(ascend=True)
|
||||
|
||||
domain = self.builder.env.get_domain('std')
|
||||
next_node = node.next_node(ascend=True)
|
||||
if isinstance(next_node, HYPERLINK_SUPPORT_NODES):
|
||||
return
|
||||
elif domain.get_enumerable_node_type(next_node) and domain.get_numfig_title(next_node):
|
||||
|
@ -232,7 +232,7 @@ def test_Signature_partialmethod():
|
||||
reason='type annotation test is available on py34 or above')
|
||||
def test_Signature_annotations():
|
||||
from typing_test_data import (
|
||||
f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, Node)
|
||||
f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, Node)
|
||||
|
||||
# Class annotations
|
||||
sig = inspect.Signature(f0).format_args()
|
||||
@ -293,9 +293,16 @@ def test_Signature_annotations():
|
||||
sig = inspect.Signature(f13).format_args()
|
||||
assert sig == '() -> Optional[str]'
|
||||
|
||||
# Any
|
||||
sig = inspect.Signature(f14).format_args()
|
||||
assert sig == '() -> Any'
|
||||
|
||||
# type hints by string
|
||||
sig = inspect.Signature(Node.children).format_args()
|
||||
assert sig == '(self) -> List[typing_test_data.Node]'
|
||||
if (3, 5, 0) <= sys.version_info < (3, 5, 3):
|
||||
assert sig == '(self) -> List[Node]'
|
||||
else:
|
||||
assert sig == '(self) -> List[typing_test_data.Node]'
|
||||
|
||||
sig = inspect.Signature(Node.__init__).format_args()
|
||||
assert sig == '(self, parent: Optional[Node]) -> None'
|
||||
|
@ -1,5 +1,5 @@
|
||||
from numbers import Integral
|
||||
from typing import List, TypeVar, Union, Callable, Tuple, Optional
|
||||
from typing import Any, List, TypeVar, Union, Callable, Tuple, Optional
|
||||
|
||||
|
||||
def f0(x: int, y: Integral) -> None:
|
||||
@ -72,6 +72,10 @@ def f13() -> Optional[str]:
|
||||
pass
|
||||
|
||||
|
||||
def f14() -> Any:
|
||||
pass
|
||||
|
||||
|
||||
class Node:
|
||||
def __init__(self, parent: Optional['Node']) -> None:
|
||||
pass
|
||||
|
Loading…
Reference in New Issue
Block a user