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

Silent dependency on urllib3 in _aiohttp_requests #707

Closed
asafflesch opened this issue Feb 17, 2021 · 3 comments · Fixed by #755
Closed

Silent dependency on urllib3 in _aiohttp_requests #707

asafflesch opened this issue Feb 17, 2021 · 3 comments · Fixed by #755
Assignees
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@asafflesch
Copy link

Environment details

  • OS: OSX, Linux
  • Python version: 3.7
  • pip version:
  • google-auth version: 1.24.0

Steps to reproduce

  1. Setup a clean virtualenv
  2. pip install google-auth==1.24.0 aiohttp==3.5.4 (version I happen to be using)
  3. Run "from google.auth.transport import _aiohttp_requests" in a python3 session

You should get a ModuleNotFoundError for "urllib3"

@asafflesch
Copy link
Author

(I see there's also a silent dependency there on requests - maybe you just intend for the exception on requests not being installed to go off first?)

@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Feb 18, 2021
@busunkim96
Copy link
Contributor

Hey @Faqa,

Before aiohttp_requests we didn't have urllib3 or requests as hard dependencies and assumed that folks would install one or both as needed after seeing one of these error messages:

try:
import requests
except ImportError as caught_exc: # pragma: NO COVER
import six
six.raise_from(
ImportError(
"The requests library is not installed, please install the "
"requests package to use the requests transport."
),
caught_exc,

try:
import urllib3
except ImportError as caught_exc: # pragma: NO COVER
import six
six.raise_from(
ImportError(
"The urllib3 library is not installed, please install the "
"urllib3 package to use the urllib3 transport."
),
caught_exc,
)

Since _aiohttp_requests has a hard dependency on both I think we should just add it to the aiohttp extra to reduce friction. I'll open a PR adjusting the extras. After that change if you do pip install google-auth[aiohttp] it should pull in all the required dependencies.

extras = {
"aiohttp": "aiohttp >= 3.6.2, < 4.0.0dev; python_version>='3.6'",
"pyopenssl": "pyopenssl>=20.0.0",
}

@busunkim96 busunkim96 added priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. and removed triage me I really want to be triaged. labels Feb 18, 2021
@parthea
Copy link
Contributor

parthea commented May 19, 2021

@busunkim96 Please can you take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants