Skip to content

Commit f768fe6

Browse files
committed
cleanup dead code
1 parent be2983c commit f768fe6

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

python/private/pypi/generate_whl_library_build_bazel.bzl

+4
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,13 @@ whl_library_targets_from_requires(
4545
def generate_whl_library_build_bazel(
4646
*,
4747
annotation = None,
48+
python_version = None,
4849
**kwargs):
4950
"""Generate a BUILD file for an unzipped Wheel
5051
5152
Args:
5253
annotation: The annotation for the build file.
54+
python_version: The python version to use to parse the METADATA.
5355
**kwargs: Extra args serialized to be passed to the
5456
{obj}`whl_library_targets`.
5557
@@ -78,6 +80,8 @@ def generate_whl_library_build_bazel(
7880
kwargs["srcs_exclude"] = annotation.srcs_exclude_glob
7981
if annotation.additive_build_content:
8082
additional_content.append(annotation.additive_build_content)
83+
if python_version:
84+
kwargs["python_version"] = repr(python_version)
8185

8286
contents = "\n".join(
8387
[

python/private/pypi/pep508_deps.bzl

+3-12
Original file line numberDiff line numberDiff line change
@@ -99,19 +99,10 @@ def deps(name, *, requires_dist, platforms = [], extras = [], excludes = [], hos
9999

100100
def _platform_str(self):
101101
if self.abi == None:
102-
if not self.os and not self.arch:
103-
return "//conditions:default"
104-
elif not self.arch:
105-
fail("remove")
106-
else:
107-
return "{}_{}".format(self.os, self.arch)
108-
109-
minor_version = self.abi[3:]
110-
if self.arch == None and self.os == None:
111-
fail("remove")
102+
return "{}_{}".format(self.os, self.arch)
112103

113-
return "cp3{}_{}_{}".format(
114-
minor_version,
104+
return "{}_{}_{}".format(
105+
self.abi,
115106
self.os or "anyos",
116107
self.arch or "anyarch",
117108
)

0 commit comments

Comments
 (0)