Document autodoc native module stubs environment variable (#14563)

Co-authored-by: Jared Dillard <jared.dillard@gmail.com>
This commit is contained in:
whnandJared Dillard authored and GitHub committed 2026-10-21 18:02:01 -07:00
1 parent 03fef06c4a
commit ecab3746cf
1 file changed
+18
+18
View File
@@ -98,6 +98,24 @@ There are two ways to ensure this:
the :confval:`autodoc_mock_imports` setting.
Using native modules instead of type stubs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Starting with Sphinx 9.1, autodoc may use a neighboring ``.pyi`` type stub
when importing a module. For native extension modules whose documentation is
available only on the runtime objects, set the
``SPHINX_AUTODOC_IGNORE_NATIVE_MODULE_TYPE_STUBS`` environment variable
to a non-empty value to make autodoc import the native module directly:
.. code-block:: console
$ SPHINX_AUTODOC_IGNORE_NATIVE_MODULE_TYPE_STUBS=1 sphinx-build ...
On Windows, set the variable in the shell before running
the :program:`sphinx-build` command.
.. versionadded:: 9.1
Usage
^^^^^