File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -32,10 +32,13 @@ def _parse_optional_attrs(rctx, args):
3232 args: A list of parsed args for the rule.
3333 Returns: Augmented args list.
3434 """
35- if rctx .attr .extra_pip_args :
35+ extra_args = list (rctx .attr .extra_pip_args )
36+ for target in rctx .attr .extra_index_url_targets :
37+ extra_args += ["--extra-index-url" , "file://" + str (rctx .path (target )).split ("/index.html" )[0 ]]
38+ if extra_args :
3639 args += [
3740 "--extra_pip_args" ,
38- struct (args = rctx . attr . extra_pip_args ).to_json (),
41+ struct (args = extra_args ).to_json (),
3942 ]
4043
4144 if rctx .attr .pip_data_exclude :
@@ -151,6 +154,10 @@ python_interpreter.
151154 default = 600 ,
152155 doc = "Timeout (in seconds) on the rule's execution duration." ,
153156 ),
157+ "extra_index_url_targets" : attr .label_list (
158+ default = [],
159+ doc = "Bazel labels for directories which should be passed to pip's --extra-index-url flag" ,
160+ )
154161}
155162
156163pip_repository_attrs = {
You can’t perform that action at this time.
0 commit comments