From fe808e940faf5959b3c4a0fbd96ce86f72ea285d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Perceval=20Wajsb=C3=BCrt?= Date: Sat, 24 Feb 2024 23:41:32 +0100 Subject: [PATCH] fix: update entrypoints and add related test --- pyproject.toml | 2 +- tests/test_entrypoints.py | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/test_entrypoints.py diff --git a/pyproject.toml b/pyproject.toml index c843039aa..1a9fad884 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -247,7 +247,7 @@ where = ["."] "brat" = "edsnlp.data:write_brat" # alias for standoff [project.entry-points."spacy_misc"] -"eds.span_sentence_getter" = "edsnlp.utils.span_getters:make_span_sentence_getter" +"eds.span_context_getter" = "edsnlp.utils.span_getters:make_span_context_getter" [project.entry-points."spacy_languages"] "eds" = "edsnlp.language:EDSLanguage" diff --git a/tests/test_entrypoints.py b/tests/test_entrypoints.py new file mode 100644 index 000000000..084d287ec --- /dev/null +++ b/tests/test_entrypoints.py @@ -0,0 +1,15 @@ +import catalogue + +try: + from importlib.metadata import entry_points +except ImportError: + from importlib_metadata import entry_points + + +def test_entrypoints(): + ep = entry_points() + namespaces = ep.groups if hasattr(ep, "groups") else ep.keys() + for ns in namespaces: + if ns.startswith("spacy_") or ns.startswith("edsnlp_"): + reg = catalogue.Registry(ns.split("_"), entry_points=True) + reg.get_all()