8000 fix(determinism): copy two missing entries from data_excludes (#881) · bazel-contrib/rules_python@3f0d62d · GitHub
[go: up one dir, main page]

Skip to content

Commit 3f0d62d

Browse files
authored
fix(determinism): copy two missing entries from data_excludes (#881)
We install some pip packages to bootstrap the pip_install/pip_parse rules, and these were allowing .pyc files as data deps. In some clients I observe that pip install is creating these with non-determinism and busting the python action caches. We already had a correct solution for user-installed packages, so we just need to include those entries for the built-ins.
1 parent 24a8b74 commit 3f0d62d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

python/pip_install/repositories.bzl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,17 @@ load("@rules_python//python:defs.bzl", "py_library")
9292
py_library(
9393
name = "lib",
9494
srcs = glob(["**/*.py"]),
95-
data = glob(["**/*"], exclude=["**/*.py", "**/* *", "BUILD", "WORKSPACE"]),
95+
data = glob(["**/*"], exclude=[
96+
# These entries include those put into user-installed dependencies by
97+
# data_exclude in /python/pip_install/extract_wheels/bazel.py
98+
# to avoid non-determinism following pip install's behavior.
99+
"**/*.py",
100+
"**/*.pyc",
101+
"**/* *",
102+
"**/*.dist-info/RECORD",
103+
"BUILD",
104+
"WORKSPACE",
105+
]),
96106
# This makes this directory a top-level in the python import
97107
# search path for anything that depends on this.
98108
imports = ["."],

0 commit comments

Comments
 (0)
0