Skip to content

Commit aeae02e

Browse files
committed
Add installable entrypoint
1 parent ad105f4 commit aeae02e

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ dependencies = [
1212

1313

1414
[project.scripts]
15-
print-objects = "mp_reader.__main__:main"
15+
mp_reader = "mp_reader.__main__:main"
1616

1717
[dependency-groups]
1818
dev = [

src/mp_reader/__main__.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55
import typer
66
from .analyzer import stats, dump_events, type_stats
77

8-
app = typer.Typer(help="Analyze memory profiler output")
8+
def main():
9+
app = typer.Typer(help="Analyze memory profiler output")
910

10-
app.command("stats")(stats)
11-
app.command("type_stats")(type_stats)
12-
app.command("dump_events")(dump_events)
11+
app.command("stats")(stats)
12+
app.command("type_stats")(type_stats)
13+
app.command("dump_events")(dump_events)
1314

14-
if __name__ == "__main__":
1515
app()
16+
17+
if __name__ == "__main__":
18+
main()

0 commit comments

Comments
 (0)