Skip to content

Commit ac6b23f

Browse files
tarun292facebook-github-bot
authored andcommitted
Use python_binary and python_library from build wrappers in profiler targets for OSS compatibility
Summary: Use the definitions of `python_binary` and `python_library` from the build wrappers to make the profiler python targets OSS compatible. Reviewed By: larryliu0820 Differential Revision: D47851150 fbshipit-source-id: 8366fcc200b5ac2ba7661053a9c2ae93ed9a1f26
1 parent 356f094 commit ac6b23f

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

profiler/TARGETS

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,28 @@
11
# Any targets that should be shared between fbcode and xplat must be defined in
22
# targets.bzl. This file can contain fbcode-only targets.
33

4-
load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary")
5-
load("@fbcode_macros//build_defs:python_library.bzl", "python_library")
4+
load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime")
65

7-
python_library(
6+
runtime.python_library(
87
name = "parse_profiler_library",
98
srcs = [
109
"parse_profiler_results.py",
10+
"profiler_results_cli.py",
1111
],
12-
visibility = ["PUBLIC"],
12+
visibility = ["@EXECUTORCH_CLIENTS"],
1313
deps = [
1414
"fbsource//third-party/pypi/prettytable:prettytable",
1515
"//executorch/exir:schema",
1616
"//executorch/exir/serialize:lib",
1717
],
1818
)
1919

20-
python_library(
20+
runtime.python_library(
2121
name = "profiler_results_scuba",
2222
srcs = [
2323
"profiler_results_scuba.py",
2424
],
25+
visibility = ["@EXECUTORCH_CLIENTS"],
2526
deps = [
2627
":parse_profiler_library",
2728
"//executorch/exir:schema",
@@ -32,15 +33,22 @@ python_library(
3233
],
3334
)
3435

35-
python_binary(
36-
name = "profiler_results_cli",
36+
runtime.python_library(
37+
name = "profiler_results_cli_lib",
3738
srcs = [
3839
"profiler_results_cli.py",
3940
],
40-
main_module = "executorch.profiler.profiler_results_cli",
4141
deps = [
4242
":parse_profiler_library",
4343
":profiler_results_scuba",
4444
"//executorch/exir/serialize:lib",
4545
],
4646
)
47+
48+
runtime.python_binary(
49+
name = "profiler_results_cli",
50+
main_module = "executorch.profiler.profiler_results_cli",
51+
deps = [
52+
":profiler_results_cli_lib",
53+
],
54+
)

0 commit comments

Comments
 (0)