Question: Bazel downloader should only be reading packages, versions, and hashes from pip.parse.requirements_lock, correct? #2564
-
We have a requirements lock file
And our pip.parse(
experimental_index_url = "https://pypi.org/simple",
experimental_index_url_overrides = {"package": "https//baz.com/simple", ...}, # note no "oauth2accesstoken"
requirements_lock = "requirements.txt",
... At this point Bazel fails for 401 unauthorized (which is why I'm down this rabbit hole in the first place... you can ignore this):
But if I change ---extra-index-url https://oauth2accesstoken@baz.com/simple
+--extra-index-url https://baz.com/simple I get a different Bazel error. Whaaaaaat?:
Thus, it seems like Bazel may be reading Given that the different error is asking for username and password, I'm inclined to think it's related to the credential helper. Our credential helper essentially just calls |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
The index interaction happens in 2 places:
EDIT: If you are content with the answer feel free to convert the issue to a discussion (the best place for questions in general), otherwise we can groom this into a feature/bug ticket. :) |
Beta Was this translation helpful? Give feedback.
-
Hard to say. My initial reaction was to say "no, we should use the value from
The
Ah, thanks! I wasn't aware we used Discussions (or maybe I forgot...). Done! |
Beta Was this translation helpful? Give feedback.
-
Is this still a problem? |
Beta Was this translation helpful? Give feedback.
-
There's a TL;DR proposal summary at the end. Well it doesn't impact us but that's because I've been operating in the "just make sure that the index url in requirements lock file matches that defined in I think the ideal situation is that there is only a single place where index URLs are set. It seems like This brings up an issue though - some workflows use Maybe we make the requirements lock file the source of index URLs for pip.parse(
experimental_bazel_downloader = True,
experimental_index_url_overrides = {"package": "https//baz.com/simple", ...},
requirements_lock = "requirements.txt",
... If
The pip.parse(
experimental_index_url = "https://foo/simple",
experimental_extra_index_urls = ["https://bar/simple", "https://foobar/simple"]
experimental_index_url_overrides = {"package": "https//baz.com/simple", ...}, # note no "oauth2accesstoken"
requirements_lock = "requirements.txt",
... The net result of such a change is that the flowchart TD
A[req.in] --> B[pip compile<br>uv pip compile]
A --> C[compile_pip_requirements]
B --> D[req.lock]
C --> D
D --> |effectively sets| E[pip.parse.experimental_index_url<br>pip.parse.experimental_extra_index_urls]
Proposal summary:
I think keeping Alternative:
|
Beta Was this translation helpful? Give feedback.
I am +1 for the proposal and I think I had something similar in mind when it would come to actually start stabilizing the API.
The only issue or thing to have in mind is to ensure that the index is the same across all of the platforms and fail with an error. We are parsing the requirements files in
parse_requirements
function and incidentally we are using the same file to pull stuff from the PyPI, so that place can handle everything.