From 5c884a66bd5b892df236743ef3cfaee28c585151 Mon Sep 17 00:00:00 2001 From: Wheerd Date: Mon, 21 Nov 2016 19:11:04 +0100 Subject: [PATCH 1/2] Fixed the regular expression for xref to only match roles that are valid. This caused errors when having multiple successive xrefs without whitespace between them. --- sphinx/ext/napoleon/docstring.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sphinx/ext/napoleon/docstring.py b/sphinx/ext/napoleon/docstring.py index e526a11aeb..ef9ff1627c 100644 --- a/sphinx/ext/napoleon/docstring.py +++ b/sphinx/ext/napoleon/docstring.py @@ -27,7 +27,7 @@ _google_section_regex = re.compile(r'^(\s|\w)+:\s*$') _google_typed_arg_regex = re.compile(r'\s*(.+?)\s*\(\s*(.*[^\s]+)\s*\)') _numpy_section_regex = re.compile(r'^[=\-`:\'"~^_*+#<>]{2,}\s*$') _single_colon_regex = re.compile(r'(?\()?' From f4716ed3a38f4b6b1c1ac543f315e1dcf8f86315 Mon Sep 17 00:00:00 2001 From: Rob Ruana Date: Mon, 21 Nov 2016 16:12:23 -0800 Subject: [PATCH 2/2] [Napoleon] adds xref test data for pull request #3168 --- tests/test_ext_napoleon.py | 1 + tests/test_ext_napoleon_docstring.py | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/test_ext_napoleon.py b/tests/test_ext_napoleon.py index 7ecd082923..21d095a797 100644 --- a/tests/test_ext_napoleon.py +++ b/tests/test_ext_napoleon.py @@ -68,6 +68,7 @@ class SampleError(Exception): def __special_undoc__(self): pass + SampleNamedTuple = namedtuple('SampleNamedTuple', 'user_id block_type def_id') diff --git a/tests/test_ext_napoleon_docstring.py b/tests/test_ext_napoleon_docstring.py index 37dcca90c0..be9103063e 100644 --- a/tests/test_ext_napoleon_docstring.py +++ b/tests/test_ext_napoleon_docstring.py @@ -284,8 +284,9 @@ Construct a new XBlock. This class should only be used by runtimes. Arguments: - runtime (:class:`Runtime`): Use it to access the environment. - It is available in XBlock code as ``self.runtime``. + runtime (:class:`~typing.Dict`\[:class:`int`,:class:`str`\]): Use it to + access the environment. It is available in XBlock code + as ``self.runtime``. field_data (:class:`FieldData`): Interface used by the XBlock fields to access their data from wherever it is persisted. @@ -300,9 +301,10 @@ Construct a new XBlock. This class should only be used by runtimes. -:param runtime: Use it to access the environment. - It is available in XBlock code as ``self.runtime``. -:type runtime: :class:`Runtime` +:param runtime: Use it to + access the environment. It is available in XBlock code + as ``self.runtime``. +:type runtime: :class:`~typing.Dict`\[:class:`int`,:class:`str`\] :param field_data: Interface used by the XBlock fields to access their data from wherever it is persisted. :type field_data: :class:`FieldData`