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
{{ message }}
Repository navigation
Requirements parsing (pip.parse) does not work with experimental_index_url after 1.4.0 upgrade #2863
...
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
experimental_index_url = "http://some-proxy-url/pypi/simple", # have to be set
hub_name = "hub",
python_version = "3.10.8",
requirements_lock = "//:requirements.txt",
)
...
Run bazel mod deps --lockfile_mode=update
🔥 Exception or Error
```
File "/private/var/tmp/_bazel_roman.vlasenko/7eb23c38ebf1165e125a92c28d7d5daa/external/rules_python+/python/private/pypi/parse_requirements.bzl", line 321, column 33, in _add_dists
shas_to_use = index_urls.sha256s_by_version.get(version, [])
Error: 'struct' value has no field or method 'sha256s_by_version'
Available attributes: sdists, sha256_by_version, whls
ERROR: error evaluating module extension @@rules_python+//python/extensions:pip.bzl%pip
```
🌍 Your Environment
Operating System:
24.4.0 Darwin Kernel Version 24.4.0: Wed Mar 19 21:17:35 PDT 2025; root:xnu-11417.101.15~1/RELEASE_ARM64_T6041 arm64
Just for posterity, if you didn't specify hashes before 1.4, the experimental_index_url feature would fallback to legacy operation and rules_python would not be using the downloader. To work around this issue or similar/related ones, please specify hashes in your requirements.txt file.
Activity
jfirebaugh commentedon May 7, 2025
Based on the error message
and code
rules_python/python/private/pypi/parse_simpleapi_html.bzl
Line 105 in 965dd51
I think the attribute is spelled
sha256_by_version, notsha256s_by_version.(It seems this feature is missing test coverage.)
fix(pypi): fix a typo in parse_simpleapi_html
fix(pypi): fix a typo in parse_simpleapi_html (#2866)
fix(pypi): fix a typo in parse_simpleapi_html (#2866)
aignas commentedon May 9, 2025
Just for posterity, if you didn't specify hashes before 1.4, the
experimental_index_urlfeature would fallback to legacy operation andrules_pythonwould not be using the downloader. To work around this issue or similar/related ones, please specify hashes in yourrequirements.txtfile.