Skip to content

Commit 097c2ff

Browse files
Provide raw wheel file when py_whl is required (#134)
It's often useful to be able to get the untouched wheel downloaded by `python_wheel` rather than a Please-ified pex file containing the package's code, e.g. when the `python_wheel` target is a dependency of a package that is being built using a non-Please build system like pip. Provide the wheel when `py_whl` is required by a downstream target.
1 parent 31d750b commit 097c2ff

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

build_defs/python.build_defs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,10 @@ def python_wheel(name:str, version:str, labels:list=[], hashes:list=None, packag
628628
licences = licences,
629629
test_only = test_only,
630630
labels = labels + [label] + ["link:plz-out/python/venv"],
631-
provides = {'py': wheel_rule},
631+
provides = {
632+
"py": wheel_rule,
633+
"py_whl": file_rule,
634+
},
632635
)
633636
if binary:
634637
entry_points = entry_points or f"{package_name}.__main__:main"
@@ -654,7 +657,10 @@ def python_wheel(name:str, version:str, labels:list=[], hashes:list=None, packag
654657
name = name,
655658
srcs = entry_point_binaries,
656659
entry_points = {k: f"{k}.pex" for k in entry_points.keys()},
657-
provides = {'py': wheel_rule}, # So things can still depend on this as a library
660+
provides = {
661+
"py": wheel_rule, # So things can still depend on this as a library
662+
"py_whl": file_rule,
663+
},
658664
binary=True,
659665
test_only=test_only,
660666
)

0 commit comments

Comments
 (0)