From 74f6fed3df27d3fbad761e716ef1b936a12713ad Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Tue, 1 Mar 2022 21:26:05 -0800 Subject: [PATCH] Updated pip_repository data ignore patterns --- python/pip_install/extract_wheels/lib/bazel.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/python/pip_install/extract_wheels/lib/bazel.py b/python/pip_install/extract_wheels/lib/bazel.py index ae10dd97d0..1db5078833 100644 --- a/python/pip_install/extract_wheels/lib/bazel.py +++ b/python/pip_install/extract_wheels/lib/bazel.py @@ -139,13 +139,22 @@ def generate_build_file_contents( there may be no Python sources whatsoever (e.g. packages written in Cython: like `pymssql`). """ + # `dist-info` contains non-determinisitc files which can change any time + # the repository rules run. Below is a list of known patterns to these + # files. However, not all files should be ignored as certain packages + # require things like `top_level.txt`. + dist_info_ignores = [ + "**/*.dist-info/METADATA", + "**/*.dist-info/RECORD", + "**/*.dist-info/WHEEL", + ] + data_exclude = list( set( [ "*.whl", "**/__pycache__/**", "**/* *", - "**/*.dist-info/**", "**/*.py", "**/*.pyc", "BUILD.bazel", @@ -153,6 +162,7 @@ def generate_build_file_contents( f"{WHEEL_ENTRY_POINT_PREFIX}*.py", ] + data_exclude + + dist_info_ignores ) )