Skip to content

Commit 817a11a

Browse files
committed
fix: Dropping google-auth explicit dependency; Temp test skip for Py 3.5
1 parent 554f7a5 commit 817a11a

File tree

3 files changed

+14
-5
lines changed

3 files changed

+14
-5
lines changed

requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@ pytest-localserver >= 0.4.1
77
cachecontrol >= 0.12.6
88
google-api-core[grpc] >= 1.22.1, < 2.0.0dev; platform.python_implementation != 'PyPy'
99
google-api-python-client >= 1.7.8
10-
google-auth == 1.28.1
1110
google-cloud-firestore >= 2.1.0; platform.python_implementation != 'PyPy'
1211
google-cloud-storage >= 1.37.1

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,10 @@
3838
'to integrate Firebase into their services and applications.')
3939
install_requires = [
4040
'cachecontrol>=0.12.6',
41-
'google-api-core[grpc] >= 1.14.0, < 2.0.0dev; platform.python_implementation != "PyPy"',
41+
'google-api-core[grpc] >= 1.22.1, < 2.0.0dev; platform.python_implementation != "PyPy"',
4242
'google-api-python-client >= 1.7.8',
43-
'google-cloud-firestore>=1.4.0; platform.python_implementation != "PyPy"',
44-
'google-cloud-storage>=1.18.0',
43+
'google-cloud-firestore>=2.1.0; platform.python_implementation != "PyPy"',
44+
'google-cloud-storage>=1.37.1',
4545
]
4646

4747
setup(

tests/test_token_gen.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import datetime
1919
import json
2020
import os
21+
import sys
2122
import time
2223

2324
from google.auth import crypt
@@ -75,13 +76,22 @@ def _merge_jwt_claims(defaults, overrides):
7576
del defaults[key]
7677
return defaults
7778

79+
80+
def _is_py_35():
81+
return sys.version_info.minor == 5
82+
83+
7884
def verify_custom_token(custom_token, expected_claims, tenant_id=None):
7985
assert isinstance(custom_token, bytes)
8086
expected_email = MOCK_SERVICE_ACCOUNT_EMAIL
8187
header = jwt.decode_header(custom_token)
8288
assert header.get('typ') == 'JWT'
8389
if _is_emulated():
84-
assert header.get('alg') == 'none'
90+
# Setting alg requires https://github.com/googleapis/google-auth-library-python/pull/729
91+
# which is only available in latest google-auth versions that's supported on Python 3.6
92+
# and up. Skip the test on Python 3.5 for now.
93+
if not _is_py_35():
94+
assert header.get('alg') == 'none'
8595
assert custom_token.split(b'.')[2] == b''
8696
expected_email = _token_gen.AUTH_EMULATOR_EMAIL
8797
token = jwt.decode(custom_token, verify=False)

0 commit comments

Comments
 (0)