Skip to content
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

Pip - doesn't pass proxy settings through to git/hg etc. #227

Closed
vbabiy opened this issue Mar 15, 2011 · 17 comments
Closed

Pip - doesn't pass proxy settings through to git/hg etc. #227

vbabiy opened this issue Mar 15, 2011 · 17 comments
Labels
auto-locked Outdated issues that have been locked by automation C: proxy Dealing with proxies and networking C: vcs pip's interaction with version control systems like git, svn and bzr state: needs discussion This needs some more discussion type: enhancement Improvements to functionality

Comments

@vbabiy
Copy link
Contributor

vbabiy commented Mar 15, 2011

heya,

I'm using pip behind a proxy, and it's really a nightmare atm...lol. Wget seems to download the packages reliably, but with pip, I have to set the timeout to 30 seconds, and it's still a hit and miss. I wish it's proxy support was better.

Anyhow, pip also doesn't seem to pass on proxy settings to commands like git. Even with environmental variables set, as well as passing the "--proxy" setting to pip, git/hg/etc. seems to completely ignore that, and try to download directly instead of via the proxy.

Cheers,
victor


@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

heya,

I'm using pip behind a proxy, and it's really a nightmare atm...lol. Wget
seems to download the packages reliably, but with pip, I have to set the
timeout to 30 seconds, and it's still a hit and miss. I wish it's proxy
support was better.

Anyhow, pip also doesn't seem to pass on proxy settings to commands like git.
Even with environmental variables set, as well as passing the "--proxy"
setting to pip, git/hg/etc. seems to completely ignore that, and try to
download directly instead of via the proxy.

Cheers, victor


Original Comment By: Victor Hooi

@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

If any workaround or solution is found, we need to remember to comment in
StackOverflow1

1 - http://stackoverflow.com/questions/5085545/pip-and-svn-
under-a-proxy


Original Comment By: Hugo Lopes Tavares

1 similar comment
@vbabiy
Copy link
Contributor Author

vbabiy commented Mar 15, 2011

If any workaround or solution is found, we need to remember to comment in
StackOverflow1

1 - http://stackoverflow.com/questions/5085545/pip-and-svn-
under-a-proxy


Original Comment By: Hugo Lopes Tavares

@dragon788
Copy link

Just ran into this today. Really wonder if it matters whether the pip install is run with sudo or not, but seems like a bit of an oversight that it doesn't call the git/svn binary with an instance environment variable for the http_proxy IF one was supplied or is set when the pip command is run.

@dragon788
Copy link

As a further note, it appears part of the problem is that the clone is assuming it can use the git (ssh) protocol to perform the clone. If it used http or https instead of git:// it would probably work, at least partially. I'm working around this using a git config option that replaces any requests to git://github.com with https://github.com.
I found this workaround here, http://stackoverflow.com/a/32744849/3794873 and I find it slightly more useful than the global replacement of git:// with https:// because we have an internal github where I DO want to authenticate via SSH.
See http://jgoodall.me/posts/2013/05/29/git-use-https/

@pradyunsg pradyunsg added the C: vcs pip's interaction with version control systems like git, svn and bzr label Nov 5, 2017
@cjerdonek
Copy link
Member

@johnthagen I was looking at some old issues and was wondering if you had any experience with this one (e.g. for svn as referenced above).

@johnthagen
Copy link
Contributor

@cjerdonek Unfortunately I haven't used pip/Subversion in a proxy setting, so I don't have any experience here.

@pradyunsg
Copy link
Member

The next step here is for someone to try to reproduce this issue and provide clear steps for reproduction here.

@cjerdonek
Copy link
Member

I'm not sure this is just one issue. The steps to pass proxy settings along to git, svn, etc. may be different for each vcs command. For example, here is info on doing it for git: https://git-scm.com/docs/git-config

Here is for svn: http://subversion.apache.org/faq.html#proxy

Here is for hg: https://www.mercurial-scm.org/doc/hgrc.5.html#http-proxy

And here is for bazaar: http://doc.bazaar.canonical.com/latest/en/user-guide/configuring_bazaar.html#using-a-network-proxy

@pradyunsg
Copy link
Member

Yep yep. We should do that if pip gets a proxy.

Part of why I'm curious to see reproduction of this is to know if setting "http_proxy" is a workaround for folks seeing this today (since those vcs tools support that IIUC).

@pfmoore
Copy link
Member

pfmoore commented Jun 19, 2019

I use a proxy at work and the env variables work fine for me (at least with git).

@pradyunsg
Copy link
Member

@pfmoore would it be possible for you to try unsetting the environment variable and passing the proxy via --proxy?

@pfmoore
Copy link
Member

pfmoore commented Jun 19, 2019

Not for a few weeks, as I'm on holiday right now, sorry.

@cjerdonek
Copy link
Member

FWIW, it should be easy to see what environment variables are passed to the VCS commands since they all go through the VersionControl base class (typing from my phone o/w would link to it).

@pradyunsg
Copy link
Member

Not for a few weeks, as I'm on holiday right now, sorry.

Whoops! My bad; I forgot -- enjoy your holiday! :)

@chrahunt
Copy link
Member

Is there a reason this needs to be implemented in pip? We also do not pass along CA certificates, auto-accept SSH host keys, or handle VCS authentication. It seems like the maintenance burden for these kinds of integration would be high and the payoff pretty low since this kind of configuration would likely need to be done anyway. A quick search reveals that git has tons of flexible options for proxy configuration and hg has a configuration file. A user configuring these globally would make them work across any invoking tools, not just pip.

@chrahunt chrahunt added state: needs discussion This needs some more discussion type: enhancement Improvements to functionality and removed type: bug A confirmed bug or unintended behavior labels Dec 11, 2019
@pradyunsg
Copy link
Member

@chrahunt I think that's a reasonable argument to be making; closing this issue following the reasoning that Chris listed above. :)

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Mar 10, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation C: proxy Dealing with proxies and networking C: vcs pip's interaction with version control systems like git, svn and bzr state: needs discussion This needs some more discussion type: enhancement Improvements to functionality
Projects
None yet
Development

No branches or pull requests

7 participants