Skip to content

Commit 2b1d6be

Browse files
authored
Ignore __pycache__ contents and *.pyc files in external dependencies (bazel-contrib#570)
1 parent 288df22 commit 2b1d6be

File tree

1 file changed

+3
-1
lines changed
  • python/pip_install/extract_wheels/lib

1 file changed

+3
-1
lines changed

python/pip_install/extract_wheels/lib/bazel.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ def generate_build_file_contents(
103103

104104
data_exclude = [
105105
"*.whl",
106+
"**/__pycache__/**",
106107
"**/*.py",
108+
"**/*.pyc",
107109
f"{WHEEL_ENTRY_POINT_PREFIX}*.py",
108110
"**/* *",
109111
"BUILD.bazel",
@@ -134,7 +136,7 @@ def generate_build_file_contents(
134136
135137
py_library(
136138
name = "{name}",
137-
srcs = glob(["**/*.py"], exclude=["{entry_point_prefix}*.py"], allow_empty = True),
139+
srcs = glob(["**/*.py"], exclude=["{entry_point_prefix}*.py", "**/__pycache__/**"], allow_empty = True),
138140
data = glob(["**/*"], exclude={data_exclude}),
139141
# This makes this directory a top-level in the python import
140142
# search path for anything that depends on this.

0 commit comments

Comments
 (0)