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

Enable static type checking with pytype #298

Merged
merged 11 commits into from
Oct 5, 2018
Prev Previous commit
Next Next commit
Ignore various type errors raised by pytype.
- `__init__.py`: pytype is not aware of `__path__`.
- jwt.py: the pyi file for urllib.unparse is not aware of None. Empty
strings are clearer.
  • Loading branch information
Solumin committed Sep 13, 2018
commit 5ed53aaa748563ce5d7e66231fb5b87891644b23
2 changes: 1 addition & 1 deletion google/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
pkg_resources.declare_namespace(__name__)
except ImportError:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
__path__ = pkgutil.extend_path(__path__, __name__) # pytype: disable=name-error
4 changes: 2 additions & 2 deletions google/auth/jwt.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
import datetime
import json

import cachetools
import cachetools # pytype: disable=import-error
import six
from six.moves import urllib

Expand Down Expand Up @@ -738,7 +738,7 @@ def before_request(self, request, method, url, headers):
parts = urllib.parse.urlsplit(url)
# Strip query string and fragment
audience = urllib.parse.urlunsplit(
(parts.scheme, parts.netloc, parts.path, None, None))
(parts.scheme, parts.netloc, parts.path, "", ""))
token = self._get_jwt_for_audience(audience)
self.apply(headers, token=token)

Expand Down