diff --git a/python/pip_install/extract_wheels/lib/bazel.py b/python/pip_install/extract_wheels/lib/bazel.py index ef0d6e81b0..0affa20b6d 100644 --- a/python/pip_install/extract_wheels/lib/bazel.py +++ b/python/pip_install/extract_wheels/lib/bazel.py @@ -27,7 +27,7 @@ def generate_build_file_contents( there may be no Python sources whatsoever (e.g. packages written in Cython: like `pymssql`). """ - data_exclude = ["*.whl", "**/*.py", "**/* *", "BUILD", "WORKSPACE"] + pip_data_exclude + data_exclude = ["*.whl", "**/*.py", "**/* *", "BUILD.bazel", "WORKSPACE"] + pip_data_exclude return textwrap.dedent( """\ @@ -184,7 +184,7 @@ def extract_wheel( '"//%s:%s"' % (sanitise_name(d), WHEEL_FILE_LABEL) for d in whl_deps ] - with open(os.path.join(directory, "BUILD"), "w") as build_file: + with open(os.path.join(directory, "BUILD.bazel"), "w") as build_file: contents = generate_build_file_contents( sanitise_name(whl.name), sanitised_dependencies, sanitised_wheel_file_dependencies, pip_data_exclude ) diff --git a/python/pip_install/extract_wheels/lib/whl_filegroup_test.py b/python/pip_install/extract_wheels/lib/whl_filegroup_test.py index a338a140fe..12094568c9 100644 --- a/python/pip_install/extract_wheels/lib/whl_filegroup_test.py +++ b/python/pip_install/extract_wheels/lib/whl_filegroup_test.py @@ -17,7 +17,7 @@ def test_generated_build_file_has_filegroup_target(self) -> None: )[2:] # Take off the leading // from the returned label. # Assert that the raw wheel ends up in the package. self.assertIn(wheel_name, os.listdir(generated_bazel_dir)) - with open("{}/BUILD".format(generated_bazel_dir)) as build_file: + with open("{}/BUILD.bazel".format(generated_bazel_dir)) as build_file: build_file_content = build_file.read() self.assertIn('filegroup', build_file_content)