1
+ ""
2
+
1
3
load ("//:repositories.bzl" , "all_requirements" )
2
4
3
5
DEFAULT_REPOSITORY_NAME = "pip"
@@ -48,9 +50,7 @@ def _pip_repository_impl(rctx):
48
50
]
49
51
50
52
if rctx .attr .enable_implicit_namespace_pkgs :
51
- args += [
52
- "--enable_implicit_namespace_pkgs"
53
- ]
53
+ args .append ("--enable_implicit_namespace_pkgs" )
54
54
55
55
result = rctx .execute (
56
56
args ,
@@ -68,24 +68,6 @@ def _pip_repository_impl(rctx):
68
68
69
69
pip_repository = repository_rule (
70
70
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
- ),
89
71
"enable_implicit_namespace_pkgs" : attr .bool (
90
72
default = False ,
91
73
doc = """
@@ -96,6 +78,24 @@ and py_test targets must specify either `legacy_create_init=False` or the global
96
78
This option is required to support some packages which cannot handle the conversion to pkg-util style.
97
79
""" ,
98
80
),
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 (),
99
99
},
100
100
implementation = _pip_repository_impl ,
101
101
)
0 commit comments