fix(pip): preserve PEP 508 URL-based requirements when extract_url_srcs=False by jsharpe · Pull Request #3582 · bazel-contrib/rules_python

@jsharpe @claude

…cs=False

pip_parse (via pip_repository) passes extract_url_srcs=False to
parse_requirements. The _package_srcs() function silently dropped
PEP 508 URL-based requirements (pkg @ https://...) in this mode
because _add_dists() returns can_fallback=False for URL requirements,
causing them to fall through to the `continue` statement.

Fix the elif condition to also accept the case where extract_url_srcs
is False but a valid URL dist exists, falling back to pip to handle
the URL requirement directly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

gemini-code-assist[bot]

rickeylev pushed a commit to rickeylev/rules_python that referenced this pull request

Feb 23, 2026
…cs=False (bazel-contrib#3582)

pip_parse (via pip_repository) passes extract_url_srcs=False to
parse_requirements. The _package_srcs() function silently dropped PEP
508 URL-based requirements (pkg @ https://...) in this mode because
_add_dists() returns can_fallback=False for URL requirements, causing
them to fall through to the `continue` statement.

Fix the elif condition to also accept the case where extract_url_srcs is
False but a valid URL dist exists, falling back to pip to handle the URL
requirement directly.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
(cherry picked from commit 9dcbabb)

aignas pushed a commit to aignas/rules_python that referenced this pull request

Feb 23, 2026
…cs=False (bazel-contrib#3582)

pip_parse (via pip_repository) passes extract_url_srcs=False to
parse_requirements. The _package_srcs() function silently dropped PEP
508 URL-based requirements (pkg @ https://...) in this mode because
_add_dists() returns can_fallback=False for URL requirements, causing
them to fall through to the `continue` statement.

Fix the elif condition to also accept the case where extract_url_srcs is
False but a valid URL dist exists, falling back to pip to handle the URL
requirement directly.

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>