Skip to content

Commit 9227cdc

Browse files
authored
Migrate pybind11 external deps to regular third-party deps
Differential Revision: D70261352 Pull Request resolved: #8837
1 parent ff36efd commit 9227cdc

File tree

5 files changed

+16
-28
lines changed

5 files changed

+16
-28
lines changed

backends/apple/coreml/TARGETS

+8-10
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ runtime.python_library(
1414
"@EXECUTORCH_CLIENTS",
1515
],
1616
deps = [
17+
"fbsource//third-party/pypi/coremltools:coremltools",
1718
":executorchcoreml",
1819
"//executorch/exir/backend:backend_details",
1920
"//executorch/exir/backend:compile_spec_schema",
20-
"fbsource//third-party/pypi/coremltools:coremltools",
2121
],
2222
)
2323

@@ -30,13 +30,13 @@ runtime.python_library(
3030
"@EXECUTORCH_CLIENTS",
3131
],
3232
deps = [
33+
"fbsource//third-party/pypi/coremltools:coremltools",
3334
":backend",
3435
"//caffe2:torch",
3536
"//executorch/exir:lib",
3637
"//executorch/exir/backend:compile_spec_schema",
3738
"//executorch/exir/backend:partitioner",
3839
"//executorch/exir/backend:utils",
39-
"fbsource//third-party/pypi/coremltools:coremltools",
4040
],
4141
)
4242

@@ -64,25 +64,23 @@ runtime.cxx_python_extension(
6464
headers = glob([
6565
"runtime/inmemoryfs/**/*.hpp",
6666
]),
67+
base_module = "",
68+
compiler_flags = [
69+
"-std=c++17",
70+
],
6771
preprocessor_flags = [
6872
"-Iexecutorch/backends/apple/coreml/runtime/util",
6973
],
7074
types = [
7175
"executorchcoreml.pyi",
7276
],
73-
compiler_flags = [
74-
"-std=c++17",
75-
],
76-
base_module = "",
7777
visibility = [
7878
"//executorch/examples/apple/coreml/...",
7979
"@EXECUTORCH_CLIENTS",
8080
],
81-
external_deps = [
82-
"pybind11",
83-
],
8481
deps = [
8582
"fbsource//third-party/nlohmann-json:nlohmann-json",
83+
"fbsource//third-party/pybind11:pybind11",
8684
],
8785
)
8886

@@ -92,10 +90,10 @@ runtime.python_test(
9290
"test/*.py",
9391
]),
9492
deps = [
93+
"fbsource//third-party/pypi/pytest:pytest",
9594
":partitioner",
9695
":quantizer",
9796
"//caffe2:torch",
9897
"//pytorch/vision:torchvision",
99-
"fbsource//third-party/pypi/pytest:pytest",
10098
],
10199
)

backends/qualcomm/aot/python/targets.bzl

+3-5
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def define_common_targets():
3333
"//executorch/backends/qualcomm:schema",
3434
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
3535
"//executorch/backends/qualcomm/runtime:runtime",
36+
"fbsource//third-party/pybind11:pybind11",
3637
"fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()),
3738
],
3839
external_deps = [
39-
"pybind11",
4040
"libtorch_python",
4141
],
4242
use_static_deps = True,
@@ -66,10 +66,10 @@ def define_common_targets():
6666
"//executorch/backends/qualcomm:schema",
6767
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
6868
"//executorch/backends/qualcomm/runtime:runtime",
69+
"fbsource//third-party/pybind11:pybind11",
6970
"fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()),
7071
],
7172
external_deps = [
72-
"pybind11",
7373
"libtorch_python",
7474
],
7575
use_static_deps = True,
@@ -93,9 +93,7 @@ def define_common_targets():
9393
"//executorch/backends/qualcomm:schema",
9494
"//executorch/backends/qualcomm/aot/ir:qcir_utils",
9595
"//executorch/backends/qualcomm/runtime:runtime",
96+
"fbsource//third-party/pybind11:pybind11",
9697
"fbsource//third-party/qualcomm/qnn/qnn-{0}:api".format(get_qnn_library_verision()),
9798
],
98-
external_deps = [
99-
"pybind11",
100-
],
10199
)

exir/verification/TARGETS

+1-3
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,11 @@ cpp_python_extension(
1010
"bindings.cpp",
1111
],
1212
deps = [
13+
"fbsource//third-party/pybind11:pybind11",
1314
"//caffe2:torch-cpp-cpu",
1415
"//caffe2:torch_extension",
1516
"//caffe2/c10:c10",
1617
],
17-
external_deps = [
18-
"pybind11",
19-
],
2018
)
2119

2220
python_library(

extension/pytree/TARGETS

+2-6
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,9 @@ cpp_python_extension(
1616
],
1717
base_module = "executorch.extension.pytree",
1818
deps = [
19+
"fbsource//third-party/pybind11:pybind11",
1920
":pytree",
2021
],
21-
external_deps = [
22-
"pybind11",
23-
],
2422
)
2523

2624
cpp_python_extension(
@@ -30,11 +28,9 @@ cpp_python_extension(
3028
],
3129
base_module = "executorch.extension.pytree",
3230
deps = [
31+
"fbsource//third-party/pybind11:pybind11",
3332
":pytree",
3433
],
35-
external_deps = [
36-
"pybind11",
37-
],
3834
)
3935

4036
python_library(

extension/training/pybindings/TARGETS

+2-4
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ runtime.cxx_python_extension(
1717
types = ["_training_lib.pyi"],
1818
visibility = ["//executorch/extension/training/..."],
1919
deps = [
20+
"fbsource//third-party/pybind11:pybind11",
2021
"//executorch/extension/aten_util:aten_bridge",
2122
"//executorch/extension/training/optimizer:sgd",
2223
],
23-
external_deps = [
24-
"pybind11",
25-
"libtorch_python",
26-
],
24+
external_deps = ["libtorch_python"],
2725
)
2826

2927
runtime.python_library(

0 commit comments

Comments
 (0)