Skip to content

Commit 239f198

Browse files
committed
Fixing compile pip requirements when running on an RBE
1 parent 95fe03a commit 239f198

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/private/pypi/dependency_resolver/dependency_resolver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727

2828
from python.runfiles import runfiles
2929

30-
# Replace the os.replace function with shutil.copy to work around os.replace not being able to
30+
# Replace the os.replace function with shutil.move to work around os.replace not being able to
3131
# replace or move files across filesystems.
32-
os.replace = shutil.copy
32+
os.replace = shutil.move
3333

3434
# Next, we override the annotation_style_split and annotation_style_line functions to replace the
3535
# backslashes in the paths with forward slashes. This is so that we can have the same requirements

python/private/pypi/pip_compile.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ make it possible to have multiple tools inside the `pypi` directory
2222
load("//python:py_binary.bzl", _py_binary = "py_binary")
2323
load("//python:py_test.bzl", _py_test = "py_test")
2424

25+
_DEFAULT_TAGS = ["no-sandbox", "no-remote-exec", "requires-network"]
26+
2527
def 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

Comments
 (0)