Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 4b7ac91

Browse filesBrowse files
authored
Use BUILD.bazel file when creating py_library rules of extracted whls (bazel-contrib#427)
1 parent 6135186 commit 4b7ac91
Copy full SHA for 4b7ac91

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎python/pip_install/extract_wheels/lib/bazel.py

Copy file name to clipboardExpand all lines: python/pip_install/extract_wheels/lib/bazel.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def generate_build_file_contents(
2727
there may be no Python sources whatsoever (e.g. packages written in Cython: like `pymssql`).
2828
"""
2929

30-
data_exclude = ["*.whl", "**/*.py", "**/* *", "BUILD", "WORKSPACE"] + pip_data_exclude
30+
data_exclude = ["*.whl", "**/*.py", "**/* *", "BUILD.bazel", "WORKSPACE"] + pip_data_exclude
3131

3232
return textwrap.dedent(
3333
"""\
@@ -184,7 +184,7 @@ def extract_wheel(
184184
'"//%s:%s"' % (sanitise_name(d), WHEEL_FILE_LABEL) for d in whl_deps
185185
]
186186

187-
with open(os.path.join(directory, "BUILD"), "w") as build_file:
187+
with open(os.path.join(directory, "BUILD.bazel"), "w") as build_file:
188188
contents = generate_build_file_contents(
189189
sanitise_name(whl.name), sanitised_dependencies, sanitised_wheel_file_dependencies, pip_data_exclude
190190
)

‎python/pip_install/extract_wheels/lib/whl_filegroup_test.py

Copy file name to clipboardExpand all lines: python/pip_install/extract_wheels/lib/whl_filegroup_test.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def test_generated_build_file_has_filegroup_target(self) -> None:
1717
)[2:] # Take off the leading // from the returned label.
1818
# Assert that the raw wheel ends up in the package.
1919
self.assertIn(wheel_name, os.listdir(generated_bazel_dir))
20-
with open("{}/BUILD".format(generated_bazel_dir)) as build_file:
20+
with open("{}/BUILD.bazel".format(generated_bazel_dir)) as build_file:
2121
build_file_content = build_file.read()
2222
self.assertIn('filegroup', build_file_content)
2323

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.