Skip to content

Commit 1090b6c

Browse files
authored
fix: allow pypi packages with empty data attribute (#3463)
An empty glob under site-packages (after excluding code and pyi files) is a bit strange, but not actually incorrect. If such a situation occurs, it would cause a failure because Bazel has since changed to disallow empty globs by default. To fix, just set allow_empty=True on the data glob.
1 parent b8d2e9b commit 1090b6c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

python/private/pypi/whl_library_targets.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,7 @@ def whl_library_targets(
356356
data = data + native.glob(
357357
["site-packages/**/*"],
358358
exclude = _data_exclude,
359+
allow_empty = True,
359360
)
360361

361362
pyi_srcs = native.glob(

tests/pypi/whl_library_targets/whl_library_targets_tests.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ def _test_whl_and_library_deps_from_requires(env):
275275
"**/*.pyc.*",
276276
"**/*.dist-info/RECORD",
277277
],
278+
allow_empty = True,
278279
),
279280
# pyi call
280281
_glob_call(["site-packages/**/*.pyi"], allow_empty = True),
@@ -457,7 +458,7 @@ def _test_group(env):
457458
"**/*.pyc",
458459
"**/*.pyc.*",
459460
"**/*.dist-info/RECORD",
460-
]),
461+
], allow_empty = True),
461462
_glob_call(["site-packages/**/*.pyi"], allow_empty = True),
462463
])
463464

0 commit comments

Comments
 (0)