Skip to content
This repository was archived by the owner on Aug 25, 2024. It is now read-only.

Commit fd6185e

Browse files
committed
scripts: docs: Ensure no duplication of entrypoints
For some reason pkg_resources.iter_entry_points was showing every entrypoint twice. Use a set() to ensure that no entrypoint gets documented twice. Signed-off-by: John Andersen <johnandersenpdx@gmail.com>
1 parent 3d522b4 commit fd6185e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/docs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,12 @@ def gen_docs(
163163
per_module = {name: [None, "", []] for name in modules}
164164
packagesconfig = configparser.ConfigParser()
165165
packagesconfig.read("scripts/packagesconfig.ini")
166+
# For some reason duplicates are showing up
167+
done = set()
166168
for i in pkg_resources.iter_entry_points(entrypoint):
169+
# Skip duplicates
170+
if i.name in done:
171+
continue
167172
cls = i.load()
168173
plugin_type = "_".join(cls.ENTRY_POINT_NAME)
169174
if plugin_type == "opimp":
@@ -196,6 +201,7 @@ def gen_docs(
196201
config = traverse_get_config(defaults, *cls.add_orig_label())
197202
formatted += "\n\n" + build_args(config)
198203
per_module[module_name][2].append(formatted)
204+
done.add(i.name)
199205
return "\n\n".join(
200206
[
201207
MODULE_TEMPLATE.format(

0 commit comments

Comments
 (0)