From 7be027a43a22b4d77f72ed31f3758a9379dce016 Mon Sep 17 00:00:00 2001 From: Tarun Karuturi Date: Thu, 27 Jul 2023 14:41:57 -0700 Subject: [PATCH] Use python_binary and python_library from build wrappers in profiler targets Differential Revision: D47851150 fbshipit-source-id: 2ec0f9a56c610058cef88170fcdd99cd68b15c06 --- profiler/TARGETS | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/profiler/TARGETS b/profiler/TARGETS index 34d40b795d3..095cb7c0c4b 100644 --- a/profiler/TARGETS +++ b/profiler/TARGETS @@ -1,15 +1,15 @@ # Any targets that should be shared between fbcode and xplat must be defined in # targets.bzl. This file can contain fbcode-only targets. -load("@fbcode_macros//build_defs:python_binary.bzl", "python_binary") -load("@fbcode_macros//build_defs:python_library.bzl", "python_library") +load("@fbsource//xplat/executorch/build:runtime_wrapper.bzl", "runtime") -python_library( +runtime.python_library( name = "parse_profiler_library", srcs = [ "parse_profiler_results.py", + "profiler_results_cli.py", ], - visibility = ["PUBLIC"], + visibility = ["@EXECUTORCH_CLIENTS"], deps = [ "fbsource//third-party/pypi/prettytable:prettytable", "//executorch/exir:schema", @@ -17,11 +17,12 @@ python_library( ], ) -python_library( +runtime.python_library( name = "profiler_results_scuba", srcs = [ "profiler_results_scuba.py", ], + visibility = ["@EXECUTORCH_CLIENTS"], deps = [ ":parse_profiler_library", "//executorch/exir:schema", @@ -32,15 +33,22 @@ python_library( ], ) -python_binary( - name = "profiler_results_cli", +runtime.python_library( + name = "profiler_results_cli_lib", srcs = [ "profiler_results_cli.py", ], - main_module = "executorch.profiler.profiler_results_cli", deps = [ ":parse_profiler_library", ":profiler_results_scuba", "//executorch/exir/serialize:lib", ], ) + +runtime.python_binary( + name = "profiler_results_cli", + main_module = "executorch.profiler.profiler_results_cli", + deps = [ + ":profiler_results_cli_lib", + ], +)