35
35
}
36
36
37
37
_BAZEL_TOOLCHAINS_DEP_NAME = 'com_github_bazelbuild_bazeltoolchains'
38
+ _TWISTED_TWISTED_DEP_NAME = 'com_github_twisted_twisted'
39
+ _YAML_PYYAML_DEP_NAME = 'com_github_yaml_pyyaml'
40
+ _TWISTED_INCREMENTAL_DEP_NAME = 'com_github_twisted_incremental'
41
+ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME = 'com_github_zopefoundation_zope_interface'
42
+ _TWISTED_CONSTANTLY_DEP_NAME = 'com_github_twisted_constantly'
38
43
39
44
_GRPC_DEP_NAMES = [
40
45
'boringssl' ,
46
51
'com_github_cares_cares' ,
47
52
'com_google_absl' ,
48
53
_BAZEL_TOOLCHAINS_DEP_NAME ,
54
+ _TWISTED_TWISTED_DEP_NAME ,
55
+ _YAML_PYYAML_DEP_NAME ,
56
+ _TWISTED_INCREMENTAL_DEP_NAME ,
57
+ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME ,
58
+ _TWISTED_CONSTANTLY_DEP_NAME ,
59
+ ]
60
+
61
+ _GRPC_BAZEL_ONLY_DEPS = [
62
+ _BAZEL_TOOLCHAINS_DEP_NAME ,
63
+ _TWISTED_TWISTED_DEP_NAME ,
64
+ _YAML_PYYAML_DEP_NAME ,
65
+ _TWISTED_INCREMENTAL_DEP_NAME ,
66
+ _ZOPEFOUNDATION_ZOPE_INTERFACE_DEP_NAME ,
67
+ _TWISTED_CONSTANTLY_DEP_NAME ,
49
68
]
50
69
51
70
@@ -70,7 +89,8 @@ def existing_rules(self):
70
89
return []
71
90
72
91
def archive (self , ** args ):
73
- if args ['name' ] == _BAZEL_TOOLCHAINS_DEP_NAME :
92
+ assert self .names_and_urls .get (args ['name' ]) is None
93
+ if args ['name' ] in _GRPC_BAZEL_ONLY_DEPS :
74
94
self .names_and_urls [args ['name' ]] = 'dont care'
75
95
return
76
96
self .names_and_urls [args ['name' ]] = args ['url' ]
@@ -82,8 +102,10 @@ def archive(self, **args):
82
102
eval_state = BazelEvalState (names_and_urls )
83
103
bazel_file = f .read ()
84
104
85
- # grpc_deps.bzl only defines 'grpc_deps', add this to call it
105
+ # grpc_deps.bzl only defines 'grpc_deps' and 'grpc_test_only_deps', add these
106
+ # lines to call them.
86
107
bazel_file += '\n grpc_deps()\n '
108
+ bazel_file += '\n grpc_test_only_deps()\n '
87
109
build_rules = {
88
110
'native' : eval_state ,
89
111
}
@@ -92,11 +114,12 @@ def archive(self, **args):
92
114
assert name in names_and_urls .keys ()
93
115
assert len (_GRPC_DEP_NAMES ) == len (names_and_urls .keys ())
94
116
95
- # bazeltoolschains is an exception to this sanity check,
96
- # we don't require that there is a corresponding git module.
97
- names_without_bazeltoolchains = names_and_urls .keys ()
98
- names_without_bazeltoolchains .remove (_BAZEL_TOOLCHAINS_DEP_NAME )
99
- archive_urls = [names_and_urls [name ] for name in names_without_bazeltoolchains ]
117
+ # There are some "bazel-only" deps that are exceptions to this sanity check,
118
+ # we don't require that there is a corresponding git module for these.
119
+ names_without_bazel_only_deps = names_and_urls .keys ()
120
+ for dep_name in _GRPC_BAZEL_ONLY_DEPS :
121
+ names_without_bazel_only_deps .remove (dep_name )
122
+ archive_urls = [names_and_urls [name ] for name in names_without_bazel_only_deps ]
100
123
workspace_git_hashes = {
101
124
re .search (git_hash_pattern , url ).group ()
102
125
for url in archive_urls
0 commit comments