From 624f2fe59c522eb0f9662176acb96e5261c40426 Mon Sep 17 00:00:00 2001 From: Lele Gaifax Date: Thu, 10 Nov 2016 14:08:29 +0100 Subject: [PATCH 1/5] Add missing trailing space in italian translation --- sphinx/locale/it/LC_MESSAGES/sphinx.po | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/locale/it/LC_MESSAGES/sphinx.po b/sphinx/locale/it/LC_MESSAGES/sphinx.po index b37c4410d..51b0f6e56 100644 --- a/sphinx/locale/it/LC_MESSAGES/sphinx.po +++ b/sphinx/locale/it/LC_MESSAGES/sphinx.po @@ -819,7 +819,7 @@ msgstr "Ricerca completata, trovata/e %s pagina/e corrispondenti." #: sphinx/themes/basic/static/searchtools.js_t:338 msgid ", in " -msgstr ", in" +msgstr ", in " #: sphinx/themes/classic/static/sidebar.js_t:83 msgid "Expand sidebar" From 903e464c84513aa014406e064d85100d6c80531f Mon Sep 17 00:00:00 2001 From: shimizukawa Date: Sat, 12 Nov 2016 14:19:31 +0900 Subject: [PATCH 2/5] Add Pygame documentation to Examples. Requested by https://groups.google.com/d/msg/sphinx-users/-qpL-ArvHR0/VQuN99GYBAAJ --- EXAMPLES | 1 + 1 file changed, 1 insertion(+) diff --git a/EXAMPLES b/EXAMPLES index e5d27f747..e84e0db26 100644 --- a/EXAMPLES +++ b/EXAMPLES @@ -94,6 +94,7 @@ Documentation using a customized version of the classic theme * NumPy: http://docs.scipy.org/doc/numpy/reference/ * OpenCV: http://docs.opencv.org/ * Peach^3: http://peach3.nl/doc/latest/userdoc/ +* Pygame: http://www.pygame.org/docs/ * Sage: http://www.sagemath.org/doc/ * SciPy: http://docs.scipy.org/doc/scipy/reference/ * simuPOP: http://simupop.sourceforge.net/manual_release/build/userGuide.html From 4ca84aba45109bad835bd300c8d9415b80c58269 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 12 Nov 2016 23:57:29 +0900 Subject: [PATCH 3/5] Fix #3135: ``sphinx.ext.autodoc`` crashes with plain Callable --- CHANGES | 1 + sphinx/ext/autodoc.py | 4 +++- test-reqs.txt | 1 + tests/test_autodoc.py | 7 ++++--- tests/typing_test_data.py | 9 +++++++-- tox.ini | 1 + 6 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGES b/CHANGES index 5be5f4632..1120e0d7b 100644 --- a/CHANGES +++ b/CHANGES @@ -9,6 +9,7 @@ Bugs fixed results in warning / error * #3068: Allow the '=' character in the -D option of sphinx-build.py * #3074: ``add_source_parser()`` crashes in debug mode +* #3135: ``sphinx.ext.autodoc`` crashes with plain Callable Release 1.4.8 (released Oct 1, 2016) ==================================== diff --git a/sphinx/ext/autodoc.py b/sphinx/ext/autodoc.py index 1006d78b4..e210e7266 100644 --- a/sphinx/ext/autodoc.py +++ b/sphinx/ext/autodoc.py @@ -306,7 +306,9 @@ def format_annotation(annotation): hasattr(annotation, '__args__') and \ hasattr(annotation, '__result__'): args = annotation.__args__ - if args is Ellipsis: + if args is None: + return qualified_name + elif args is Ellipsis: args_str = '...' else: formatted_args = (format_annotation(a) for a in args) diff --git a/test-reqs.txt b/test-reqs.txt index 32a7599af..9f4e835e8 100644 --- a/test-reqs.txt +++ b/test-reqs.txt @@ -13,3 +13,4 @@ whoosh>=2.0 alabaster sphinx_rtd_theme imagesize +typing diff --git a/tests/test_autodoc.py b/tests/test_autodoc.py index fca3c2b9e..711e5e807 100644 --- a/tests/test_autodoc.py +++ b/tests/test_autodoc.py @@ -1025,7 +1025,7 @@ def test_type_hints(): from sphinx.util.inspect import getargspec try: - from typing_test_data import f0, f1, f2, f3, f4, f5, f6, f7, f8, f9 + from typing_test_data import f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10 except (ImportError, SyntaxError): raise SkipTest('Cannot import Python code with function annotations') @@ -1057,10 +1057,11 @@ def test_type_hints(): # Callable types verify_arg_spec(f7, '(x: typing.Callable[[int, str], int]) -> None') + verify_arg_spec(f8, '(x: typing.Callable) -> None') # Tuple types - verify_arg_spec(f8, '(x: typing.Tuple[int, str],' + verify_arg_spec(f9, '(x: typing.Tuple[int, str],' ' y: typing.Tuple[int, ...]) -> None') # Instance annotations - verify_arg_spec(f9, '(x: CustomAnnotation, y: 123) -> None') + verify_arg_spec(f10, '(x: CustomAnnotation, y: 123) -> None') diff --git a/tests/typing_test_data.py b/tests/typing_test_data.py index 461be7831..3c3126b07 100644 --- a/tests/typing_test_data.py +++ b/tests/typing_test_data.py @@ -44,7 +44,11 @@ def f7(x: Callable[[int, str], int]) -> None: pass -def f8(x: Tuple[int, str], y: Tuple[int, ...]) -> None: +def f8(x: Callable) -> None: + pass + + +def f9(x: Tuple[int, str], y: Tuple[int, ...]) -> None: pass @@ -52,5 +56,6 @@ class CustomAnnotation: def __repr__(self): return 'CustomAnnotation' -def f9(x: CustomAnnotation(), y: 123) -> None: + +def f10(x: CustomAnnotation(), y: 123) -> None: pass diff --git a/tox.ini b/tox.ini index 8fcb7b177..112017b77 100644 --- a/tox.ini +++ b/tox.ini @@ -6,6 +6,7 @@ deps= nose sqlalchemy whoosh + typing setenv = SPHINX_TEST_TEMPDIR = {envdir}/testbuild commands= From ba35513b0f2f3df88d9dc5e613a4c63ab90e08e1 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 13 Nov 2016 00:55:58 +0900 Subject: [PATCH 4/5] Do not install typing module (because it does not support py26...) --- test-reqs.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/test-reqs.txt b/test-reqs.txt index 9f4e835e8..32a7599af 100644 --- a/test-reqs.txt +++ b/test-reqs.txt @@ -13,4 +13,3 @@ whoosh>=2.0 alabaster sphinx_rtd_theme imagesize -typing From 9f39b53c1640ab47874c5d180d07f338696e4993 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sun, 13 Nov 2016 11:16:44 +0900 Subject: [PATCH 5/5] Fix #3130: HTML rendering problems inside admonition block in Sphinx doc --- doc/_themes/sphinx13/static/sphinx13.css | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/_themes/sphinx13/static/sphinx13.css b/doc/_themes/sphinx13/static/sphinx13.css index 8b3ebdf3a..1739ac36b 100644 --- a/doc/_themes/sphinx13/static/sphinx13.css +++ b/doc/_themes/sphinx13/static/sphinx13.css @@ -384,6 +384,10 @@ div.warning ul, div.warning ol { padding: 0; } +div.admonition div.highlight { + background: none; +} + .viewcode-back { font-family: 'Open Sans', 'Lucida Grande', 'Lucida Sans Unicode', 'Geneva', 'Verdana', sans-serif;