|
20 | 20 |
|
21 | 21 | from sphinx.application import Sphinx |
22 | 22 | from sphinx.domains import ObjType |
23 | | -from sphinx.domains.python import PyClasslike, PyAttribute, PyXRefRole |
| 23 | +from sphinx.domains.python import PyClasslike, PyXRefRole |
24 | 24 | from sphinx.ext import autodoc, autosummary |
25 | 25 | from sphinx.ext.autosummary import mangle_signature as _msig |
26 | 26 | from sphinx.ext.autosummary.generate import generate_autosummary_content as _gac |
27 | 27 | from sphinx.util.inspect import object_description |
28 | | -from sphinx_toolbox.more_autodoc.typehints import format_annotation |
29 | | -from typing import Type, Any, Dict, List, Tuple, Union |
| 28 | +from sphinx.util.typing import restify |
| 29 | +from typing import Any, Dict, List, Tuple |
30 | 30 |
|
31 | 31 | _pre_re = re.compile(r'^( = )(.*)') |
32 | 32 |
|
@@ -129,7 +129,7 @@ def render(self, name, ns): |
129 | 129 | for _base in mro[: mro.index(enum.Enum)]: |
130 | 130 | if not isinstance(_base, enum.EnumMeta): |
131 | 131 | ns['member_type'] = ( |
132 | | - f"Member type: {format_annotation(_base)}" |
| 132 | + f"Member type: {restify(_base, mode='smart')}" |
133 | 133 | ) |
134 | 134 | break |
135 | 135 | return super().render(name, ns) |
|
0 commit comments