Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/pip_repository_annotations/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ write_file(
copy_executables = {"@pip_repository_annotations_example//:data/copy_executable.py": "copied_content/executable.py"},
copy_files = {"@pip_repository_annotations_example//:data/copy_file.txt": "copied_content/file.txt"},
data = [":generated_file"],
data_exclude_glob = ["*.dist-info/RECORD"],
),
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,6 @@ def test_copy_executables(self):
stdout = proc.stdout.decode("utf-8").strip()
self.assertEqual(stdout, "Hello world from copied executable")

def test_data_exclude_glob(self):
current_wheel_version = "0.37.1"

r = runfiles.Create()
dist_info_dir = (
"pip_repository_annotations_example/external/{}/wheel-{}.dist-info".format(
self.wheel_pkg_dir(),
current_wheel_version,
)
)

# `WHEEL` is expected to be there to show dist-info files are included in the runfiles
wheel_path = r.Rlocation("{}/WHEEL".format(dist_info_dir))

# However, `RECORD` was explicitly excluded, so it should be missing
record_path = r.Rlocation("{}/RECORD".format(dist_info_dir))

# Because windows does not have `--enable_runfiles` on by default, the
# `runfiles.Rlocation` results will be different on this platform vs
# unix platforms. See `@rules_python//python/runfiles` for more details.
if platform.system() == "Windows":
self.assertIsNotNone(wheel_path)
self.assertIsNone(record_path)
else:
self.assertTrue(Path(wheel_path).exists())
self.assertFalse(Path(record_path).exists())


if __name__ == "__main__":
unittest.main()
1 change: 1 addition & 0 deletions python/pip_install/extract_wheels/lib/bazel.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def generate_build_file_contents(
"*.whl",
"**/__pycache__/**",
"**/* *",
"**/*.dist-info/**",
"**/*.py",
"**/*.pyc",
"BUILD.bazel",
Expand Down