Skip to content

Commit b6b6f24

Browse files
committed
Fixing compile pip requirements when running on an RBE
1 parent b5ed3e4 commit b6b6f24

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

python/private/pypi/dependency_resolver/dependency_resolver.py

+2-2
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ make it possible to have multiple tools inside the `pypi` directory
2121

2222
load("//python:defs.bzl", _py_binary = "py_binary", _py_test = "py_test")
2323

24+
_DEFAULT_TAGS = ["no-sandbox", "no-remote-exec", "requires-network"]
25+
2426
def pip_compile(
2527
name,
2628
srcs = None,
@@ -36,7 +38,7 @@ def pip_compile(
3638
requirements_linux = None,
3739
requirements_windows = None,
3840
visibility = ["//visibility:private"],
39-
tags = None,
41+
tags = _DEFAULT_TAGS,
4042
**kwargs):
4143
"""Generates targets for managing pip dependencies with pip-compile.
4244
@@ -75,6 +77,7 @@ def pip_compile(
7577
requirements_darwin: File of darwin specific resolve output to check validate if requirement.in has changes.
7678
requirements_windows: File of windows specific resolve output to check validate if requirement.in has changes.
7779
tags: tagging attribute common to all build rules, passed to both the _test and .update rules.
80+
default: ["no-sandbox", "no-remote-exec", "requires-network"]
7881
visibility: passed to both the _test and .update rules.
7982
**kwargs: other bazel attributes passed to the "_test" rule.
8083
"""
@@ -141,9 +144,6 @@ def pip_compile(
141144
] + extra_deps
142145

143146
tags = tags or []
144-
tags.append("requires-network")
145-
tags.append("no-remote-exec")
146-
tags.append("no-sandbox")
147147
attrs = {
148148
"args": args,
149149
"data": data,

0 commit comments

Comments
 (0)