-
Notifications
You must be signed in to change notification settings - Fork 570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
extra_pip_args
do not seem to be passed to whl_library
#2239
Comments
When you pass I am not sure when I'll be able to fix it myself, so if you would like to contribute, feel free to put the following line under a conditional to only drop the
There are similar if statements nearby. |
Should I'll admit that I'm not very familiar with the Python package management systems, but my understanding is that, if I specify I can see that the
and so I'm confused about why it isn't just fetching it? I'll add that I don't really know what an "sdist" is or why one might choose to use it over a |
Ah, now I think I get what the problem is - we are fetching some extra dependencies from I think for |
Thanks for the update @aignas - unfortunately, setting up a rewrite rule in the downloader config didn't seem to help. I've spent a bit more time debugging this and I think I've found the root cause. In requirements_by_platform = parse_requirements(
module_ctx,
requirements_by_platform = requirements_files_by_platform(
requirements_by_platform = pip_attr.requirements_by_platform,
requirements_linux = pip_attr.requirements_linux,
requirements_lock = pip_attr.requirements_lock,
requirements_osx = pip_attr.requirements_darwin,
requirements_windows = pip_attr.requirements_windows,
extra_pip_args = pip_attr.extra_pip_args,
python_version = major_minor,
logger = logger,
),
get_index_urls = get_index_urls,
evaluate_markers = ...,
logger = logger,
) the The For a little bit more context: I do not think that the problem was that the |
Before this PR we were just dropping the `extra_pip_args` passed to `pip.parse` and were just using the args passed through the requirements file. Thanks to @swarren12 for pointing this out. This PR also passes `extra_pip_args` to `sdist` `whl_library` instances so that users can build the `sdists` correctly when using `experimental_index_url` feature. Summary: - pass `extra_pip_args` when building sdists in experimental mode - join `extra_pip_args` from the file and the pip.parse attr - test: add a test to ensure that the extra args are joined Fixes #2239 Closes #2254
🐞 bug report
Affected Rule
I guess the affected rule is
whl_library
, but from a "dumb end user" point of view, it'spip.parse
.Is this a regression?
Yes.
Description
Expected behaviour: specifying either
experimental_index_url
orextra_pip_args = [ "--index-url=..." ]
allows fetching from a custom index.Actual behaviour: some parts of the build appear to resolve against the custom URL, but later parts fail.
I think this is related to #2152, but at least for me using the current
HEAD
ofrules_python
does not seem to fix the issue.I'm currently using these rules in an air-gapped CI environment, so it does not have access to
pypi.org
. On v0.34.0, the following snippet is working fine:However, after upgrading to
0.35.0
, this breaks with the following error:The interesting thing here is that the command line being run appears to have completely omitted the
extra_pip_args
:As mentioned above, I've tried running with a
git_override()
pointing to the currentHEAD
ofmain
, but the error persists:does not work, but pointing the override to 0.34.0 does:
🔬 Minimal Reproduction
I can try and produce a minimal reproduction, but it's difficult to prove without having something blocking access to regular
pypi.org
.🔥 Exception or Error
I don't think the stack-trace from Python is very helpful, but I include it just for completeness.
🌍 Your Environment
Operating System: Fedora Linux 40
Output of
bazel version
:Rules_python version: v0.35.0
The text was updated successfully, but these errors were encountered: