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 @@ -64,6 +64,9 @@ Source = "https://github.com/max-models/patchwork"
[project.scripts]
patchwork = "patchwork.main:main"

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

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

Expand Down
14 changes: 14 additions & 0 deletions src/patchwork/tests/unit/test_profiling.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,17 @@ def test_enable_tags_records_the_patchwork_regions():
"patchwork.exchange_halos",
"patchwork.build_schedule",
} <= names


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 patchwork._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("patchwork") == "patchwork"
assert "patchwork" in PROFILE_TAGS
Loading