sphinx-autoapi 3.3.1__tar.gz → 3.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/CHANGELOG.rst +9 -0
- {sphinx_autoapi-3.3.1/sphinx_autoapi.egg-info → sphinx_autoapi-3.3.2}/PKG-INFO +1 -1
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/__init__.py +2 -2
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/documenters.py +23 -12
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2/sphinx_autoapi.egg-info}/PKG-INFO +1 -1
- {sphinx_autoapi-3.3.1/tests/python/pymovedconfpy → sphinx_autoapi-3.3.2/tests/python/pyexample}/example/example.py +24 -0
- {sphinx_autoapi-3.3.1/tests/python/pyexample → sphinx_autoapi-3.3.2/tests/python/pymovedconfpy}/example/example.py +24 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/test_pyintegration.py +68 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/LICENSE.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/MANIFEST.in +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/README.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/_astroid_utils.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/_mapper.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/_objects.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/_parser.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/directives.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/extension.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/inheritance_diagrams.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/settings.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/attribute.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/class.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/data.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/exception.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/function.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/method.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/module.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/package.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/autoapi/templates/python/property.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/pyproject.toml +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/setup.cfg +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/setup.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/sphinx_autoapi.egg-info/SOURCES.txt +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/sphinx_autoapi.egg-info/dependency_links.txt +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/sphinx_autoapi.egg-info/requires.txt +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/sphinx_autoapi.egg-info/top_level.txt +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/conftest.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pep695/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pep695/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pep695/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py310unionpipe/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py310unionpipe/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py310unionpipe/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py38positionalparams/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py38positionalparams/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py38positionalparams/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3example/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3example/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3example/example/example2.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3example/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3implicitnamespace/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3implicitnamespace/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3implicitnamespace/namespace/example/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3implicitnamespace/namespace/sibling/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py3implicitnamespace/namespace/sibling/sub_sibling.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyannotationcommentsexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyannotationcommentsexample/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyannotationcommentsexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/example/example2.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyemptyexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyemptyexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyexample/manualapi.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyexample/null.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample/example/example.pyi +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample2/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample2/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample2/example/example.pyi +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyiexample2/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyisubmoduleinit/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyisubmoduleinit/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyisubmoduleinit/example/submodule_foo/__init__.pyi +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyisubmoduleinit/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pymovedconfpy/confpy/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pymovedconfpy/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pymovedconfpy/manualapi.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pynorender/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pynorender/example/_example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pynorender/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/_private_module.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/binary_data.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/foo.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/subpackage/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/subpackage/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/unicode_data.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/wildall/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/wildall/simple/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/wildcard/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/wildchain/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/wildwildchain/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/_private_submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/_private_subpackage/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/_private_subpackage/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/_private_subpackage/subpackage/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/_private_subpackage/subpackage/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/subpackage/__init__.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/subpackage/submodule.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyskipexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyskipexample/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyskipexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pystdlib/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pystdlib/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pystdlib/stdlib/json.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pystdlib/stdlib/myast.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pystdlib/stdlib/myjson.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/test_own_page_option.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/test_parser.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/templateexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/templateexample/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/templateexample/index.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/templateexample/template_overrides/python/function.rst +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/test_astroid_utils.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/test_integration.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/toctreeexample/conf.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/toctreeexample/example/example.py +0 -0
- {sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/toctreeexample/index.rst +0 -0
|
@@ -5,6 +5,15 @@ Versions follow `Semantic Versioning <https://semver.org/>`_ (``<major>.<minor>.
|
|
|
5
5
|
|
|
6
6
|
.. towncrier release notes start
|
|
7
7
|
|
|
8
|
+
v3.3.2 (2024-09-25)
|
|
9
|
+
-------------------
|
|
10
|
+
|
|
11
|
+
Bugfixes
|
|
12
|
+
^^^^^^^^
|
|
13
|
+
|
|
14
|
+
- Fix types missing from documentation generated by autodoc-style directives. (#473)
|
|
15
|
+
|
|
16
|
+
|
|
8
17
|
v3.3.1 (2024-09-01)
|
|
9
18
|
-------------------
|
|
10
19
|
|
|
@@ -98,7 +98,7 @@ class _AutoapiDocstringSignatureMixin:
|
|
|
98
98
|
|
|
99
99
|
|
|
100
100
|
class AutoapiFunctionDocumenter(
|
|
101
|
-
AutoapiDocumenter, autodoc.FunctionDocumenter
|
|
101
|
+
AutoapiDocumenter, _AutoapiDocstringSignatureMixin, autodoc.FunctionDocumenter
|
|
102
102
|
):
|
|
103
103
|
objtype = "apifunction"
|
|
104
104
|
directivetype = "function"
|
|
@@ -147,9 +147,7 @@ class AutoapiDecoratorDocumenter(
|
|
|
147
147
|
return "(" + to_format + ")"
|
|
148
148
|
|
|
149
149
|
|
|
150
|
-
class AutoapiClassDocumenter(
|
|
151
|
-
AutoapiDocumenter, autodoc.ClassDocumenter, _AutoapiDocstringSignatureMixin
|
|
152
|
-
):
|
|
150
|
+
class AutoapiClassDocumenter(AutoapiDocumenter, autodoc.ClassDocumenter):
|
|
153
151
|
objtype = "apiclass"
|
|
154
152
|
directivetype = "class"
|
|
155
153
|
doc_as_attr = False
|
|
@@ -174,9 +172,18 @@ class AutoapiClassDocumenter(
|
|
|
174
172
|
bases = ", ".join(f":class:`{base}`" for base in self.object.bases)
|
|
175
173
|
self.add_line(f" Bases: {bases}", sourcename)
|
|
176
174
|
|
|
175
|
+
def format_signature(self, **kwargs):
|
|
176
|
+
# Set "manual" attributes at the last possible moment.
|
|
177
|
+
# This is to let a manual entry or docstring searching happen first,
|
|
178
|
+
# and falling back to the discovered signature only when necessary.
|
|
179
|
+
if self.args is None:
|
|
180
|
+
self.args = self.object.args
|
|
181
|
+
|
|
182
|
+
return super().format_signature(**kwargs)
|
|
183
|
+
|
|
177
184
|
|
|
178
185
|
class AutoapiMethodDocumenter(
|
|
179
|
-
AutoapiDocumenter, autodoc.MethodDocumenter
|
|
186
|
+
AutoapiDocumenter, _AutoapiDocstringSignatureMixin, autodoc.MethodDocumenter
|
|
180
187
|
):
|
|
181
188
|
objtype = "apimethod"
|
|
182
189
|
directivetype = "method"
|
|
@@ -230,9 +237,6 @@ class AutoapiPropertyDocumenter(AutoapiDocumenter, autodoc.PropertyDocumenter):
|
|
|
230
237
|
autodoc.ClassLevelDocumenter.add_directive_header(self, sig)
|
|
231
238
|
|
|
232
239
|
sourcename = self.get_sourcename()
|
|
233
|
-
if self.options.annotation and self.options.annotation is not autodoc.SUPPRESS:
|
|
234
|
-
self.add_line(f" :type: {self.options.annotation}", sourcename)
|
|
235
|
-
|
|
236
240
|
for property_type in (
|
|
237
241
|
"abstractmethod",
|
|
238
242
|
"classmethod",
|
|
@@ -240,6 +244,9 @@ class AutoapiPropertyDocumenter(AutoapiDocumenter, autodoc.PropertyDocumenter):
|
|
|
240
244
|
if property_type in self.object.properties:
|
|
241
245
|
self.add_line(f" :{property_type}:", sourcename)
|
|
242
246
|
|
|
247
|
+
if self.object.annotation:
|
|
248
|
+
self.add_line(f" :type: {self.object.annotation}", sourcename)
|
|
249
|
+
|
|
243
250
|
|
|
244
251
|
class AutoapiDataDocumenter(AutoapiDocumenter, autodoc.DataDocumenter):
|
|
245
252
|
objtype = "apidata"
|
|
@@ -254,14 +261,16 @@ class AutoapiDataDocumenter(AutoapiDocumenter, autodoc.DataDocumenter):
|
|
|
254
261
|
autodoc.ModuleLevelDocumenter.add_directive_header(self, sig)
|
|
255
262
|
sourcename = self.get_sourcename()
|
|
256
263
|
if not self.options.annotation:
|
|
257
|
-
# TODO: Change sphinx to allow overriding of object description
|
|
258
264
|
if self.object.value is not None:
|
|
259
|
-
self.add_line(f" :
|
|
265
|
+
self.add_line(f" :value: {self.object.value}", sourcename)
|
|
260
266
|
elif self.options.annotation is autodoc.SUPPRESS:
|
|
261
267
|
pass
|
|
262
268
|
else:
|
|
263
269
|
self.add_line(f" :annotation: {self.options.annotation}", sourcename)
|
|
264
270
|
|
|
271
|
+
if self.object.annotation:
|
|
272
|
+
self.add_line(f" :type: {self.object.annotation}", sourcename)
|
|
273
|
+
|
|
265
274
|
|
|
266
275
|
class AutoapiAttributeDocumenter(AutoapiDocumenter, autodoc.AttributeDocumenter):
|
|
267
276
|
objtype = "apiattribute"
|
|
@@ -277,14 +286,16 @@ class AutoapiAttributeDocumenter(AutoapiDocumenter, autodoc.AttributeDocumenter)
|
|
|
277
286
|
autodoc.ClassLevelDocumenter.add_directive_header(self, sig)
|
|
278
287
|
sourcename = self.get_sourcename()
|
|
279
288
|
if not self.options.annotation:
|
|
280
|
-
# TODO: Change sphinx to allow overriding of object description
|
|
281
289
|
if self.object.value is not None:
|
|
282
|
-
self.add_line(f" :
|
|
290
|
+
self.add_line(f" :value: {self.object.value}", sourcename)
|
|
283
291
|
elif self.options.annotation is autodoc.SUPPRESS:
|
|
284
292
|
pass
|
|
285
293
|
else:
|
|
286
294
|
self.add_line(f" :annotation: {self.options.annotation}", sourcename)
|
|
287
295
|
|
|
296
|
+
if self.object.annotation:
|
|
297
|
+
self.add_line(f" :type: {self.object.annotation}", sourcename)
|
|
298
|
+
|
|
288
299
|
|
|
289
300
|
class AutoapiModuleDocumenter(AutoapiDocumenter, autodoc.ModuleDocumenter):
|
|
290
301
|
objtype = "apimodule"
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
This is a description
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
from dataclasses import dataclass
|
|
6
7
|
from functools import cached_property
|
|
7
8
|
|
|
8
9
|
A_TUPLE = ("a", "b")
|
|
@@ -171,3 +172,26 @@ def fn_with_long_sig(
|
|
|
171
172
|
arguments
|
|
172
173
|
):
|
|
173
174
|
"""A function with a long signature."""
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
TYPED_DATA: int = 1
|
|
178
|
+
"""This is TYPED_DATA."""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@dataclass
|
|
182
|
+
class TypedAttrs:
|
|
183
|
+
one: str
|
|
184
|
+
"""This is TypedAttrs.one."""
|
|
185
|
+
two: int = 1
|
|
186
|
+
"""This is TypedAttrs.two."""
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class TypedClassInit:
|
|
190
|
+
"""This is TypedClassInit."""
|
|
191
|
+
|
|
192
|
+
def __init__(self, one: int = 1) -> None:
|
|
193
|
+
self._one = one
|
|
194
|
+
|
|
195
|
+
def typed_method(self, two: int) -> int:
|
|
196
|
+
"""This is TypedClassInit.typed_method."""
|
|
197
|
+
return self._one + two
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
This is a description
|
|
4
4
|
"""
|
|
5
5
|
|
|
6
|
+
from dataclasses import dataclass
|
|
6
7
|
from functools import cached_property
|
|
7
8
|
|
|
8
9
|
A_TUPLE = ("a", "b")
|
|
@@ -171,3 +172,26 @@ def fn_with_long_sig(
|
|
|
171
172
|
arguments
|
|
172
173
|
):
|
|
173
174
|
"""A function with a long signature."""
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
TYPED_DATA: int = 1
|
|
178
|
+
"""This is TYPED_DATA."""
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
@dataclass
|
|
182
|
+
class TypedAttrs:
|
|
183
|
+
one: str
|
|
184
|
+
"""This is TypedAttrs.one."""
|
|
185
|
+
two: int = 1
|
|
186
|
+
"""This is TypedAttrs.two."""
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
class TypedClassInit:
|
|
190
|
+
"""This is TypedClassInit."""
|
|
191
|
+
|
|
192
|
+
def __init__(self, one: int = 1) -> None:
|
|
193
|
+
self._one = one
|
|
194
|
+
|
|
195
|
+
def typed_method(self, two: int) -> int:
|
|
196
|
+
"""This is TypedClassInit.typed_method."""
|
|
197
|
+
return self._one + two
|
|
@@ -177,6 +177,74 @@ class TestSimpleModuleManual:
|
|
|
177
177
|
example_file = parse("_build/html/manualapi.html")
|
|
178
178
|
assert example_file.find(id="example.decorator_okay")
|
|
179
179
|
|
|
180
|
+
def test_dataclass(self, parse):
|
|
181
|
+
example_file = parse("_build/html/manualapi.html")
|
|
182
|
+
|
|
183
|
+
typedattrs_sig = example_file.find(id="example.TypedAttrs")
|
|
184
|
+
assert typedattrs_sig
|
|
185
|
+
|
|
186
|
+
typedattrs = typedattrs_sig.parent
|
|
187
|
+
|
|
188
|
+
one = typedattrs.find(id="example.TypedAttrs.one")
|
|
189
|
+
assert one
|
|
190
|
+
one_value = one.find_all(class_="property")
|
|
191
|
+
assert one_value[0].text == ": str"
|
|
192
|
+
one_docstring = one.parent.find("dd").contents[0].text
|
|
193
|
+
assert one_docstring.strip() == "This is TypedAttrs.one."
|
|
194
|
+
|
|
195
|
+
two = typedattrs.find(id="example.TypedAttrs.two")
|
|
196
|
+
assert two
|
|
197
|
+
two_value = two.find_all(class_="property")
|
|
198
|
+
assert two_value[0].text == ": int"
|
|
199
|
+
assert two_value[1].text == " = 1"
|
|
200
|
+
two_docstring = two.parent.find("dd").contents[0].text
|
|
201
|
+
assert two_docstring.strip() == "This is TypedAttrs.two."
|
|
202
|
+
|
|
203
|
+
def test_data(self, parse):
|
|
204
|
+
example_file = parse("_build/html/manualapi.html")
|
|
205
|
+
|
|
206
|
+
typed_data = example_file.find(id="example.TYPED_DATA")
|
|
207
|
+
assert typed_data
|
|
208
|
+
typed_data_value = typed_data.find_all(class_="property")
|
|
209
|
+
assert typed_data_value[0].text == ": int"
|
|
210
|
+
assert typed_data_value[1].text == " = 1"
|
|
211
|
+
|
|
212
|
+
typed_data_docstring = typed_data.parent.find("dd").contents[0].text
|
|
213
|
+
assert typed_data_docstring.strip() == "This is TYPED_DATA."
|
|
214
|
+
|
|
215
|
+
def test_class(self, parse):
|
|
216
|
+
example_file = parse("_build/html/manualapi.html")
|
|
217
|
+
|
|
218
|
+
typed_cls = example_file.find(id="example.TypedClassInit")
|
|
219
|
+
assert typed_cls
|
|
220
|
+
arg = typed_cls.find(class_="sig-param")
|
|
221
|
+
assert arg.text == "one: int = 1"
|
|
222
|
+
typed_cls_docstring = typed_cls.parent.find("dd").contents[0].text
|
|
223
|
+
assert typed_cls_docstring.strip() == "This is TypedClassInit."
|
|
224
|
+
|
|
225
|
+
typed_method = example_file.find(id="example.TypedClassInit.typed_method")
|
|
226
|
+
assert typed_method
|
|
227
|
+
arg = typed_method.find(class_="sig-param")
|
|
228
|
+
assert arg.text == "two: int"
|
|
229
|
+
return_type = typed_method.find(class_="sig-return-typehint")
|
|
230
|
+
assert return_type.text == "int"
|
|
231
|
+
typed_method_docstring = typed_method.parent.find("dd").contents[0].text
|
|
232
|
+
assert typed_method_docstring.strip() == "This is TypedClassInit.typed_method."
|
|
233
|
+
|
|
234
|
+
def test_property(self, parse):
|
|
235
|
+
example_file = parse("_build/html/manualapi.html")
|
|
236
|
+
|
|
237
|
+
foo_sig = example_file.find(id="example.Foo")
|
|
238
|
+
assert foo_sig
|
|
239
|
+
foo = foo_sig.parent
|
|
240
|
+
|
|
241
|
+
property_simple = foo.find(id="example.Foo.property_simple")
|
|
242
|
+
assert property_simple
|
|
243
|
+
property_simple_value = property_simple.find_all(class_="property")
|
|
244
|
+
assert property_simple_value[-1].text == ": int"
|
|
245
|
+
property_simple_docstring = property_simple.parent.find("dd").text.strip()
|
|
246
|
+
assert property_simple_docstring == "This property should parse okay."
|
|
247
|
+
|
|
180
248
|
|
|
181
249
|
class TestMovedConfPy(TestSimpleModule):
|
|
182
250
|
@pytest.fixture(autouse=True, scope="class")
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py310unionpipe/example/example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/py38positionalparams/example/example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyannotationcommentsexample/conf.py
RENAMED
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyannotationcommentsexample/index.rst
RENAMED
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/example/example.py
RENAMED
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyautodoc_typehints/example/example2.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pyisubmoduleinit/example/example.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/binary_data.py
RENAMED
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/submodule.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackagecomplex/complex/unicode_data.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{sphinx_autoapi-3.3.1 → sphinx_autoapi-3.3.2}/tests/python/pypackageexample/package/submodule.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|