Because of rules_python issue bazelbuild/rules_python#14 I propose to remove the explicit dependency on google-auth and google-auth-httplib2 as they break the google namespace.
The googleapiclient already checks for any available auth lib, such as non-google oauth2client which is compatible with googleapiclient. However, oauth2client is deprecated, so I also propose to add a wrapper for oauthlib.
google-cloud packages also break the google namespace, so googleapiclient is the last resource and the strict dependency on google-auth breaks the build when using BAZEL with rules_python.
I'm sorry, but that isn't going to work for us: google-auth is the preferred / supported library for doing authentication here. See https://github.com/googleapis/google-auth-library-python/issues/274: the issue is with Bazel's rules_python, not google-auth, which is correctly declaring the namespace package.
Thank you @tseaver . I know google-auth is the preffered / supported library, but your code does check to "see" if google-auth is not installed, and if it's not, you look for oauth2client (which is deprecated). My point is that google-auth can remain the official supported library, but don't enforce it as a strict dependency. The checking for oauth2client doesn't make sense, in my opinion, if you enforce google-auth first. According to the code [1], it looks to me that it should be up to the user to decide which auth library to use, but it's actually not, unless there's something I'm not understanding with your setup.py.
[1] https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/_auth.py#L47
Greetings, we're closing this. Looks like the issue got resolved. Please let us know if the issue needs to be reopened.
Most helpful comment
Thank you @tseaver . I know
google-authis the preffered / supported library, but your code does check to "see" if google-auth is not installed, and if it's not, you look for oauth2client (which is deprecated). My point is thatgoogle-authcan remain the official supported library, but don't enforce it as a strict dependency. The checking for oauth2client doesn't make sense, in my opinion, if you enforce google-auth first. According to the code [1], it looks to me that it should be up to the user to decide which auth library to use, but it's actually not, unless there's something I'm not understanding with your setup.py.[1] https://github.com/googleapis/google-api-python-client/blob/master/googleapiclient/_auth.py#L47