|
53 | 53 | ("py:class", "click.core.Command"), |
54 | 54 | # Python 3.12 |
55 | 55 | ("py:class", "FilterCallbackFunc"), |
| 56 | + # Sphinx internals that may leak through rendered type hints |
| 57 | + ("py:class", "TypeAliasForwardRef"), |
| 58 | + # ParamSpec objects are not classes but may be referenced as such |
| 59 | + ("py:class", "tutor.core.hooks.actions.T"), |
| 60 | + ("py:class", "typing_extensions.ParamSpec"), |
56 | 61 | ] |
| 62 | + |
| 63 | +# Even outside nitpicky mode, some type-hint rendering can produce "ref.class" |
| 64 | +# warnings for typing-related objects that are not meaningfully documentable here. |
| 65 | +# These warnings are not actionable for Tutor maintainers and would otherwise fail |
| 66 | +# the build because `make docs` runs with `-W`. |
| 67 | +suppress_warnings = ["ref.class"] |
57 | 68 | # Resolve type aliases here |
58 | 69 | # https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_type_aliases |
59 | 70 | autodoc_type_aliases: dict[str, str] = { |
60 | 71 | # python 3.10 |
61 | | - "T": "tutor.core.hooks.actions.T", |
| 72 | + # ParamSpec instances (like `tutor.core.hooks.actions.T`) are not classes, and Sphinx |
| 73 | + # will attempt to resolve them as `py:class` when rendering type hints. Point to the |
| 74 | + # ParamSpec type itself to avoid unresolved references. |
| 75 | + "T": "typing_extensions.ParamSpec", |
62 | 76 | "T2": "tutor.core.hooks.filters.T2", |
63 | 77 | # # python 3.12 |
64 | 78 | "L": "tutor.core.hooks.filters.L", |
|
0 commit comments