Skip to content

Commit 0897033

Browse files
committed
only use python to eval requirements if there are markers
1 parent 0f5b47d commit 0897033

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

python/private/pypi/parse_requirements.bzl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,8 @@ def parse_requirements(
347347
{},
348348
)
349349

350-
reqs_with_env_markers.setdefault(requirement_line, []).append(target_platform)
350+
if ";" in requirement_line:
351+
reqs_with_env_markers.setdefault(requirement_line, []).append(target_platform)
351352

352353
for_req = for_whl.setdefault(
353354
(requirement_line, ",".join(extra_pip_args)),
@@ -364,6 +365,11 @@ def parse_requirements(
364365

365366
# This may call to Python, so execute it early (before calling to the
366367
# internet below) and ensure that we call it only once.
368+
#
369+
# NOTE @aignas 2024-07-13: in the future, if this is something that we want
370+
# to do, we could use Python to parse the requirement lines and infer the
371+
# URL of the files to download things from. This should be important for
372+
# VCS package references.
367373
env_marker_target_platforms = evaluate_markers(reqs_with_env_markers)
368374
if logger:
369375
logger.debug(lambda: "Evaluated env markers from:\n{}\n\nTo:\n{}".format(

0 commit comments

Comments
 (0)