Skip to content

Commit 7ddb8c0

Browse files
fix: require python 3.7+ (googleapis#410)
* chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * require python 3.7+ in setup.py * remove python 3.6 sample configs * exclude templated README * remove python 3.6 from noxfile * remove python 3.6 from remaining files * remove testing/constraints-3.6.txt Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 5b5e775 commit 7ddb8c0

21 files changed

+39
-124
lines changed

.github/.OwlBot.lock.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32
17-
# created: 2022-05-05T22:08:23.383410683Z
16+
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
17+
# created: 2022-07-05T18:31:20.838186805Z

.github/sync-repo-settings.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,10 @@ branchProtectionRules:
1111
# No Kokoro: the following are Github actions
1212
- 'lint'
1313
- 'mypy'
14-
- 'unit-3.6'
1514
- 'unit-3.7'
1615
- 'unit-3.8'
1716
- 'unit-3.9'
1817
- 'unit-3.10'
19-
- 'unit_wo_grpc-3.6'
2018
- 'unit_wo_grpc-3.10'
2119
- 'cover'
2220
- 'docs'

.github/workflows/unittest.yml

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ jobs:
1313
matrix:
1414
option: ["", "_wo_grpc"]
1515
python:
16-
- "3.6"
1716
- "3.7"
1817
- "3.8"
1918
- "3.9"
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps"
7+
}

.kokoro/presubmit/prerelease-deps.cfg

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
# Only run this nox session.
4+
env_vars: {
5+
key: "NOX_SESSION"
6+
value: "prerelease_deps"
7+
}

.kokoro/samples/python3.6/common.cfg

-40
This file was deleted.

.kokoro/samples/python3.6/continuous.cfg

-7
This file was deleted.

.kokoro/samples/python3.6/periodic-head.cfg

-11
This file was deleted.

.kokoro/samples/python3.6/periodic.cfg

-6
This file was deleted.

.kokoro/samples/python3.6/presubmit.cfg

-6
This file was deleted.

.kokoro/test-samples-impl.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export PYTHONUNBUFFERED=1
3333
env | grep KOKORO
3434

3535
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
36+
python3.9 -m pip install --upgrade --quiet nox
3737

3838
# Use secrets acessor service account to get secrets
3939
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
@@ -76,7 +76,7 @@ for file in samples/**/requirements.txt; do
7676
echo "------------------------------------------------------------"
7777

7878
# Use nox to execute the tests for the project.
79-
python3.6 -m nox -s "$RUN_TESTS_SESSION"
79+
python3.9 -m nox -s "$RUN_TESTS_SESSION"
8080
EXIT=$?
8181

8282
# If this is a periodic build, send the test log to the FlakyBot.

CONTRIBUTING.rst

+1-15
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ In order to add a feature:
2121
documentation.
2222

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

