File tree 1 file changed +15
-10
lines changed
1 file changed +15
-10
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,20 @@ _RunLockInfo = provider(
62
62
},
63
63
)
64
64
65
+ def _args ():
66
+ run_args = []
67
+ lock_args = ctx .actions .args ()
68
+
69
+ def _add_args (arg , maybe_value = None ):
70
+ run_args .append (arg )
71
+ if maybe_value :
72
+ lock_args .add (arg , maybe_value )
73
+ run_args .append (maybe_value )
74
+ else :
75
+ lock_args .add (arg )
76
+
77
+ return run_args , lock_args , _add_args
78
+
65
79
def _lock_impl (ctx ):
66
80
args = ctx .attr .args
67
81
srcs = ctx .files .srcs
@@ -72,21 +86,12 @@ def _lock_impl(ctx):
72
86
73
87
py_runtime = ctx .toolchains [TARGET_TOOLCHAIN_TYPE ].py3_runtime
74
88
75
- run_args = []
76
- lock_args = ctx .actions .args ()
89
+ run_args , lock_args , _add_args = _args ()
77
90
78
91
lock_args .add (uv )
79
92
lock_args .add ("pip" )
80
93
lock_args .add ("compile" )
81
94
82
- def _add_args (arg , maybe_value = None ):
83
- run_args .append (arg )
84
- if maybe_value :
85
- lock_args .add (arg , maybe_value )
86
- run_args .append (maybe_value )
87
- else :
88
- lock_args .add (arg )
89
-
90
95
_add_args ("--no-python-downloads" )
91
96
_add_args ("--no-cache" )
92
97
_add_args ("--custom-compile-command" , "bazel run //{}:{}" .format (
You can’t perform that action at this time.
0 commit comments