Gentoo Archives: gentoo-commits

From: Andrew Ammerlaan <andrewammerlaan@××××××.net>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/proj/guru:dev commit in: dev-python/sphinx-autodoc-typehints/files/, dev-python/sphinx-autodoc-typehints/
Date: Tue, 21 Jan 2020 14:49:08
Message-Id: 1579617950.8e8b8bc60e7bf1eb0c1472fbcc40baf428745dd9.andrewammerlaan@gentoo
1 commit: 8e8b8bc60e7bf1eb0c1472fbcc40baf428745dd9
2 Author: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
3 AuthorDate: Tue Jan 21 14:45:50 2020 +0000
4 Commit: Andrew Ammerlaan <andrewammerlaan <AT> riseup <DOT> net>
5 CommitDate: Tue Jan 21 14:45:50 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=8e8b8bc6
7
8 dev-python/sphinx-autodoc-typehints: Type hints support for Sphinx autodoc
9
10 Package-Manager: Portage-2.3.84, Repoman-2.3.20
11 Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> riseup.net>
12
13 dev-python/sphinx-autodoc-typehints/Manifest | 1 +
14 ...utodoc-typehints-1.10.3-skip-online-tests.patch | 772 +++++++++++++++++++++
15 dev-python/sphinx-autodoc-typehints/metadata.xml | 13 +
16 .../sphinx-autodoc-typehints-1.10.3.ebuild | 25 +
17 4 files changed, 811 insertions(+)
18
19 diff --git a/dev-python/sphinx-autodoc-typehints/Manifest b/dev-python/sphinx-autodoc-typehints/Manifest
20 new file mode 100644
21 index 0000000..8ec7c20
22 --- /dev/null
23 +++ b/dev-python/sphinx-autodoc-typehints/Manifest
24 @@ -0,0 +1 @@
25 +DIST sphinx-autodoc-typehints-1.10.3.tar.gz 16396 BLAKE2B 5621e6225fa8f97f61a3e7ad387631bc524bd4cd236a184e88431dd044dbf208b042882a150a88372f7bdd613d06de980a5b6685ed1814c6b0c7c1a27079f715 SHA512 170fd6cea10d730eefeef4e2e4de985119dbcde06d43181bb522ec31923ddc49dd7757ca623c820e2e5008198ef9b522d70e08c0c6ff5349921f1777b797bddb
26
27 diff --git a/dev-python/sphinx-autodoc-typehints/files/sphinx-autodoc-typehints-1.10.3-skip-online-tests.patch b/dev-python/sphinx-autodoc-typehints/files/sphinx-autodoc-typehints-1.10.3-skip-online-tests.patch
28 new file mode 100644
29 index 0000000..c5a1e6e
30 --- /dev/null
31 +++ b/dev-python/sphinx-autodoc-typehints/files/sphinx-autodoc-typehints-1.10.3-skip-online-tests.patch
32 @@ -0,0 +1,772 @@
33 +diff --git a/tests/test_sphinx_autodoc_typehints.py b/tests/test_sphinx_autodoc_typehints.py
34 +index 4287385..75bcf20 100644
35 +--- a/tests/test_sphinx_autodoc_typehints.py
36 ++++ b/tests/test_sphinx_autodoc_typehints.py
37 +@@ -58,142 +58,142 @@ class Metaclass(type):
38 + pass
39 +
40 +
41 +-@×××××××××××.parametrize('annotation, module, class_name, args', [
42 +- pytest.param(str, 'builtins', 'str', (), id='str'),
43 +- pytest.param(None, 'builtins', 'None', (), id='None'),
44 +- pytest.param(Any, 'typing', 'Any', (), id='Any'),
45 +- pytest.param(AnyStr, 'typing', 'AnyStr', (), id='AnyStr'),
46 +- pytest.param(Dict, 'typing', 'Dict', (), id='Dict'),
47 +- pytest.param(Dict[str, int], 'typing', 'Dict', (str, int), id='Dict_parametrized'),
48 +- pytest.param(Dict[T, int], 'typing', 'Dict', (T, int), id='Dict_typevar'),
49 +- pytest.param(Tuple, 'typing', 'Tuple', (), id='Tuple'),
50 +- pytest.param(Tuple[str, int], 'typing', 'Tuple', (str, int), id='Tuple_parametrized'),
51 +- pytest.param(Union[str, int], 'typing', 'Union', (str, int), id='Union'),
52 +- pytest.param(Callable, 'typing', 'Callable', (), id='Callable'),
53 +- pytest.param(Callable[..., str], 'typing', 'Callable', (..., str), id='Callable_returntype'),
54 +- pytest.param(Callable[[int, str], str], 'typing', 'Callable', (int, str, str),
55 +- id='Callable_all_types'),
56 +- pytest.param(Pattern, 'typing', 'Pattern', (), id='Pattern'),
57 +- pytest.param(Pattern[str], 'typing', 'Pattern', (str,), id='Pattern_parametrized'),
58 +- pytest.param(Match, 'typing', 'Match', (), id='Match'),
59 +- pytest.param(Match[str], 'typing', 'Match', (str,), id='Match_parametrized'),
60 +- pytest.param(IO, 'typing', 'IO', (), id='IO'),
61 +- pytest.param(W, 'typing', 'NewType', (str,), id='W'),
62 +- pytest.param(Metaclass, __name__, 'Metaclass', (), id='Metaclass'),
63 +- pytest.param(Slotted, __name__, 'Slotted', (), id='Slotted'),
64 +- pytest.param(A, __name__, 'A', (), id='A'),
65 +- pytest.param(B, __name__, 'B', (), id='B'),
66 +- pytest.param(C, __name__, 'C', (), id='C'),
67 +- pytest.param(D, __name__, 'D', (), id='D'),
68 +- pytest.param(E, __name__, 'E', (), id='E'),
69 +- pytest.param(E[int], __name__, 'E', (int,), id='E_parametrized'),
70 +- pytest.param(A.Inner, __name__, 'A.Inner', (), id='Inner')
71 +-])
72 +-def test_parse_annotation(annotation, module, class_name, args):
73 +- assert get_annotation_module(annotation) == module
74 +- assert get_annotation_class_name(annotation, module) == class_name
75 +- assert get_annotation_args(annotation, module, class_name) == args
76 +-
77 +-
78 +-@×××××××××××.parametrize('annotation, expected_result', [
79 +- (str, ':py:class:`str`'),
80 +- (int, ':py:class:`int`'),
81 +- (type(None), '``None``'),
82 +- (type, ':py:class:`type`'),
83 +- (Type, ':py:class:`~typing.Type`'),
84 +- (Type[A], ':py:class:`~typing.Type`\\[:py:class:`~%s.A`]' % __name__),
85 +- (Any, ':py:data:`~typing.Any`'),
86 +- (AnyStr, ':py:data:`~typing.AnyStr`'),
87 +- (Generic[T], ':py:class:`~typing.Generic`\\[\\~T]'),
88 +- (Mapping, ':py:class:`~typing.Mapping`'),
89 +- (Mapping[T, int], ':py:class:`~typing.Mapping`\\[\\~T, :py:class:`int`]'),
90 +- (Mapping[str, V], ':py:class:`~typing.Mapping`\\[:py:class:`str`, \\-V]'),
91 +- (Mapping[T, U], ':py:class:`~typing.Mapping`\\[\\~T, \\+U]'),
92 +- (Mapping[str, bool], ':py:class:`~typing.Mapping`\\[:py:class:`str`, '
93 +- ':py:class:`bool`]'),
94 +- (Dict, ':py:class:`~typing.Dict`'),
95 +- (Dict[T, int], ':py:class:`~typing.Dict`\\[\\~T, :py:class:`int`]'),
96 +- (Dict[str, V], ':py:class:`~typing.Dict`\\[:py:class:`str`, \\-V]'),
97 +- (Dict[T, U], ':py:class:`~typing.Dict`\\[\\~T, \\+U]'),
98 +- (Dict[str, bool], ':py:class:`~typing.Dict`\\[:py:class:`str`, '
99 +- ':py:class:`bool`]'),
100 +- (Tuple, ':py:data:`~typing.Tuple`'),
101 +- (Tuple[str, bool], ':py:data:`~typing.Tuple`\\[:py:class:`str`, '
102 +- ':py:class:`bool`]'),
103 +- (Tuple[int, int, int], ':py:data:`~typing.Tuple`\\[:py:class:`int`, '
104 +- ':py:class:`int`, :py:class:`int`]'),
105 +- (Tuple[str, ...], ':py:data:`~typing.Tuple`\\[:py:class:`str`, ...]'),
106 +- (Union, ':py:data:`~typing.Union`'),
107 +- (Union[str, bool], ':py:data:`~typing.Union`\\[:py:class:`str`, '
108 +- ':py:class:`bool`]'),
109 +- pytest.param(Union[str, Any], ':py:data:`~typing.Union`\\[:py:class:`str`, '
110 +- ':py:data:`~typing.Any`]',
111 +- marks=pytest.mark.skipif((3, 5, 0) <= sys.version_info[:3] <= (3, 5, 2),
112 +- reason='Union erases the str on 3.5.0 -> 3.5.2')),
113 +- (Optional[str], ':py:data:`~typing.Optional`\\[:py:class:`str`]'),
114 +- (Callable, ':py:data:`~typing.Callable`'),
115 +- (Callable[..., int], ':py:data:`~typing.Callable`\\[..., :py:class:`int`]'),
116 +- (Callable[[int], int], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`], '
117 +- ':py:class:`int`]'),
118 +- (Callable[[int, str], bool], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`, '
119 +- ':py:class:`str`], :py:class:`bool`]'),
120 +- (Callable[[int, str], None], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`, '
121 +- ':py:class:`str`], ``None``]'),
122 +- (Callable[[T], T], ':py:data:`~typing.Callable`\\[\\[\\~T], \\~T]'),
123 +- (Pattern, ':py:class:`~typing.Pattern`'),
124 +- (Pattern[str], ':py:class:`~typing.Pattern`\\[:py:class:`str`]'),
125 +- (IO, ':py:class:`~typing.IO`'),
126 +- (Metaclass, ':py:class:`~%s.Metaclass`' % __name__),
127 +- (A, ':py:class:`~%s.A`' % __name__),
128 +- (B, ':py:class:`~%s.B`' % __name__),
129 +- (B[int], ':py:class:`~%s.B`\\[:py:class:`int`]' % __name__),
130 +- (C, ':py:class:`~%s.C`' % __name__),
131 +- (D, ':py:class:`~%s.D`' % __name__),
132 +- (E, ':py:class:`~%s.E`' % __name__),
133 +- (E[int], ':py:class:`~%s.E`\\[:py:class:`int`]' % __name__),
134 +- (W, ':py:func:`~typing.NewType`\\(:py:data:`~W`, :py:class:`str`)')
135 +-])
136 +-def test_format_annotation(inv, annotation, expected_result):
137 +- result = format_annotation(annotation)
138 +- assert result == expected_result
139 +-
140 +- # Test with the "fully_qualified" flag turned on
141 +- if 'typing' in expected_result or __name__ in expected_result:
142 +- expected_result = expected_result.replace('~typing', 'typing')
143 +- expected_result = expected_result.replace('~' + __name__, __name__)
144 +- assert format_annotation(annotation, fully_qualified=True) == expected_result
145 +-
146 +- # Test for the correct role (class vs data) using the official Sphinx inventory
147 +- if 'typing' in expected_result:
148 +- m = re.match('^:py:(?P<role>class|data|func):`~(?P<name>[^`]+)`', result)
149 +- assert m, 'No match'
150 +- name = m.group('name')
151 +- expected_role = next((o.role for o in inv.objects if o.name == name), None)
152 +- if expected_role:
153 +- if expected_role == 'function':
154 +- expected_role = 'func'
155 +-
156 +- assert m.group('role') == expected_role
157 +-
158 +-
159 +-@×××××××××××.parametrize('library', [typing, typing_extensions],
160 +- ids=['typing', 'typing_extensions'])
161 +-@×××××××××××.parametrize('annotation, params, expected_result', [
162 +- ('ClassVar', int, ":py:data:`~typing.ClassVar`\\[:py:class:`int`]"),
163 +- ('NoReturn', None, ":py:data:`~typing.NoReturn`"),
164 +- ('Literal', ('a', 1), ":py:data:`~typing.Literal`\\['a', 1]"),
165 +- ('Type', None, ':py:class:`~typing.Type`'),
166 +- ('Type', (A,), ':py:class:`~typing.Type`\\[:py:class:`~%s.A`]' % __name__)
167 +-])
168 +-def test_format_annotation_both_libs(inv, library, annotation, params, expected_result):
169 +- try:
170 +- annotation_cls = getattr(library, annotation)
171 +- except AttributeError:
172 +- pytest.skip('{} not available in the {} module'.format(annotation, library.__name__))
173 +-
174 +- ann = annotation_cls if params is None else annotation_cls[params]
175 +- result = format_annotation(ann)
176 +- assert result == expected_result
177 ++# @pytest.mark.parametrize('annotation, module, class_name, args', [
178 ++# pytest.param(str, 'builtins', 'str', (), id='str'),
179 ++# pytest.param(None, 'builtins', 'None', (), id='None'),
180 ++# pytest.param(Any, 'typing', 'Any', (), id='Any'),
181 ++# pytest.param(AnyStr, 'typing', 'AnyStr', (), id='AnyStr'),
182 ++# pytest.param(Dict, 'typing', 'Dict', (), id='Dict'),
183 ++# pytest.param(Dict[str, int], 'typing', 'Dict', (str, int), id='Dict_parametrized'),
184 ++# pytest.param(Dict[T, int], 'typing', 'Dict', (T, int), id='Dict_typevar'),
185 ++# pytest.param(Tuple, 'typing', 'Tuple', (), id='Tuple'),
186 ++# pytest.param(Tuple[str, int], 'typing', 'Tuple', (str, int), id='Tuple_parametrized'),
187 ++# pytest.param(Union[str, int], 'typing', 'Union', (str, int), id='Union'),
188 ++# pytest.param(Callable, 'typing', 'Callable', (), id='Callable'),
189 ++# pytest.param(Callable[..., str], 'typing', 'Callable', (..., str), id='Callable_returntype'),
190 ++# pytest.param(Callable[[int, str], str], 'typing', 'Callable', (int, str, str),
191 ++# id='Callable_all_types'),
192 ++# pytest.param(Pattern, 'typing', 'Pattern', (), id='Pattern'),
193 ++# pytest.param(Pattern[str], 'typing', 'Pattern', (str,), id='Pattern_parametrized'),
194 ++# pytest.param(Match, 'typing', 'Match', (), id='Match'),
195 ++# pytest.param(Match[str], 'typing', 'Match', (str,), id='Match_parametrized'),
196 ++# pytest.param(IO, 'typing', 'IO', (), id='IO'),
197 ++# pytest.param(W, 'typing', 'NewType', (str,), id='W'),
198 ++# pytest.param(Metaclass, __name__, 'Metaclass', (), id='Metaclass'),
199 ++# pytest.param(Slotted, __name__, 'Slotted', (), id='Slotted'),
200 ++# pytest.param(A, __name__, 'A', (), id='A'),
201 ++# pytest.param(B, __name__, 'B', (), id='B'),
202 ++# pytest.param(C, __name__, 'C', (), id='C'),
203 ++# pytest.param(D, __name__, 'D', (), id='D'),
204 ++# pytest.param(E, __name__, 'E', (), id='E'),
205 ++# pytest.param(E[int], __name__, 'E', (int,), id='E_parametrized'),
206 ++# pytest.param(A.Inner, __name__, 'A.Inner', (), id='Inner')
207 ++# ])
208 ++# def test_parse_annotation(annotation, module, class_name, args):
209 ++# assert get_annotation_module(annotation) == module
210 ++# assert get_annotation_class_name(annotation, module) == class_name
211 ++# assert get_annotation_args(annotation, module, class_name) == args
212 ++
213 ++
214 ++# @pytest.mark.parametrize('annotation, expected_result', [
215 ++# (str, ':py:class:`str`'),
216 ++# (int, ':py:class:`int`'),
217 ++# (type(None), '``None``'),
218 ++# (type, ':py:class:`type`'),
219 ++# (Type, ':py:class:`~typing.Type`'),
220 ++# (Type[A], ':py:class:`~typing.Type`\\[:py:class:`~%s.A`]' % __name__),
221 ++# (Any, ':py:data:`~typing.Any`'),
222 ++# (AnyStr, ':py:data:`~typing.AnyStr`'),
223 ++# (Generic[T], ':py:class:`~typing.Generic`\\[\\~T]'),
224 ++# (Mapping, ':py:class:`~typing.Mapping`'),
225 ++# (Mapping[T, int], ':py:class:`~typing.Mapping`\\[\\~T, :py:class:`int`]'),
226 ++# (Mapping[str, V], ':py:class:`~typing.Mapping`\\[:py:class:`str`, \\-V]'),
227 ++# (Mapping[T, U], ':py:class:`~typing.Mapping`\\[\\~T, \\+U]'),
228 ++# (Mapping[str, bool], ':py:class:`~typing.Mapping`\\[:py:class:`str`, '
229 ++# ':py:class:`bool`]'),
230 ++# (Dict, ':py:class:`~typing.Dict`'),
231 ++# (Dict[T, int], ':py:class:`~typing.Dict`\\[\\~T, :py:class:`int`]'),
232 ++# (Dict[str, V], ':py:class:`~typing.Dict`\\[:py:class:`str`, \\-V]'),
233 ++# (Dict[T, U], ':py:class:`~typing.Dict`\\[\\~T, \\+U]'),
234 ++# (Dict[str, bool], ':py:class:`~typing.Dict`\\[:py:class:`str`, '
235 ++# ':py:class:`bool`]'),
236 ++# (Tuple, ':py:data:`~typing.Tuple`'),
237 ++# (Tuple[str, bool], ':py:data:`~typing.Tuple`\\[:py:class:`str`, '
238 ++# ':py:class:`bool`]'),
239 ++# (Tuple[int, int, int], ':py:data:`~typing.Tuple`\\[:py:class:`int`, '
240 ++# ':py:class:`int`, :py:class:`int`]'),
241 ++# (Tuple[str, ...], ':py:data:`~typing.Tuple`\\[:py:class:`str`, ...]'),
242 ++# (Union, ':py:data:`~typing.Union`'),
243 ++# (Union[str, bool], ':py:data:`~typing.Union`\\[:py:class:`str`, '
244 ++# ':py:class:`bool`]'),
245 ++# pytest.param(Union[str, Any], ':py:data:`~typing.Union`\\[:py:class:`str`, '
246 ++# ':py:data:`~typing.Any`]',
247 ++# marks=pytest.mark.skipif((3, 5, 0) <= sys.version_info[:3] <= (3, 5, 2),
248 ++# reason='Union erases the str on 3.5.0 -> 3.5.2')),
249 ++# (Optional[str], ':py:data:`~typing.Optional`\\[:py:class:`str`]'),
250 ++# (Callable, ':py:data:`~typing.Callable`'),
251 ++# (Callable[..., int], ':py:data:`~typing.Callable`\\[..., :py:class:`int`]'),
252 ++# (Callable[[int], int], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`], '
253 ++# ':py:class:`int`]'),
254 ++# (Callable[[int, str], bool], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`, '
255 ++# ':py:class:`str`], :py:class:`bool`]'),
256 ++# (Callable[[int, str], None], ':py:data:`~typing.Callable`\\[\\[:py:class:`int`, '
257 ++# ':py:class:`str`], ``None``]'),
258 ++# (Callable[[T], T], ':py:data:`~typing.Callable`\\[\\[\\~T], \\~T]'),
259 ++# (Pattern, ':py:class:`~typing.Pattern`'),
260 ++# (Pattern[str], ':py:class:`~typing.Pattern`\\[:py:class:`str`]'),
261 ++# (IO, ':py:class:`~typing.IO`'),
262 ++# (Metaclass, ':py:class:`~%s.Metaclass`' % __name__),
263 ++# (A, ':py:class:`~%s.A`' % __name__),
264 ++# (B, ':py:class:`~%s.B`' % __name__),
265 ++# (B[int], ':py:class:`~%s.B`\\[:py:class:`int`]' % __name__),
266 ++# (C, ':py:class:`~%s.C`' % __name__),
267 ++# (D, ':py:class:`~%s.D`' % __name__),
268 ++# (E, ':py:class:`~%s.E`' % __name__),
269 ++# (E[int], ':py:class:`~%s.E`\\[:py:class:`int`]' % __name__),
270 ++# (W, ':py:func:`~typing.NewType`\\(:py:data:`~W`, :py:class:`str`)')
271 ++# ])
272 ++# def test_format_annotation(inv, annotation, expected_result):
273 ++# result = format_annotation(annotation)
274 ++# assert result == expected_result
275 ++
276 ++# # Test with the "fully_qualified" flag turned on
277 ++# if 'typing' in expected_result or __name__ in expected_result:
278 ++# expected_result = expected_result.replace('~typing', 'typing')
279 ++# expected_result = expected_result.replace('~' + __name__, __name__)
280 ++# assert format_annotation(annotation, fully_qualified=True) == expected_result
281 ++
282 ++# # Test for the correct role (class vs data) using the official Sphinx inventory
283 ++# if 'typing' in expected_result:
284 ++# m = re.match('^:py:(?P<role>class|data|func):`~(?P<name>[^`]+)`', result)
285 ++# assert m, 'No match'
286 ++# name = m.group('name')
287 ++# expected_role = next((o.role for o in inv.objects if o.name == name), None)
288 ++# if expected_role:
289 ++# if expected_role == 'function':
290 ++# expected_role = 'func'
291 ++
292 ++# assert m.group('role') == expected_role
293 ++
294 ++
295 ++# @pytest.mark.parametrize('library', [typing, typing_extensions],
296 ++# ids=['typing', 'typing_extensions'])
297 ++# @pytest.mark.parametrize('annotation, params, expected_result', [
298 ++# ('ClassVar', int, ":py:data:`~typing.ClassVar`\\[:py:class:`int`]"),
299 ++# ('NoReturn', None, ":py:data:`~typing.NoReturn`"),
300 ++# ('Literal', ('a', 1), ":py:data:`~typing.Literal`\\['a', 1]"),
301 ++# ('Type', None, ':py:class:`~typing.Type`'),
302 ++# ('Type', (A,), ':py:class:`~typing.Type`\\[:py:class:`~%s.A`]' % __name__)
303 ++# ])
304 ++# def test_format_annotation_both_libs(inv, library, annotation, params, expected_result):
305 ++# try:
306 ++# annotation_cls = getattr(library, annotation)
307 ++# except AttributeError:
308 ++# pytest.skip('{} not available in the {} module'.format(annotation, library.__name__))
309 ++
310 ++# ann = annotation_cls if params is None else annotation_cls[params]
311 ++# result = format_annotation(ann)
312 ++# assert result == expected_result
313 +
314 +
315 + def test_process_docstring_slot_wrapper():
316 +@@ -202,304 +202,304 @@ def test_process_docstring_slot_wrapper():
317 + assert not lines
318 +
319 +
320 +-@×××××××××××.parametrize('always_document_param_types', [True, False])
321 +-@×××××××××××.sphinx('text', testroot='dummy')
322 +-def test_sphinx_output(app, status, warning, always_document_param_types):
323 +- test_path = pathlib.Path(__file__).parent
324 ++# @pytest.mark.parametrize('always_document_param_types', [True, False])
325 ++# @pytest.mark.sphinx('text', testroot='dummy')
326 ++# def test_sphinx_output(app, status, warning, always_document_param_types):
327 ++# test_path = pathlib.Path(__file__).parent
328 +
329 +- # Add test directory to sys.path to allow imports of dummy module.
330 +- if str(test_path) not in sys.path:
331 +- sys.path.insert(0, str(test_path))
332 ++# # Add test directory to sys.path to allow imports of dummy module.
333 ++# if str(test_path) not in sys.path:
334 ++# sys.path.insert(0, str(test_path))
335 +
336 +- app.config.always_document_param_types = always_document_param_types
337 +- app.config.autodoc_mock_imports = ['mailbox']
338 +- app.build()
339 ++# app.config.always_document_param_types = always_document_param_types
340 ++# app.config.autodoc_mock_imports = ['mailbox']
341 ++# app.build()
342 +
343 +- assert 'build succeeded' in status.getvalue() # Build succeeded
344 ++# assert 'build succeeded' in status.getvalue() # Build succeeded
345 +
346 +- # There should be a warning about an unresolved forward reference
347 +- warnings = warning.getvalue().strip()
348 +- assert 'Cannot resolve forward reference in type annotations of ' in warnings, warnings
349 ++# # There should be a warning about an unresolved forward reference
350 ++# warnings = warning.getvalue().strip()
351 ++# assert 'Cannot resolve forward reference in type annotations of ' in warnings, warnings
352 +
353 +- format_args = {}
354 +- if always_document_param_types:
355 +- format_args['undoc_params'] = '\n\n Parameters:\n **x** ("int") --'
356 +- else:
357 +- format_args['undoc_params'] = ""
358 ++# format_args = {}
359 ++# if always_document_param_types:
360 ++# format_args['undoc_params'] = '\n\n Parameters:\n **x** ("int") --'
361 ++# else:
362 ++# format_args['undoc_params'] = ""
363 +
364 +- if sys.version_info < (3, 6):
365 +- format_args['dataclass_docstring'] = ('Initialize self. See help(type(self)) for '
366 +- 'accurate signature.')
367 +- else:
368 +- format_args['dataclass_docstring'] = 'Return type:\n "None"'
369 ++# if sys.version_info < (3, 6):
370 ++# format_args['dataclass_docstring'] = ('Initialize self. See help(type(self)) for '
371 ++# 'accurate signature.')
372 ++# else:
373 ++# format_args['dataclass_docstring'] = 'Return type:\n "None"'
374 +
375 +- text_path = pathlib.Path(app.srcdir) / '_build' / 'text' / 'index.txt'
376 +- with text_path.open('r') as f:
377 +- text_contents = f.read().replace('–', '--')
378 +- expected_contents = textwrap.dedent('''\
379 +- Dummy Module
380 +- ************
381 ++# text_path = pathlib.Path(app.srcdir) / '_build' / 'text' / 'index.txt'
382 ++# with text_path.open('r') as f:
383 ++# text_contents = f.read().replace('–', '--')
384 ++# expected_contents = textwrap.dedent('''\
385 ++# Dummy Module
386 ++# ************
387 +
388 +- class dummy_module.Class(x, y, z=None)
389 ++# class dummy_module.Class(x, y, z=None)
390 +
391 +- Initializer docstring.
392 ++# Initializer docstring.
393 +
394 +- Parameters:
395 +- * **x** ("bool") – foo
396 ++# Parameters:
397 ++# * **x** ("bool") – foo
398 +
399 +- * **y** ("int") – bar
400 ++# * **y** ("int") – bar
401 +
402 +- * **z** ("Optional"["str"]) – baz
403 ++# * **z** ("Optional"["str"]) – baz
404 +
405 +- class InnerClass
406 ++# class InnerClass
407 +
408 +- Inner class.
409 ++# Inner class.
410 +
411 +- _InnerClass__dunder_inner_method(x)
412 ++# _InnerClass__dunder_inner_method(x)
413 +
414 +- Dunder inner method.
415 ++# Dunder inner method.
416 +
417 +- Parameters:
418 +- **x** ("bool") -- foo
419 ++# Parameters:
420 ++# **x** ("bool") -- foo
421 +
422 +- Return type:
423 +- "str"
424 ++# Return type:
425 ++# "str"
426 +
427 +- inner_method(x)
428 ++# inner_method(x)
429 +
430 +- Inner method.
431 ++# Inner method.
432 +
433 +- Parameters:
434 +- **x** ("bool") -- foo
435 ++# Parameters:
436 ++# **x** ("bool") -- foo
437 +
438 +- Return type:
439 +- "str"
440 ++# Return type:
441 ++# "str"
442 +
443 +- _Class__dunder_method(x)
444 ++# _Class__dunder_method(x)
445 +
446 +- Dunder method docstring.
447 ++# Dunder method docstring.
448 +
449 +- Parameters:
450 +- **x** ("str") -- foo
451 ++# Parameters:
452 ++# **x** ("str") -- foo
453 +
454 +- Return type:
455 +- "str"
456 ++# Return type:
457 ++# "str"
458 +
459 +- __magic_custom_method__(x)
460 ++# __magic_custom_method__(x)
461 +
462 +- Magic dunder method docstring.
463 ++# Magic dunder method docstring.
464 +
465 +- Parameters:
466 +- **x** ("str") -- foo
467 ++# Parameters:
468 ++# **x** ("str") -- foo
469 +
470 +- Return type:
471 +- "str"
472 ++# Return type:
473 ++# "str"
474 +
475 +- _private_method(x)
476 ++# _private_method(x)
477 +
478 +- Private method docstring.
479 ++# Private method docstring.
480 +
481 +- Parameters:
482 +- **x** ("str") -- foo
483 ++# Parameters:
484 ++# **x** ("str") -- foo
485 +
486 +- Return type:
487 +- "str"
488 ++# Return type:
489 ++# "str"
490 +
491 +- classmethod a_classmethod(x, y, z=None)
492 ++# classmethod a_classmethod(x, y, z=None)
493 +
494 +- Classmethod docstring.
495 ++# Classmethod docstring.
496 +
497 +- Parameters:
498 +- * **x** ("bool") – foo
499 ++# Parameters:
500 ++# * **x** ("bool") – foo
501 +
502 +- * **y** ("int") – bar
503 ++# * **y** ("int") – bar
504 +
505 +- * **z** ("Optional"["str"]) – baz
506 ++# * **z** ("Optional"["str"]) – baz
507 +
508 +- Return type:
509 +- "str"
510 ++# Return type:
511 ++# "str"
512 +
513 +- a_method(x, y, z=None)
514 ++# a_method(x, y, z=None)
515 +
516 +- Method docstring.
517 ++# Method docstring.
518 +
519 +- Parameters:
520 +- * **x** ("bool") – foo
521 ++# Parameters:
522 ++# * **x** ("bool") – foo
523 +
524 +- * **y** ("int") – bar
525 ++# * **y** ("int") – bar
526 +
527 +- * **z** ("Optional"["str"]) – baz
528 ++# * **z** ("Optional"["str"]) – baz
529 +
530 +- Return type:
531 +- "str"
532 ++# Return type:
533 ++# "str"
534 +
535 +- property a_property
536 ++# property a_property
537 +
538 +- Property docstring
539 ++# Property docstring
540 +
541 +- Return type:
542 +- "str"
543 ++# Return type:
544 ++# "str"
545 +
546 +- static a_staticmethod(x, y, z=None)
547 ++# static a_staticmethod(x, y, z=None)
548 +
549 +- Staticmethod docstring.
550 ++# Staticmethod docstring.
551 +
552 +- Parameters:
553 +- * **x** ("bool") – foo
554 ++# Parameters:
555 ++# * **x** ("bool") – foo
556 +
557 +- * **y** ("int") – bar
558 ++# * **y** ("int") – bar
559 +
560 +- * **z** ("Optional"["str"]) – baz
561 ++# * **z** ("Optional"["str"]) – baz
562 +
563 +- Return type:
564 +- "str"
565 ++# Return type:
566 ++# "str"
567 +
568 +- locally_defined_callable_field() -> str
569 ++# locally_defined_callable_field() -> str
570 +
571 +- Wrapper
572 ++# Wrapper
573 +
574 +- Return type:
575 +- "str"
576 ++# Return type:
577 ++# "str"
578 +
579 +- exception dummy_module.DummyException(message)
580 ++# exception dummy_module.DummyException(message)
581 +
582 +- Exception docstring
583 ++# Exception docstring
584 +
585 +- Parameters:
586 +- **message** ("str") – blah
587 ++# Parameters:
588 ++# **message** ("str") – blah
589 +
590 +- dummy_module.function(x, y, z_=None)
591 ++# dummy_module.function(x, y, z_=None)
592 +
593 +- Function docstring.
594 ++# Function docstring.
595 +
596 +- Parameters:
597 +- * **x** ("bool") – foo
598 ++# Parameters:
599 ++# * **x** ("bool") – foo
600 +
601 +- * **y** ("int") – bar
602 ++# * **y** ("int") – bar
603 +
604 +- * **z_** ("Optional"["str"]) – baz
605 ++# * **z_** ("Optional"["str"]) – baz
606 +
607 +- Returns:
608 +- something
609 ++# Returns:
610 ++# something
611 +
612 +- Return type:
613 +- bytes
614 ++# Return type:
615 ++# bytes
616 +
617 +- dummy_module.function_with_escaped_default(x='\\x08')
618 ++# dummy_module.function_with_escaped_default(x='\\x08')
619 +
620 +- Function docstring.
621 ++# Function docstring.
622 +
623 +- Parameters:
624 +- **x** ("str") – foo
625 ++# Parameters:
626 ++# **x** ("str") – foo
627 +
628 +- dummy_module.function_with_unresolvable_annotation(x)
629 ++# dummy_module.function_with_unresolvable_annotation(x)
630 +
631 +- Function docstring.
632 ++# Function docstring.
633 +
634 +- Parameters:
635 +- **x** (*a.b.c*) – foo
636 ++# Parameters:
637 ++# **x** (*a.b.c*) – foo
638 +
639 +- dummy_module.function_with_typehint_comment(x, y)
640 ++# dummy_module.function_with_typehint_comment(x, y)
641 +
642 +- Function docstring.
643 ++# Function docstring.
644 +
645 +- Parameters:
646 +- * **x** ("int") – foo
647 ++# Parameters:
648 ++# * **x** ("int") – foo
649 +
650 +- * **y** ("str") – bar
651 ++# * **y** ("str") – bar
652 +
653 +- Return type:
654 +- "None"
655 ++# Return type:
656 ++# "None"
657 +
658 +- class dummy_module.ClassWithTypehints(x)
659 ++# class dummy_module.ClassWithTypehints(x)
660 +
661 +- Class docstring.
662 ++# Class docstring.
663 +
664 +- Parameters:
665 +- **x** ("int") -- foo
666 ++# Parameters:
667 ++# **x** ("int") -- foo
668 +
669 +- foo(x)
670 ++# foo(x)
671 +
672 +- Method docstring.
673 ++# Method docstring.
674 +
675 +- Parameters:
676 +- **x** ("str") -- foo
677 ++# Parameters:
678 ++# **x** ("str") -- foo
679 +
680 +- Return type:
681 +- "int"
682 ++# Return type:
683 ++# "int"
684 +
685 +- dummy_module.function_with_typehint_comment_not_inline(x=None, *y, z, **kwargs)
686 ++# dummy_module.function_with_typehint_comment_not_inline(x=None, *y, z, **kwargs)
687 +
688 +- Function docstring.
689 ++# Function docstring.
690 +
691 +- Parameters:
692 +- * **x** ("Union"["str", "bytes", "None"]) -- foo
693 ++# Parameters:
694 ++# * **x** ("Union"["str", "bytes", "None"]) -- foo
695 +
696 +- * **y** ("str") -- bar
697 ++# * **y** ("str") -- bar
698 +
699 +- * **z** ("bytes") -- baz
700 ++# * **z** ("bytes") -- baz
701 +
702 +- * **kwargs** ("int") -- some kwargs
703 ++# * **kwargs** ("int") -- some kwargs
704 +
705 +- Return type:
706 +- "None"
707 ++# Return type:
708 ++# "None"
709 +
710 +- class dummy_module.ClassWithTypehintsNotInline(x=None)
711 ++# class dummy_module.ClassWithTypehintsNotInline(x=None)
712 +
713 +- Class docstring.
714 ++# Class docstring.
715 +
716 +- Parameters:
717 +- **x** ("Optional"["Callable"[["int", "bytes"], "int"]]) -- foo
718 ++# Parameters:
719 ++# **x** ("Optional"["Callable"[["int", "bytes"], "int"]]) -- foo
720 +
721 +- foo(x=1)
722 ++# foo(x=1)
723 +
724 +- Method docstring.
725 ++# Method docstring.
726 +
727 +- Parameters:
728 +- **x** ("Callable"[["int", "bytes"], "int"]) -- foo
729 ++# Parameters:
730 ++# **x** ("Callable"[["int", "bytes"], "int"]) -- foo
731 +
732 +- Return type:
733 +- "int"
734 ++# Return type:
735 ++# "int"
736 +
737 +- classmethod mk(x=None)
738 ++# classmethod mk(x=None)
739 +
740 +- Method docstring.
741 ++# Method docstring.
742 +
743 +- Parameters:
744 +- **x** (*Callable**[**[**int**, **bytes**]**, **int**]*) --
745 +- foo
746 ++# Parameters:
747 ++# **x** (*Callable**[**[**int**, **bytes**]**, **int**]*) --
748 ++# foo
749 +
750 +- Return type:
751 +- ClassWithTypehintsNotInline
752 ++# Return type:
753 ++# ClassWithTypehintsNotInline
754 +
755 +- dummy_module.undocumented_function(x)
756 ++# dummy_module.undocumented_function(x)
757 +
758 +- Hi{undoc_params}
759 ++# Hi{undoc_params}
760 +
761 +- Return type:
762 +- "str"
763 ++# Return type:
764 ++# "str"
765 +
766 +- class dummy_module.DataClass
767 ++# class dummy_module.DataClass
768 +
769 +- Class docstring.
770 ++# Class docstring.
771 +
772 +- __init__()
773 ++# __init__()
774 +
775 +- {dataclass_docstring}
776 ++# {dataclass_docstring}
777 +
778 +- @dummy_module.Decorator(func)
779 ++# @dummy_module.Decorator(func)
780 +
781 +- Initializer docstring.
782 ++# Initializer docstring.
783 +
784 +- Parameters:
785 +- **func** ("Callable"[["int", "str"], "str"]) -- function
786 ++# Parameters:
787 ++# **func** ("Callable"[["int", "str"], "str"]) -- function
788 +
789 +- dummy_module.mocked_import(x)
790 ++# dummy_module.mocked_import(x)
791 +
792 +- A docstring.
793 ++# A docstring.
794 +
795 +- Parameters:
796 +- **x** ("Mailbox") -- function
797 +- ''')
798 +- expected_contents = expected_contents.format(**format_args).replace('–', '--')
799 +- assert text_contents == expected_contents
800 ++# Parameters:
801 ++# **x** ("Mailbox") -- function
802 ++# ''')
803 ++# expected_contents = expected_contents.format(**format_args).replace('–', '--')
804 ++# assert text_contents == expected_contents
805
806 diff --git a/dev-python/sphinx-autodoc-typehints/metadata.xml b/dev-python/sphinx-autodoc-typehints/metadata.xml
807 new file mode 100644
808 index 0000000..dd0bd9c
809 --- /dev/null
810 +++ b/dev-python/sphinx-autodoc-typehints/metadata.xml
811 @@ -0,0 +1,13 @@
812 +<?xml version="1.0" encoding="UTF-8"?>
813 +<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
814 +
815 +<pkgmetadata>
816 + <maintainer type="person">
817 + <email>andrewammerlaan@××××××.net</email>
818 + <name>Andrew Ammerlaan</name>
819 + </maintainer>
820 + <maintainer type="project">
821 + <email>proxy-maint@g.o</email>
822 + <name>Proxy Maintainers</name>
823 + </maintainer>
824 +</pkgmetadata>
825
826 diff --git a/dev-python/sphinx-autodoc-typehints/sphinx-autodoc-typehints-1.10.3.ebuild b/dev-python/sphinx-autodoc-typehints/sphinx-autodoc-typehints-1.10.3.ebuild
827 new file mode 100644
828 index 0000000..2db98eb
829 --- /dev/null
830 +++ b/dev-python/sphinx-autodoc-typehints/sphinx-autodoc-typehints-1.10.3.ebuild
831 @@ -0,0 +1,25 @@
832 +# Copyright 1999-2020 Gentoo Authors
833 +# Distributed under the terms of the GNU General Public License v2
834 +
835 +EAPI=7
836 +
837 +PYTHON_COMPAT=( python3_{6,7} )
838 +
839 +inherit distutils-r1
840 +
841 +DESCRIPTION="Type hints support for the Sphinx autodoc extension "
842 +HOMEPAGE="https://github.com/agronholm/sphinx-autodoc-typehints"
843 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
844 +
845 +LICENSE="MIT"
846 +KEYWORDS="~amd64 ~x86 "
847 +SLOT="0"
848 +
849 +BDEPEND="dev-python/setuptools_scm[${PYTHON_USEDEP}]"
850 +
851 +DEPEND="test? ( dev-python/sphobjinv[${PYTHON_USEDEP}]
852 + dev-python/typing-extensions[${PYTHON_USEDEP}] )"
853 +
854 +distutils_enable_tests pytest
855 +
856 +PATCHES="${FILESDIR}/${P}-skip-online-tests.patch"