ansible-test - add proxy support to pip#81117
Conversation
With this commit the --proxy parameter is added to pip install. The value is sourced from the os environment. fixes ansible#77304
|
The test |
mattclay
left a comment
There was a problem hiding this comment.
This PR doesn't really address #77304 -- that issue is about lack of proxy support for bootstrapping pip. The current implementation in this PR doesn't support delegation, such as with the --docker or --remote options.
@chrros95 Can you explain more about your use case? Is there a reason you can't use a pip configuration file instead?
|
Thanks for the review. Adding the --proxy option doesn't solve the bootstrapping issue. The issue is solved by the extended allowlist in test/lib/ansible_test/_internal/util.py. With this extension *_proxy vars are not filtered and urllib can detect a proxy to download the get-pip file. I have added a commit so that the *_proxy vars are passed to the containers. For the My project run inside a docker container which is regularly destroyed and where I'm not allowed to modify any startup parameters. To avoid a regular manual creation of the pip configuration file, I would appreciate it if it works out "of the box". |
|
cc @mattclay |
Add proxy support to pip
SUMMARY
With this commit the --proxy parameter is added to pip the pip options if the command is install.
The value is sourced from the os environment. As only one proxy can be used by pip the first matching environment variable that exists will be used. Nowadys most sources are transfered vis https so proxies with HTTPS are prefered. As there is no convention weather the variables are lower or upper case - both are checked.
The no_proxy vars are already accepted as pip currently prepares to support a no_proxy option (pypa/pip#5378)
fixes #77304
ISSUE TYPE
COMPONENT NAME
ansible-test (sanity)