Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ optional-dependencies.test = [ "coverage", "pytest", "scipy" ]
optional-dependencies.test-compiled = [ "cunumpy[test]", "pyccel" ]
urls."Source" = "https://github.com/max-models/cunumpy"

[project.entry-points."scope_profiler.opt_in_tags"]
cunumpy = "cunumpy"

[tool.setuptools.packages.find]
where = [ "src" ]

Expand Down
14 changes: 14 additions & 0 deletions tests/unit/test_opt_in_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,17 @@ def test_regions_are_off_by_default(profiler):
def test_enabled_tag_records_regions(profiler, tags):
regions = _cunumpy_regions(enable_tags=tags)
assert sorted(regions) == ["cunumpy.kernel.noop", "cunumpy.sort_by_key"]


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 cunumpy._profile_tags 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("cunumpy") == "cunumpy"
assert "cunumpy" in _PROFILE_TAGS
Loading