This is a follow-up to my previous question.
After resolving that error, I now get the following error, which is another case where a URL needs to be rewritten, but this time inside the pip invoked by bazel:
pip._vendor.requests.exceptions.SSLError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/31/80/3a54838c3fb461f6fec263ebf3a3a41771bd05190238de3486aae8540c36/jinja2-3.1.4-py3-none-any.whl (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)')))
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/ubuntu/.cache/bazel/_bazel_ubuntu/b4e0fd0e207e6fdf5e33997b6741cf2d/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 205, in <module>
main()
File "/home/ubuntu/.cache/bazel/_bazel_ubuntu/b4e0fd0e207e6fdf5e33997b6741cf2d/external/rules_python/python/pip_install/tools/wheel_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/home/ubuntu/.cache/bazel/_bazel_ubuntu/b4e0fd0e207e6fdf5e33997b6741cf2d/external/python3_11_x86_64-unknown-linux-gnu/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/home/ubuntu/.cache/bazel/_bazel_ubuntu/b4e0fd0e207e6fdf5e33997b6741cf2d/external/python3_11_x86_64-unknown-linux-gnu/bin/python3', '-m', 'pip', '--isolated', 'wheel', '--no-deps', '--require-hashes', '-r', '/tmp/tmpv11wtxad']' returned non-zero exit status 2.
I already have a new index URL configured in ~/.config/pip/pip.conf
, but bazel’s pip appears to be ignoring it.
I searched for pip
in the command line reference but did not find anything.
Is there a way to force bazel’s pip to use a particular configuration?
0
I think you should look in rules_python. These attributes of a pip
rule are relevant.
Here is the docs link to the first of the index url attributes. Add one of these with the right URL and it should be gravy.