Skip to content

Commit 6f8e168

Browse files
authored
Migrate re2 usages for pytorch
Differential Revision: D87078834 Pull Request resolved: #156
1 parent 3aada3f commit 6f8e168

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

targets.bzl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@ def define_common_targets():
3030
"src/regex.cpp",
3131
],
3232
exported_deps = [
33+
"fbsource//third-party/re2:re2",
3334
":headers",
3435
],
35-
exported_external_deps = [
36-
"re2",
37-
],
3836
visibility = ["//pytorch/tokenizers/..."],
3937
header_namespace = "",
4038
platforms = PLATFORMS,
@@ -75,11 +73,9 @@ def define_common_targets():
7573
"src/bpe_tokenizer_base.cpp",
7674
],
7775
exported_deps = [
76+
"fbsource//third-party/re2:re2",
7877
":headers",
7978
],
80-
exported_external_deps = [
81-
"re2",
82-
],
8379
visibility = [
8480
"//pytorch/tokenizers/...",
8581
],
@@ -117,12 +113,10 @@ def define_common_targets():
117113
":regex",
118114
],
119115
exported_deps = [
116+
"fbsource//third-party/re2:re2",
120117
":bpe_tokenizer_base",
121118
":headers",
122119
],
123-
exported_external_deps = [
124-
"re2",
125-
],
126120
visibility = [
127121
"@EXECUTORCH_CLIENTS",
128122
"//pytorch/tokenizers/...",
@@ -142,6 +136,7 @@ def define_common_targets():
142136
":regex",
143137
],
144138
exported_deps = [
139+
"fbsource//third-party/re2:re2",
145140
":bpe_tokenizer_base",
146141
":headers",
147142
"//pytorch/tokenizers/third-party:unicode",
@@ -151,7 +146,6 @@ def define_common_targets():
151146
"//pytorch/tokenizers/...",
152147
],
153148
exported_external_deps = [
154-
"re2",
155149
"nlohmann_json",
156150
],
157151
platforms = PLATFORMS,
@@ -181,11 +175,11 @@ def define_common_targets():
181175
":regex",
182176
],
183177
exported_deps = [
178+
"fbsource//third-party/re2:re2",
184179
":bpe_tokenizer_base",
185180
":headers",
186181
],
187182
exported_external_deps = [
188-
"re2",
189183
"nlohmann_json",
190184
],
191185
visibility = [

test/targets.bzl

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,15 +68,13 @@ def define_common_targets():
6868
"test_string_integer_map.cpp",
6969
],
7070
deps = [
71+
"fbsource//third-party/re2:re2",
7172
"//pytorch/tokenizers:headers",
7273
],
7374
env = {
7475
"RESOURCES_PATH": "$(location :resources)/resources",
7576
},
7677
platforms = [CXX, ANDROID], # Cannot bundle resources on Apple platform.
77-
external_deps = [
78-
"re2",
79-
],
8078
)
8179

8280
runtime.cxx_test(
@@ -85,15 +83,13 @@ def define_common_targets():
8583
"test_tiktoken.cpp",
8684
],
8785
deps = [
86+
"fbsource//third-party/re2:re2",
8887
"//pytorch/tokenizers:tiktoken",
8988
],
9089
env = {
9190
"RESOURCES_PATH": "$(location :resources)/resources",
9291
},
9392
platforms = [CXX, ANDROID], # Cannot bundle resources on Apple platform.
94-
external_deps = [
95-
"re2",
96-
],
9793
)
9894

9995
runtime.cxx_test(

0 commit comments

Comments
 (0)