Skip to content

Commit d890b89

Browse files
authored
Fix bug breaking Python 3.6 compatibility. (googleads#435)
1 parent c9281e7 commit d890b89

5 files changed

Lines changed: 27 additions & 8 deletions

File tree

google/ads/googleads/v5/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import sys
2121

2222

23-
if sys.version_info < (3, 7):
24-
raise ImportError("This module requires Python 3.7 or later.")
23+
if sys.version_info < (3, 6):
24+
raise ImportError("This module requires Python 3.6 or later.")
2525

2626

2727
_lazy_type_to_package_map = {
@@ -1491,3 +1491,9 @@ def __getattr__(name): # Requires Python >= 3.7
14911491

14921492
def __dir__():
14931493
return globals().get("__all__") or __getattr__("__all__")
1494+
1495+
1496+
if not sys.version_info >= (3, 7):
1497+
from pep562 import Pep562
1498+
1499+
Pep562(__name__)

google/ads/googleads/v6/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020
import sys
2121

2222

23-
if sys.version_info < (3, 7):
24-
raise ImportError("This module requires Python 3.7 or later.")
23+
if sys.version_info < (3, 6):
24+
raise ImportError("This module requires Python 3.6 or later.")
2525

2626

2727
_lazy_type_to_package_map = {
@@ -1586,3 +1586,9 @@ def __getattr__(name): # Requires Python >= 3.7
15861586

15871587
def __dir__():
15881588
return globals().get("__all__") or __getattr__("__all__")
1589+
1590+
1591+
if not sys.version_info >= (3, 7):
1592+
from pep562 import Pep562
1593+
1594+
Pep562(__name__)

google/ads/googleads/v7/__init__.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
import sys
1818

1919

20-
if sys.version_info < (3, 7):
21-
raise ImportError("This module requires Python 3.7 or later.")
20+
if sys.version_info < (3, 6):
21+
raise ImportError("This module requires Python 3.6 or later.")
2222

2323

2424
_lazy_type_to_package_map = {
@@ -1656,3 +1656,9 @@ def __getattr__(name): # Requires Python >= 3.7
16561656

16571657
def __dir__():
16581658
return globals().get("__all__") or __getattr__("__all__")
1659+
1660+
1661+
if not sys.version_info >= (3, 7):
1662+
from pep562 import Pep562
1663+
1664+
Pep562(__name__)

noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import nox
22

33

4-
@nox.session
4+
@nox.session(python=["3.6", "3.7"])
55
def tests(session):
66
session.install(".")
77
# modules for testing

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
import io
1818

1919
install_requires = [
20+
"dataclasses >= 0.6, < 1.0.0",
2021
"google-auth-oauthlib >= 0.3.0, < 1.0.0",
2122
"google-api-core >= 1.21.0, < 2.0.0",
2223
"googleapis-common-protos >= 1.5.8, < 2.0.0",
2324
"grpcio >= 1.33.2, < 2.0.0",
2425
"proto-plus >= 1.18.0, < 2.0.0",
2526
"PyYAML >= 5.1, < 6.0",
26-
"setuptools>=40.3.0",
27+
"setuptools >= 40.3.0",
2728
"pep562 >= 1.0, < 2.0",
2829
"nox == 2020.12.31",
2930
]

0 commit comments

Comments
 (0)