Skip to content

Commit b2b5ccd

Browse files
Muhammad Faraz  MaqsoodMuhammad Faraz  Maqsood
authored andcommitted
fix: make docs warnings
1 parent 9f131f1 commit b2b5ccd

File tree

7 files changed

+29
-4
lines changed

7 files changed

+29
-4
lines changed

docs/conf.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,26 @@
5353
("py:class", "click.core.Command"),
5454
# Python 3.12
5555
("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"),
5661
]
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"]
5768
# Resolve type aliases here
5869
# https://www.sphinx-doc.org/en/master/usage/extensions/autodoc.html#confval-autodoc_type_aliases
5970
autodoc_type_aliases: dict[str, str] = {
6071
# 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",
6276
"T2": "tutor.core.hooks.filters.T2",
6377
# # python 3.12
6478
"L": "tutor.core.hooks.filters.L",

docs/gettingstarted/installation.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. _installation:
2+
.. _install:
23

34
Installation
45
============

docs/gettingstarted/quickstart.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
.. _quickstart:
2+
13
Quickstart (1-click install)
24
============================
35

docs/plugins/index.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,4 +64,9 @@ To disable an index, for instance "contrib", use the ``plugins index remove`` co
6464

6565
tutor plugins index remove contrib
6666

67-
For more information about these indexes, check the `official Tutor plugin indexes (TPI) <https://github.com/overhangio/tpi/>`__ repository.
67+
For more information about these indexes, check the `official Tutor plugin indexes (TPI) <https://github.com/overhangio/tpi/>`__ repository.
68+
69+
Development
70+
===========
71+
72+
For information on developing your own Tutor plugins, see the :ref:`plugin_development` guide.

docs/reference/api/hooks/actions.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ Actions are one of the two types of hooks (the other being :ref:`filters`) that
1010
:members:
1111

1212
.. The following are only to ensure that the docs build without warnings
13-
.. class:: tutor.core.hooks.actions.T
14-
.. class:: tutor.types.Config
13+
.. py:class:: tutor.core.hooks.actions.T
14+
.. py:class:: tutor.types.Config
15+
.. py:class:: typing_extensions.ParamSpec

docs/sysadmin/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ System administration
44
.. toctree::
55
:maxdepth: 1
66

7+
edx-platform
78
scale
89
portainer
910
podman

docs/tutor.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
.. _tutor:
2+
.. _development:
23

34
Tutor development
45
=================

0 commit comments

Comments
 (0)