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

Proxy from environment variables #1825

Merged
merged 3 commits into from
Apr 20, 2017
Merged

Proxy from environment variables #1825

merged 3 commits into from
Apr 20, 2017

Conversation

MRigal
Copy link
Contributor

@MRigal MRigal commented Apr 19, 2017

What do these changes do?

Allows optional reading proxy from environment variables. Addresses #1791 #529 and #102

Are there changes in behavior for the user?

They can use proxy from environment variables like in requests, even if it is disabled by default here

Related issue number

Resolving open issue #1791

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new entry to CHANGES.rst
    • Choose any open position to avoid merge conflicts with other PRs.
    • Add a link to the issue you are fixing (if any) using #issue_number format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.

@MRigal MRigal changed the title Proxy from env Proxy from environment variables Apr 19, 2017
@@ -96,7 +98,7 @@ def __init__(self, method, url, *,
self.update_cookies(cookies)
self.update_content_encoding(data)
self.update_auth(auth)
self.update_proxy(proxy, proxy_auth)
self.update_proxy(proxy, proxy_auth, proxy_from_env)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use False instead of None

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok. I'll wait for more comments and push the changes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've added the change and squashed a bit the commit history

@codecov-io
Copy link

codecov-io commented Apr 19, 2017

Codecov Report

Merging #1825 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1825      +/-   ##
==========================================
+ Coverage   97.23%   97.23%   +<.01%     
==========================================
  Files          37       37              
  Lines        7478     7482       +4     
  Branches     1299     1300       +1     
==========================================
+ Hits         7271     7275       +4     
  Misses         87       87              
  Partials      120      120
Impacted Files Coverage Δ
aiohttp/client_reqrep.py 97.8% <100%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff77836...cfbe9ba. Read the comment docs.

@fafhrd91
Copy link
Member

comments anyone?

@asvetlov @kxepal ^^

Update changes and contributors

Escaping spell-checking

Set default to False
@kxepal
Copy link
Member

kxepal commented Apr 19, 2017

LGFM, though I'm pretty sure people will get annoyed by proxy_from_env flag they forced to set on most of time. Quite common behavior is just fallback to environment variables if they are available and no explicit value was provided. But I can imagine cases when you want to turn off such behavior, however.

I think that flag should be described quite notable since it's potential gotcha.

@MRigal
Copy link
Contributor Author

MRigal commented Apr 20, 2017

@kxepal this is also fully my opinion and why I reported it as an issue in #1791 !!! But as pointed in the various discussions, @fafhrd91 and @asvetlov are strictly against falling back to environment variables...

Unfortunately for now, aiohttp doesn't even allow this possibility, so this is a first step.
Enabling it by default, is, IMHO, desired, but should happen only in a 3.0 release, as this will break the behaviour of some installs.

This WAS indeed a real gotcha towards requests and in this PR I make the actual behaviour quite clear in the documentation.

@kxepal
Copy link
Member

kxepal commented Apr 20, 2017

@MRigal Sorry, I didn't follow those discussions. But indeed, that's a good step forward.

@fafhrd91 fafhrd91 merged commit 8d8634a into aio-libs:master Apr 20, 2017
@fafhrd91
Copy link
Member

good work!

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants