From db48917811de1b26661a8b66cb7b4a72d51e3757 Mon Sep 17 00:00:00 2001 From: Max Date: Wed, 28 Oct 2026 22:13:48 +0100 Subject: [PATCH] Declare the scope_profiler.opt_in_tags entry point. --- pyproject.toml | 3 +++ src/mpifield/tests/unit/test_profiling.py | 14 ++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index bc6a3e0..bc6b4ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,6 +60,9 @@ optional-dependencies.plot = [ "matplotlib>=3.10", "plasma-plots>=0.2.5" ] optional-dependencies.test = [ "mpifield[plot]", "pytest", "pytest-cov", "pytest-mpi" ] urls.Source = "https://github.com/max-models/mpifield" +[project.entry-points."scope_profiler.opt_in_tags"] +mpifield = "mpifield" + [tool.setuptools] package-data."*" = [ "py.typed" ] package-data.mpifield = [ "kernels/*.cuh", "kernels/*/*.cu" ] diff --git a/src/mpifield/tests/unit/test_profiling.py b/src/mpifield/tests/unit/test_profiling.py index e94e896..4e15b17 100644 --- a/src/mpifield/tests/unit/test_profiling.py +++ b/src/mpifield/tests/unit/test_profiling.py @@ -47,3 +47,17 @@ def test_enabling_the_tag_records_the_regions(tags: list[str]) -> None: "mpifield.Field.scatter", "user.run", } + + +def test_the_opt_in_tag_has_an_entry_point(): + """``scope-profiler tags`` finds the tag through the package's entry point.""" + from importlib.metadata import entry_points + + from mpifield._profiling import PROFILE_TAGS + + found = { + entry_point.name: entry_point.value + for entry_point in entry_points(group="scope_profiler.opt_in_tags") + } + assert found.get("mpifield") == "mpifield" + assert "mpifield" in PROFILE_TAGS