mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2026-10-24 22:27:52 -05:00
Document autodoc native module stubs environment variable (#14563)
Co-authored-by: Jared Dillard <jared.dillard@gmail.com>
This commit is contained in:
1 parent
03fef06c4a
commit
ecab3746cf
1 file changed
+18
@@ -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
|
||||
^^^^^
|
||||
|
||||
|
||||
Reference in new issue
Block a user