Skip to content

Commit 19b6697

Browse files
refactor: (temp) use no-index by default to avoid duplicate warnings
1 parent 00ee709 commit 19b6697

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

docs/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,12 @@ def on_init(app): # pylint: disable=unused-argument
557557
# If we are, assemble the path manually
558558
bin_path = os.path.abspath(os.path.join(sys.prefix, "bin"))
559559
apidoc_path = os.path.join(bin_path, apidoc_path)
560+
561+
# Set SPHINX_APIDOC_OPTIONS to add :no-index: to generated automodule directives
562+
# This prevents duplicate object warnings for re-exported API members
563+
env = os.environ.copy()
564+
env['SPHINX_APIDOC_OPTIONS'] = 'members,show-inheritance,undoc-members,no-index'
565+
560566
check_call(
561567
[
562568
apidoc_path,
@@ -565,7 +571,8 @@ def on_init(app): # pylint: disable=unused-argument
565571
os.path.join(root_path, "openedx_authz"),
566572
os.path.join(root_path, "openedx_authz/migrations"),
567573
os.path.join(root_path, "openedx_authz/tests"),
568-
]
574+
],
575+
env=env
569576
)
570577

571578

0 commit comments

Comments
 (0)