doc: have tighter control on what autodoc shows

New versions of sphinx starting showing `__init__` parameters even when
we don't want them to show because they are private (have `_ispytest`
argument).

The only working solution I found was to switch to
`autodoc_typehints_description_target = "documented"` and explicitly
document parameters for which we want to show the types. It's a little
tedious and repetitive in some simple cases, but overall it results in
nicer API docs.
This commit is contained in:
Ran Benita
2021-10-29 21:18:12 +03:00
parent cb7f5ed3b1
commit 7431750bb6
16 changed files with 335 additions and 168 deletions

View File

@@ -38,6 +38,7 @@ release = ".".join(version.split(".")[:2])
autodoc_member_order = "bysource"
autodoc_typehints = "description"
autodoc_typehints_description_target = "documented"
todo_include_todos = 1
latex_engine = "lualatex"

View File

@@ -102,7 +102,7 @@ pytest.deprecated_call
**Tutorial**: :ref:`ensuring_function_triggers`
.. autofunction:: pytest.deprecated_call()
.. autofunction:: pytest.deprecated_call([match])
:with:
pytest.register_assert_rewrite