@@ -22,6 +22,8 @@ make it possible to have multiple tools inside the `pypi` directory
2222load ("//python:py_binary.bzl" , _py_binary = "py_binary" )
2323load ("//python:py_test.bzl" , _py_test = "py_test" )
2424
25+ _DEFAULT_TAGS = ["no-sandbox" , "no-remote-exec" , "requires-network" ]
26+
2527def pip_compile (
2628 name ,
2729 srcs = None ,
@@ -37,7 +39,7 @@ def pip_compile(
3739 requirements_linux = None ,
3840 requirements_windows = None ,
3941 visibility = ["//visibility:private" ],
40- tags = None ,
42+ tags = _DEFAULT_TAGS ,
4143 ** kwargs ):
4244 """Generates targets for managing pip dependencies with pip-compile.
4345
@@ -76,6 +78,7 @@ def pip_compile(
7678 requirements_darwin: File of darwin specific resolve output to check validate if requirement.in has changes.
7779 requirements_windows: File of windows specific resolve output to check validate if requirement.in has changes.
7880 tags: tagging attribute common to all build rules, passed to both the _test and .update rules.
81+ default: ["no-sandbox", "no-remote-exec", "requires-network"]
7982 visibility: passed to both the _test and .update rules.
8083 **kwargs: other bazel attributes passed to the "_test" rule.
8184 """
@@ -142,9 +145,6 @@ def pip_compile(
142145 ] + extra_deps
143146
144147 tags = tags or []
145- tags .append ("requires-network" )
146- tags .append ("no-remote-exec" )
147- tags .append ("no-sandbox" )
148148 attrs = {
149149 "args" : args ,
150150 "data" : data ,
0 commit comments