Skip to content

Commit b5e9f8c

Browse files
committed
fix: support docs generation (therefore tests too) in py312
1 parent ecc9185 commit b5e9f8c

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/scripts/plugin.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ def on_page_read_source(page, config):
163163
"""
164164

165165

166+
def get_ep_namespace(ep, namespace):
167+
if hasattr(ep, "select"):
168+
return ep.select(group=namespace)
169+
else: # dict
170+
return ep.get(namespace, [])
171+
172+
166173
@mkdocs.plugins.event_priority(-1000)
167174
def on_post_page(
168175
output: str,
@@ -186,11 +193,12 @@ def on_post_page(
186193
"""
187194

188195
autorefs: AutorefsPlugin = config["plugins"]["autorefs"]
196+
ep = entry_points()
189197
spacy_factories_entry_points = {
190198
ep.name: ep.value
191199
for ep in (
192-
*entry_points()["spacy_factories"],
193-
*entry_points()["edsnlp_factories"],
200+
*get_ep_namespace(ep, "spacy_factories"),
201+
*get_ep_namespace(ep, "edsnlp_factories"),
194202
)
195203
}
196204

0 commit comments

Comments
 (0)