You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The simpleapi_download function called by the pip.parse repo rule.
Is this a regression?
No
Description
Environment variables are substitutedafterstripping trailing / characters, meaning that an environment variable containing a trailing slash in experimental_index_url will not have that trailing slash stripped. The index URL is concatenated with packages and results in paths with double slashes where there should be single ones. This in turn leads to 404 errors when attempting to fetch index URLs.
Given that the existing code tries to handle index URLs with trailing slashes already, and that the Simple API spec says "All URLs which respond with an HTML5 page MUST end with a /" and "the root URL MUST be a valid HTML5 page", it seems reasonable to consider this a bug within rules_python rather than just making users manually remove trailing slashes from $PIP_EXTRA_INDEX_URL themselves.
WARNING: Download from https://.d.codeartifact.eu-central-1.amazonaws.com/pypi/packages-prod/simple//msal/ failed: class java.io.FileNotFoundException GET returned 404 Not Found
ERROR: /home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/simpleapi_download.bzl:120:17: Traceback (most recent call last):
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/extension.bzl", line 604, column 25, in _pip_impl
mods = parse_modules(module_ctx)
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/extension.bzl", line 478, column 36, in parse_modules
out = _create_whl_repos(
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/extension.bzl", line 182, column 50, in _create_whl_repos
requirements_by_platform = parse_requirements(
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/parse_requirements.bzl", line 174, column 36, in parse_requirements
index_urls = get_index_urls(
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/extension.bzl", line 166, column 71, in lambda
get_index_urls = lambda ctx, distributions: simpleapi_download(
File "/home/wmorrison/.cache/bazel/_bazel_wmorrison/0c20006a190ede26aadee6a87e8d620f/external/rules_python+/python/private/pypi/simpleapi_download.bzl", line 120, column 17, in simpleapi_download
fail("Failed to download metadata from urls: {}".format(
Error in fail: Failed to download metadata from urls: $PIP_EXTRA_INDEX_URL
ERROR: error evaluating module extension pip in @@rules_python+//python/extensions:pip.bzl
INFO: Elapsed time: 2.313s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Fetching some target dependencies failed with errors: error evaluating module extension pip in @@rules_python+//python/extensions:pip.bzl
🐞 bug report
Affected Rule
The
simpleapi_download
function called by thepip.parse
repo rule.Is this a regression?
No
Description
Environment variables are substituted after stripping trailing / characters, meaning that an environment variable containing a trailing slash in
experimental_index_url
will not have that trailing slash stripped. The index URL is concatenated with packages and results in paths with double slashes where there should be single ones. This in turn leads to 404 errors when attempting to fetch index URLs.Given that the existing code tries to handle index URLs with trailing slashes already, and that the Simple API spec says "All URLs which respond with an HTML5 page MUST end with a /" and "the root URL MUST be a valid HTML5 page", it seems reasonable to consider this a bug within rules_python rather than just making users manually remove trailing slashes from
$PIP_EXTRA_INDEX_URL
themselves.🔬 Minimal Reproduction
MODULE.bazel
:🔥 Exception or Error
🌍 Your Environment
Operating System:
Output of
bazel version
:Rules_python version:
Anything else relevant?
Related to #1357
The text was updated successfully, but these errors were encountered: