Skip to content

Commit

Permalink
fix: support docs generation (therefore tests too) in py312
Browse files Browse the repository at this point in the history
  • Loading branch information
percevalw committed Nov 4, 2024
1 parent fc1f894 commit e47c635
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions docs/scripts/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,13 @@ def on_page_read_source(page, config):
"""


def get_ep_namespace(ep, namespace):
if hasattr(ep, "select"):
return ep.select(group=namespace)
else: # dict
return ep.get(namespace, [])


@mkdocs.plugins.event_priority(-1000)
def on_post_page(
output: str,
Expand All @@ -186,11 +193,12 @@ def on_post_page(
"""

autorefs: AutorefsPlugin = config["plugins"]["autorefs"]
ep = entry_points()
spacy_factories_entry_points = {
ep.name: ep.value
for ep in (
*entry_points()["spacy_factories"],
*entry_points()["edsnlp_factories"],
*get_ep_namespace(ep, "spacy_factories"),
*get_ep_namespace(ep, "edsnlp_factories"),
)
}

Expand Down

0 comments on commit e47c635

Please sign in to comment.