1+ ""
2+
13load ("//:repositories.bzl" , "all_requirements" )
24
35DEFAULT_REPOSITORY_NAME = "pip"
@@ -48,9 +50,7 @@ def _pip_repository_impl(rctx):
4850 ]
4951
5052 if rctx .attr .enable_implicit_namespace_pkgs :
51- args += [
52- "--enable_implicit_namespace_pkgs"
53- ]
53+ args .append ("--enable_implicit_namespace_pkgs" )
5454
5555 result = rctx .execute (
5656 args ,
@@ -68,24 +68,6 @@ def _pip_repository_impl(rctx):
6868
6969pip_repository = repository_rule (
7070 attrs = {
71- "requirements" : attr .label (allow_single_file = True , mandatory = True ),
72- "wheel_env" : attr .string_dict (),
73- "python_interpreter" : attr .string (default = "python3" ),
74- "python_interpreter_target" : attr .label (allow_single_file = True , doc = """
75- If you are using a custom python interpreter built by another repository rule,
76- use this attribute to specify its BUILD target. This allows pip_repository to invoke
77- pip using the same interpreter as your toolchain. If set, takes precedence over
78- python_interpreter.
79- """ ),
80- # 600 is documented as default here: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#execute
81- "timeout" : attr .int (default = 600 ),
82- "quiet" : attr .bool (default = True ),
83- "extra_pip_args" : attr .string_list (
84- doc = "Extra arguments to pass on to pip. Must not contain spaces." ,
85- ),
86- "pip_data_exclude" : attr .string_list (
87- doc = "Additional data exclusion parameters to add to the pip packages BUILD file." ,
88- ),
8971 "enable_implicit_namespace_pkgs" : attr .bool (
9072 default = False ,
9173 doc = """
@@ -96,6 +78,24 @@ and py_test targets must specify either `legacy_create_init=False` or the global
9678This option is required to support some packages which cannot handle the conversion to pkg-util style.
9779 """ ,
9880 ),
81+ "extra_pip_args" : attr .string_list (
82+ doc = "Extra arguments to pass on to pip. Must not contain spaces." ,
83+ ),
84+ "pip_data_exclude" : attr .string_list (
85+ doc = "Additional data exclusion parameters to add to the pip packages BUILD file." ,
86+ ),
87+ "python_interpreter" : attr .string (default = "python3" ),
88+ "python_interpreter_target" : attr .label (allow_single_file = True , doc = """
89+ If you are using a custom python interpreter built by another repository rule,
90+ use this attribute to specify its BUILD target. This allows pip_repository to invoke
91+ pip using the same interpreter as your toolchain. If set, takes precedence over
92+ python_interpreter.
93+ """ ),
94+ "quiet" : attr .bool (default = True ),
95+ "requirements" : attr .label (allow_single_file = True , mandatory = True ),
96+ # 600 is documented as default here: https://docs.bazel.build/versions/master/skylark/lib/repository_ctx.html#execute
97+ "timeout" : attr .int (default = 600 ),
98+ "wheel_env" : attr .string_dict (),
9999 },
100100 implementation = _pip_repository_impl ,
101101)
0 commit comments