8000 change: Drop Python 3.5 support (#542) · s2t2/firebase-admin-python@a6714a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit a6714a1

Browse files
change: Drop Python 3.5 support (firebase#542)
* chore: Drop Python 3.5 support * Remove SHA1 hash tests * Clean up previous python version hacks * update to use pytest.MonkeyPatch() * upgrade pytest to 6.2.0 and up
1 parent 5e88d92 commit a6714a1

File tree

7 files changed

+12
-28
lines changed

7 files changed

+12
-28
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
strategy:
99
fail-fast: false
1010
matrix:
11-
python: [3.5, 3.6, 3.7, 3.9, pypy3]
11+
python: [3.6, 3.7, 3.8, 3.9, pypy3]
1212

1313
steps:
1414
- uses: actions/checkout@v1

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ information on using pull requests.
8585

8686
### Initial Setup
8787

88-
You need Python 3.4+ to build and test the code in this repo.
88+
You need Python 3.6+ to build and test the code in this repo.
8989

9090
We recommend using [pip](https://pypi.python.org/pypi/pip) for installing the necessary tools and
9191
project dependencies. Most recent versions of Python ship with pip. If your development environment

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ requests, code review feedback, and also pull requests.
4343

4444
## Supported Python Versions
4545

46-
We currently support Python 3.5+. However, Python 3.5 support is deprecated,
47-
and the developers are strongly advised to use Python 3.6 or higher. Firebase
46+
We currently support Python 3.6+. Firebase
4847
Admin Python SDK is also tested on PyPy and
4948
[Google App Engine](https://cloud.google.com/appengine/) environments.
5049

integration/test_project_management.py

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
TEST_APP_PACKAGE_NAME = 'com.firebase.adminsdk_python_integration_test'
2929
TEST_APP_DISPLAY_NAME_PREFIX = 'Created By Firebase AdminSDK Python Integration Testing'
3030

31-
SHA_1_HASH_1 = '123456789a123456789a123456789a123456789a'
32-
SHA_1_HASH_2 = 'aaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbb'
3331
SHA_256_HASH_1 = '123456789a123456789a123456789a123456789a123456789a123456789a1234'
3432
SHA_256_HASH_2 = 'cafef00dba5eba11b01dfaceacc01adeda7aba5eca55e77e0b57ac1e5ca1ab1e'
3533
SHA_1 = project_management.SHACertificate.SHA_1
@@ -119,17 +117,13 @@ def test_android_sha_certificates(android_app):
119117
for cert in android_app.get_sha_certificates():
120118
android_app.delete_sha_certificate(cert)
121119

122-
# Add four different certs and assert that they have all been added successfully.
123-
android_app.add_sha_certificate(project_management.SHACertificate(SHA_1_HASH_1))
124-
android_app.add_sha_certificate(project_management.SHACertificate(SHA_1_HASH_2))
120+
# Add two different certs and assert that they have all been added successfully.
125121
android_app.add_sha_certificate(project_management.SHACertificate(SHA_256_HASH_1))
126122
android_app.add_sha_certificate(project_management.SHACertificate(SHA_256_HASH_2))
127123

128124
cert_list = android_app.get_sha_certificates()
129125

130-
sha_1_hashes = set(cert.sha_hash for cert in cert_list if cert.cert_type == SHA_1)
131126
sha_256_hashes = set(cert.sha_hash for cert in cert_list if cert.cert_type == SHA_256)
132-
assert sha_1_hashes == set([SHA_1_HASH_1, SHA_1_HASH_2])
133127
assert sha_256_hashes == set([SHA_256_HASH_1, SHA_256_HASH_2])
134128
for cert in cert_list:
135129
assert cert.name
@@ -195,12 +189,8 @@ def test_list_ios_apps(ios_app):
195189
def test_get_ios_app_config(ios_app, project_id):
196190
config = ios_app.get_config()
197191

198-
# In Python 2.7, the plistlib module works with strings, while in Python 3, it is significantly
199-
# redesigned and works with bytes objects instead.
200-
try:
201-
plist = plistlib.loads(config.encode('utf-8'))
202-
except AttributeError: # Python 2.7 plistlib does not have the loads attribute.
203-
plist = plistlib.readPlistFromString(config) # pylint: disable=no-member
192+
plist = plistlib.loads(config.encode('utf-8'))
193+
204194
assert plist['BUNDLE_ID'] == TEST_APP_BUNDLE_ID
205195
assert plist['PROJECT_ID'] == project_id
206196
assert plist['GOOGLE_APP_ID'] == ios_app.app_id

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
astroid == 2.3.3
22
pylint == 2.3.1
3-
pytest >= 3.6.0
3+
pytest >= 6.2.0
44
pytest-cov >= 2.4.0
55
pytest-localserver >= 0.4.1
66

setup.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222

2323

2424
(major, minor) = (sys.version_info.major, sys.version_info.minor)
25-
if major != 3 or minor < 5:
26-
print('firebase_admin requires python >= 3.5', file=sys.stderr)
25+
if major != 3 or minor < 6:
26+
print('firebase_admin requires python >= 3.6', file=sys.stderr)
2727
sys.exit(1)
2828

2929
# Read in the package metadata per recommendations from:
@@ -55,15 +55,15 @@
5555
keywords='firebase cloud development',
5656
install_requires=install_requires,
5757
packages=['firebase_admin'],
58-
python_requires='>=3.5',
58+
python_requires='>=3.6',
5959
classifiers=[
6060
'Development Status :: 5 - Production/Stable',
6161
'Intended Audience :: Developers',
6262
'Topic :: Software Development :: Build Tools',
6363
'Programming Language :: Python :: 3',
64-
'Programming Language :: Python :: 3.5',
6564
'Programming Language :: Python :: 3.6',
6665
'Programming Language :: Python :: 3.7',
66+
'Programming Language :: Python :: 3.8',
6767
'Programming Language :: Python :: 3.9',
6868
'License :: OSI Approved :: Apache Software License',
6969
],

tests/testutils.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,7 @@ def run_without_project_id(func):
6161

6262

6363
def new_monkeypatch():
64-
try:
65-
return pytest.MonkeyPatch()
66-
except AttributeError:
67-
# Fallback for Python 3.5
68-
from _pytest.monkeypatch import MonkeyPatch
69-
return MonkeyPatch()
64+
return pytest.MonkeyPatch()
7065

7166

7267
class MockResponse(transport.Response):

0 commit comments

Comments
 (0)
0