2626
- The feature must not add unnecessary dependencies (where
2727
"unnecessary" is of course subjective, but new dependencies should
@@ -197,13 +197,11 @@ Supported Python Versions
197197

198198
We support:
199199

200-
- `Python 3.6`_
201200
- `Python 3.7`_
202201
- `Python 3.8`_
203202
- `Python 3.9`_
204203
- `Python 3.10`_
205204

206-
.. _Python 3.6: https://docs.python.org/3.6/
207205
.. _Python 3.7: https://docs.python.org/3.7/
208206
.. _Python 3.8: https://docs.python.org/3.8/
209207
.. _Python 3.9: https://docs.python.org/3.9/
@@ -215,18 +213,6 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
215213
.. _config: https://github.com/googleapis/python-api-core/blob/main/noxfile.py
216214

217215

218-
We also explicitly decided to support Python 3 beginning with version 3.6.
219-
Reasons for this include:
220-
221-
- Encouraging use of newest versions of Python 3
222-
- Taking the lead of `prominent`_ open-source `projects`_
223-
- `Unicode literal support`_ which allows for a cleaner codebase that
224-
works in both Python 2 and Python 3
225-
226-
.. _prominent: https://docs.djangoproject.com/en/1.9/faq/install/#what-python-version-can-i-use-with-django
227-
.. _projects: http://flask.pocoo.org/docs/0.10/python3/
228-
.. _Unicode literal support: https://www.python.org/dev/peps/pep-0414/
229-
230216
**********
231217
Versioning
232218
**********

README.rst

+5-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,16 @@ common helpers used by all Google API clients. For more information, see the
1616

1717
Supported Python Versions
1818
-------------------------
19-
Python >= 3.6
19+
Python >= 3.7
2020

2121

2222
Unsupported Python Versions
2323
---------------------------
2424

25-
Python == 2.7, Python == 3.5.
25+
Python == 2.7, Python == 3.5, Python == 3.6.
2626

2727
The last version of this library compatible with Python 2.7 and 3.5 is
2828
`google-api-core==1.31.1`.
29+
30+
The last version of this library compatible with Python 3.6 is
31+
`google-api-core==2.8.2`.

google/api_core/grpc_helpers_async.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""AsyncIO helpers for :mod:`grpc` supporting 3.6+.
15+
"""AsyncIO helpers for :mod:`grpc` supporting 3.7+.
1616
1717
Please combine more detailed docstring in grpc_helpers.py to use following
1818
functions. This module is implementing the same surface with AsyncIO semantics.

mypy.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[mypy]
2-
python_version = 3.6
2+
python_version = 3.7
33
namespace_packages = True
44
ignore_missing_imports = True

noxfile.py

+9-10
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@
4343
]
4444

4545

46-
def _greater_or_equal_than_36(version_string):
46+
def _greater_or_equal_than_37(version_string):
4747
tokens = version_string.split(".")
4848
for i, token in enumerate(tokens):
4949
try:
5050
tokens[i] = int(token)
5151
except ValueError:
5252
pass
53-
return tokens >= [3, 6]
53+
return tokens >= [3, 7]
5454

5555

5656
@nox.session(python=DEFAULT_PYTHON_VERSION)
@@ -122,9 +122,9 @@ def default(session, install_grpc=True):
122122
),
123123
]
124124

125-
# Inject AsyncIO content and proto-plus, if version >= 3.6.
125+
# Inject AsyncIO content and proto-plus, if version >= 3.7.
126126
# proto-plus is needed for a field mask test in test_protobuf_helpers.py
127-
if _greater_or_equal_than_36(session.python):
127+
if _greater_or_equal_than_37(session.python):
128128
session.install("asyncmock", "pytest-asyncio", "proto-plus")
129129

130130
# Having positional arguments means the user wants to run specific tests.
@@ -136,28 +136,27 @@ def default(session, install_grpc=True):
136136
session.run(*pytest_args)
137137

138138

139-
@nox.session(python=["3.6", "3.7", "3.8", "3.9", "3.10"])
139+
@nox.session(python=["3.7", "3.8", "3.9", "3.10"])
140140
def unit(session):
141141
"""Run the unit test suite."""
142142
default(session)
143143

144144

145-
@nox.session(python=["3.6", "3.10"])
145+
@nox.session(python=["3.8", "3.10"])
146146
def unit_wo_grpc(session):
147147
"""Run the unit test suite w/o grpcio installed"""
148148
default(session, install_grpc=False)
149149

150150

151-
@nox.session(python="3.6")
151+
@nox.session(python="3.8")
152152
def lint_setup_py(session):
153153
"""Verify that setup.py is valid (including RST check)."""
154154

155155
session.install("docutils", "Pygments")
156156
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")
157157

158158

159-
# No 3.7 because pytype supports up to 3.6 only.
160-
@nox.session(python="3.6")
159+
@nox.session(python="3.8")
161160
def pytype(session):
162161
"""Run type-checking."""
163162
session.install(".[grpc]", "pytype >= 2019.3.21")
@@ -178,7 +177,7 @@ def mypy(session):
178177
session.run("mypy", "google", "tests")
179178

180179

181-
@nox.session(python="3.6")
180+
@nox.session(python="3.8")
182181
def cover(session):
183182
"""Run the final coverage report.
184183

owlbot.py

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
".coveragerc", # layout
3131
"CONTRIBUTING.rst", # no systests
3232
".github/workflows/unittest.yml", # exclude unittest gh action
33+
"README.rst",
3334
]
3435
templated_files = common.py_library(microgenerator=True, cov_level=100)
3536
s.move(templated_files, excludes=excludes)

scripts/readme-gen/templates/install_deps.tmpl.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Install Dependencies
1212
.. _Python Development Environment Setup Guide:
1313
https://cloud.google.com/python/setup
1414

15-
#. Create a virtualenv. Samples are compatible with Python 3.6+.
15+
#. Create a virtualenv. Samples are compatible with Python 3.7+.
1616

1717
.. code-block:: bash
1818

setup.cfg

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytype]
2-
python_version = 3.6
2+
python_version = 3.7
33
inputs =
44
google/
55
exclude =

setup.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@
8080
"License :: OSI Approved :: Apache Software License",
8181
"Programming Language :: Python",
8282
"Programming Language :: Python :: 3",
83-
"Programming Language :: Python :: 3.6",
8483
"Programming Language :: Python :: 3.7",
8584
"Programming Language :: Python :: 3.8",
8685
"Programming Language :: Python :: 3.9",
@@ -93,7 +92,7 @@
9392
namespace_packages=namespaces,
9493
install_requires=dependencies,
9594
extras_require=extras,
96-
python_requires=">=3.6",
95+
python_requires=">=3.7",
9796
include_package_data=True,
9897
zip_safe=False,
9998
)

testing/constraints-3.6.txt

-14
This file was deleted.

0 commit comments

Comments
 (0)