Skip to content

Commit c5996a5

Browse files
committed
fix!: Drop support for Python 2.7
Per the readme, Python 2.7 support was to be dropped on January 1, 2020. This lays the groundwork for making it easier to drop the dependency on pytz. BREAKING CHANGE: This drops support for Python 2.7
1 parent 6229317 commit c5996a5

File tree

4 files changed

+8
-18
lines changed

4 files changed

+8
-18
lines changed

CONTRIBUTING.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In order to add a feature:
2121
- The feature must be documented in both the API and narrative
2222
documentation.
2323

24-
- The feature must work fully on the following CPython versions: 2.7,
24+
- The feature must work fully on the following CPython versions:
2525
3.5, 3.6, 3.7 and 3.8 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
@@ -69,7 +69,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
6969

7070
- To test your changes, run unit tests with ``nox``::
7171

72-
$ nox -s unit-2.7
7372
$ nox -s unit-3.7
7473
$ ...
7574

@@ -143,13 +142,11 @@ Running System Tests
143142
- To run system tests, you can execute::
144143

145144
$ nox -s system-3.7
146-
$ nox -s system-2.7
147145

148146
.. note::
149147

150-
System tests are only configured to run under Python 2.7 and
151-
Python 3.7. For expediency, we do not run them in older versions
152-
of Python 3.
148+
System tests are only configured to run under Python 3.7. For expediency,
149+
we do not run them in older versions.
153150

154151
This alone will not run the tests. You'll need to change some local
155152
auth settings and change some configuration in your project to
@@ -226,8 +223,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
226223

227224
.. _config: https://github.com/googleapis/python-api-core/blob/master/noxfile.py
228225

229-
Python 2.7 support is deprecated. All code changes should maintain Python 2.7 compatibility until January 1, 2020.
230-
231226
We also explicitly decided to support Python 3 beginning with version
232227
3.5. Reasons for this include:
233228

README.rst

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,3 @@ common helpers used by all Google API clients. For more information, see the
1717
Supported Python Versions
1818
-------------------------
1919
Python >= 3.5
20-
21-
Deprecated Python Versions
22-
--------------------------
23-
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.

noxfile.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ def default(session):
7272
session.run(*pytest_args)
7373

7474

75-
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
75+
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
7676
def unit(session):
7777
"""Run the unit test suite."""
7878
default(session)
7979

8080

81-
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
81+
@nox.session(python=["3.5", "3.6", "3.7", "3.8"])
8282
def unit_grpc_gcp(session):
8383
"""Run the unit test suite with grpcio-gcp installed."""
8484

@@ -108,7 +108,6 @@ def lint_setup_py(session):
108108
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
109109

110110

111-
# No 2.7 due to https://github.com/google/importlab/issues/26.
112111
# No 3.7 because pytype supports up to 3.6 only.
113112
@nox.session(python="3.6")
114113
def pytype(session):

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@
7979
"Intended Audience :: Developers",
8080
"License :: OSI Approved :: Apache Software License",
8181
"Programming Language :: Python",
82-
"Programming Language :: Python :: 2",
83-
"Programming Language :: Python :: 2.7",
8482
"Programming Language :: Python :: 3",
8583
"Programming Language :: Python :: 3.5",
8684
"Programming Language :: Python :: 3.6",
8785
"Programming Language :: Python :: 3.7",
86+
"Programming Language :: Python :: 3.8",
87+
"Programming Language :: Python :: 3.9",
8888
"Operating System :: OS Independent",
8989
"Topic :: Internet",
9090
],
@@ -93,7 +93,7 @@
9393
namespace_packages=namespaces,
9494
install_requires=dependencies,
9595
extras_require=extras,
96-
python_requires=">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*",
96+
python_requires=">=3.5",
9797
include_package_data=True,
9898
zip_safe=False,
9999
)

0 commit comments

Comments
 (0)