Skip to content

Commit e2c07ae

Browse files
committed
one more try
1 parent 8835d02 commit e2c07ae

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

examples/bzlmod/MODULE.bazel.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

python/private/pypi/extension.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ def _create_whl_repos(
330330
if pip_attr.download_only:
331331
args.setdefault("experimental_target_platforms", requirement.target_platforms)
332332

333-
repo_name = pypi_repo_name(pip_name, requirement.requirement_line)
333+
repo_name = pypi_repo_name(pip_name, requirement.srcs.requirement, requirement.srcs.version)
334334
whl_libraries[repo_name] = args
335335
whl_map.setdefault(whl_name, []).append(
336336
whl_alias(

python/private/pypi/whl_repo_name.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ def whl_repo_name(prefix, filename, sha256):
5151

5252
return "_".join(parts)
5353

54-
def pypi_repo_name(prefix, requirement_line):
54+
def pypi_repo_name(prefix, requirement, version):
5555
"""Return a valid whl_library given a requirement line.
5656
5757
Args:
5858
prefix: {type}`str` the prefix of the whl_library.
59-
requirement_line: {type}`str` the requirement line to extract args.
59+
requirement: {type}`str` the requirement to extract the name.
60+
version: {type}`str` the requirement to extract the name.
6061
6162
Returns:
6263
{type}`str` that can be used in {obj}`whl_library`.
6364
"""
64-
suffix, _, version = requirement_line.partition("==")
65-
version, _, _ = version.partition(" ")
65+
suffix, _, _ = requirement.partition("=")
6666
suffix, _, _ = suffix.partition("]")
6767
suffix = normalize_name(suffix.replace("[", "_").replace(",", "_"))
6868
version = version.replace("-", "_").replace("+", "_").replace(".", "_")

0 commit comments

Comments
 (0)