|
17 | 17 |
|
18 | 18 | import django
|
19 | 19 |
|
20 |
| -MOCK_MODULES = [ |
21 |
| - 'webob', |
22 |
| - 'lxml' |
23 |
| -] |
24 |
| - |
25 |
| -for mod_name in MOCK_MODULES: |
26 |
| - sys.modules[mod_name] = mock.Mock(class_that_is_extended=object) |
27 |
| - |
28 | 20 |
|
29 | 21 | # If extensions (or modules to document with autodoc) are in another directory,
|
30 | 22 | # add these directories to sys.path here. If the directory is relative to the
|
|
111 | 103 | # A list of ignored prefixes for module index sorting.
|
112 | 104 | #modindex_common_prefix = []
|
113 | 105 |
|
| 106 | +# Display the type hints in the docs as part of the function signature. |
| 107 | +# This is the default, but it could be changed to "description" or "both". |
| 108 | +# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_typehints |
| 109 | +autodoc_typehints = "signature" |
| 110 | + |
114 | 111 | # When auto-doc'ing a class, write the class' docstring and the __init__ docstring
|
115 | 112 | # into the class docs.
|
116 | 113 | autoclass_content = "both"
|
|
129 | 126 | ('py:class', 'aside_fn'),
|
130 | 127 | ('py:class', 'webob.Request'),
|
131 | 128 | ('py:class', 'webob.Response'),
|
| 129 | + ('py:class', 'webob.request.Request'), |
| 130 | + ('py:class', 'webob.response.Response'), |
| 131 | + ('py:class', 'lxml.etree._Element'), |
| 132 | + # As of Sphinx==8.0.2 and Python 3.11, its seems that Sphinx has bug(s) that make it |
| 133 | + # unable to consistently recognize classes in otherwise-valid type annotations. So, since |
| 134 | + # adding type hints to XBlock, we've had to add this big list of warning suppressions. |
| 135 | + # If you're reading this in the future with newer versions of Sphinx and/or Python, feel |
| 136 | + # free to try to whittle down this list: |
| 137 | + ('py:class', 'Blocklike'), |
| 138 | + ('py:class', 'BlocklikeSubclass'), |
| 139 | + ('py:class', 'DefinitionKey'), |
| 140 | + ('py:class', 'FieldValue'), |
| 141 | + ('py:class', 'InnerFieldValue'), |
| 142 | + ('py:class', 'Request'), |
| 143 | + ('py:class', 'Response'), |
| 144 | + ('py:class', 'UniqueIdPlaceholder'), |
| 145 | + ('py:class', 'Unset'), |
| 146 | + ('py:class', 'UsageKey'), |
| 147 | + ('py:class', 'etree._Element'), |
| 148 | + ('py:class', 'importlib.metadata.EntryPoint'), |
| 149 | + ('py:class', 'importlib.metadata.EntryPoint'), |
| 150 | + ('py:class', 'opaque_keys.edx.keys.DefinitionKey'), |
| 151 | + ('py:class', 'opaque_keys.edx.keys.LearningContextKey'), |
| 152 | + ('py:class', 'opaque_keys.edx.keys.UsageKey'), |
| 153 | + ('py:class', 't.Any'), |
| 154 | + ('py:class', 't.Callable'), |
| 155 | + ('py:class', 't.Iterable'), |
| 156 | + ('py:class', 'web_fragments.fragment.Fragment'), |
| 157 | + ('py:class', 'xblock.core.Blocklike'), |
| 158 | + ('py:class', 'xblock.fields.FieldValue'), |
| 159 | + ('py:class', 'xblock.fields.InnerFieldValue'), |
| 160 | + ('py:class', 'xblock.fields.UniqueIdPlaceholder'), |
| 161 | + ('py:class', 'xblock.fields.Unset'), |
| 162 | + ('py:class', 'xblock.validation.Validation'), |
132 | 163 | ]
|
133 | 164 |
|
134 | 165 | suppress_warnings = [
|
|
0 commit comments