Skip to content

Commit a3af780

Browse files
fix: require python 3.7+ (#414)
* chore(python): drop python 3.6 Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c * add api_description to .repo-metadata.json * require python 3.7+ in setup.py * remove python 3.6 sample configs * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * trigger CI Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Anthonios Partheniou <partheniou@google.com>
1 parent 6453107 commit a3af780

File tree

8 files changed

+91
-58
lines changed

8 files changed

+91
-58
lines changed

packages/google-cloud-python-speech/.repo-metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@
1313
"requires_billing": false,
1414
"default_version": "v1",
1515
"codeowner_team": "@googleapis/cdpe-cloudai",
16-
"api_shortname": "speech"
16+
"api_shortname": "speech",
17+
"api_description": "enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service."
1718
}

packages/google-cloud-python-speech/CONTRIBUTING.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

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

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

222222
We support:
223223

224-
- `Python 3.6`_
225224
- `Python 3.7`_
226225
- `Python 3.8`_
227226
- `Python 3.9`_
228227
- `Python 3.10`_
229228

230-
.. _Python 3.6: https://docs.python.org/3.6/
231229
.. _Python 3.7: https://docs.python.org/3.7/
232230
.. _Python 3.8: https://docs.python.org/3.8/
233231
.. _Python 3.9: https://docs.python.org/3.9/
@@ -239,7 +237,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
239237
.. _config: https://github.com/googleapis/python-speech/blob/main/noxfile.py
240238

241239

242-
We also explicitly decided to support Python 3 beginning with version 3.6.
240+
We also explicitly decided to support Python 3 beginning with version 3.7.
243241
Reasons for this include:
244242

245243
- Encouraging use of newest versions of Python 3

packages/google-cloud-python-speech/README.rst

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
11
Python Client for Cloud Speech API
22
==================================
33

4+
|stable| |pypi| |versions|
45

5-
|GA| |pypi| |versions|
6-
7-
The `Cloud Speech API`_ enables developers to convert audio to text by applying
8-
powerful neural network models. The API recognizes over 80 languages and
9-
variants, to support your global user base.
6+
`Cloud Speech API`_: enables easy integration of Google speech recognition technologies into developer applications. Send audio and receive a text transcription from the Speech-to-Text API service.
107

118
- `Client Library Documentation`_
129
- `Product Documentation`_
1310

14-
.. |GA| image:: https://img.shields.io/badge/support-GA-gold.svg
15-
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#general-availability
11+
.. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
12+
:target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
1613
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-speech.svg
1714
:target: https://pypi.org/project/google-cloud-speech/
1815
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-speech.svg
1916
:target: https://pypi.org/project/google-cloud-speech/
20-
.. _Cloud Speech API: https://cloud.google.com/speech
17+
.. _Cloud Speech API: https://cloud.google.com/speech-to-text/docs/
2118
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/speech/latest
22-
.. _Product Documentation: https://cloud.google.com/speech
19+
.. _Product Documentation: https://cloud.google.com/speech-to-text/docs/
2320

2421
Quick Start
2522
-----------
@@ -33,7 +30,7 @@ In order to use this library, you first need to go through the following steps:
3330

3431
.. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
3532
.. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
36-
.. _Enable the Cloud Speech API.: https://cloud.google.com/speech
33+
.. _Enable the Cloud Speech API.: https://cloud.google.com/speech-to-text/docs/
3734
.. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
3835

3936
Installation
@@ -50,13 +47,25 @@ dependencies.
5047
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
5148

5249

50+
Code samples and snippets
51+
~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
Code samples and snippets live in the `samples/` folder.
54+
55+
5356
Supported Python Versions
5457
^^^^^^^^^^^^^^^^^^^^^^^^^
55-
Python >= 3.5
58+
Our client libraries are compatible with all current [active](https://devguide.python.org/devcycle/#in-development-main-branch) and [maintenance](https://devguide.python.org/devcycle/#maintenance-branches) versions of
59+
Python.
5660

57-
Deprecated Python Versions
58-
^^^^^^^^^^^^^^^^^^^^^^^^^^
59-
Python == 2.7. Python 2.7 support will be removed on January 1, 2020.
61+
Python >= 3.7
62+
63+
Unsupported Python Versions
64+
^^^^^^^^^^^^^^^^^^^^^^^^^^^
65+
Python <= 3.6
66+
67+
If you are using an [end-of-life](https://devguide.python.org/devcycle/#end-of-life-branches)
68+
version of Python, we recommend that you update as soon as possible to an actively supported version.
6069

6170

6271
Mac/Linux
@@ -80,12 +89,15 @@ Windows
8089
<your-env>\Scripts\activate
8190
<your-env>\Scripts\pip.exe install google-cloud-speech
8291
83-
8492
Next Steps
8593
~~~~~~~~~~
8694

8795
- Read the `Client Library Documentation`_ for Cloud Speech API
88-
API to see other available methods on the client.
89-
- Read the `Product documentation`_ to learn
96+
to see other available methods on the client.
97+
- Read the `Cloud Speech API Product documentation`_ to learn
9098
more about the product and see How-to Guides.
99+
- View this `README`_ to see the full list of Cloud
91100
APIs that we cover.
101+
102+
.. _Cloud Speech API Product documentation: https://cloud.google.com/speech-to-text/docs/
103+
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst

packages/google-cloud-python-speech/noxfile.py

Lines changed: 54 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
DEFAULT_PYTHON_VERSION = "3.8"
3333

34-
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
34+
UNIT_TEST_PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
3535
UNIT_TEST_STANDARD_DEPENDENCIES = [
3636
"mock",
3737
"asyncmock",
@@ -331,28 +331,15 @@ def docfx(session):
331331
def prerelease_deps(session):
332332
"""Run all tests with prerelease versions of dependencies installed."""
333333

334-
prerel_deps = [
335-
"protobuf",
336-
"googleapis-common-protos",
337-
"google-auth",
338-
"grpcio",
339-
"grpcio-status",
340-
"google-api-core",
341-
"proto-plus",
342-
# dependencies of google-auth
343-
"cryptography",
344-
"pyasn1",
345-
]
346-
347-
for dep in prerel_deps:
348-
session.install("--pre", "--no-deps", "--upgrade", dep)
349-
350-
# Remaining dependencies
351-
other_deps = ["requests"]
352-
session.install(*other_deps)
353-
334+
# Install all dependencies
335+
session.install("-e", ".[all, tests, tracing]")
354336
session.install(*UNIT_TEST_STANDARD_DEPENDENCIES)
355-
session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES)
337+
system_deps_all = (
338+
SYSTEM_TEST_STANDARD_DEPENDENCIES
339+
+ SYSTEM_TEST_EXTERNAL_DEPENDENCIES
340+
+ SYSTEM_TEST_EXTRAS
341+
)
342+
session.install(*system_deps_all)
356343

357344
# Because we test minimum dependency versions on the minimum Python
358345
# version, the first version we test with in the unit tests sessions has a
@@ -366,19 +353,44 @@ def prerelease_deps(session):
366353
constraints_text = constraints_file.read()
367354

368355
# Ignore leading whitespace and comment lines.
369-
deps = [
356+
constraints_deps = [
370357
match.group(1)
371358
for match in re.finditer(
372359
r"^\s*(\S+)(?===\S+)", constraints_text, flags=re.MULTILINE
373360
)
374361
]
375362

376-
# Don't overwrite prerelease packages.
377-
deps = [dep for dep in deps if dep not in prerel_deps]
378-
# We use --no-deps to ensure that pre-release versions aren't overwritten
379-
# by the version ranges in setup.py.
380-
session.install(*deps)
381-
session.install("--no-deps", "-e", ".[all]")
363+
session.install(*constraints_deps)
364+
365+
if os.path.exists("samples/snippets/requirements.txt"):
366+
session.install("-r", "samples/snippets/requirements.txt")
367+
368+
if os.path.exists("samples/snippets/requirements-test.txt"):
369+
session.install("-r", "samples/snippets/requirements-test.txt")
370+
371+
prerel_deps = [
372+
"protobuf",
373+
# dependency of grpc
374+
"six",
375+
"googleapis-common-protos",
376+
"grpcio",
377+
"grpcio-status",
378+
"google-api-core",
379+
"proto-plus",
380+
"google-cloud-testutils",
381+
# dependencies of google-cloud-testutils"
382+
"click",
383+
]
384+
385+
for dep in prerel_deps:
386+
session.install("--pre", "--no-deps", "--upgrade", dep)
387+
388+
# Remaining dependencies
389+
other_deps = [
390+
"requests",
391+
"google-auth",
392+
]
393+
session.install(*other_deps)
382394

383395
# Print out prerelease package versions
384396
session.run(
@@ -387,5 +399,16 @@ def prerelease_deps(session):
387399
session.run("python", "-c", "import grpc; print(grpc.__version__)")
388400

389401
session.run("py.test", "tests/unit")
390-
session.run("py.test", "tests/system")
391-
session.run("py.test", "samples/snippets")
402+
403+
system_test_path = os.path.join("tests", "system.py")
404+
system_test_folder_path = os.path.join("tests", "system")
405+
406+
# Only run system tests if found.
407+
if os.path.exists(system_test_path) or os.path.exists(system_test_folder_path):
408+
session.run("py.test", "tests/system")
409+
410+
snippets_test_path = os.path.join("samples", "snippets")
411+
412+
# Only run samples tests if found.
413+
if os.path.exists(snippets_test_path):
414+
session.run("py.test", "samples/snippets")

packages/google-cloud-python-speech/samples/microphone/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# All versions used to test samples.
92-
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

packages/google-cloud-python-speech/samples/snippets/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:
8989

9090
# DO NOT EDIT - automatically generated.
9191
# All versions used to test samples.
92-
ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"]
92+
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10"]
9393

9494
# Any default versions that should be ignored.
9595
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]

packages/google-cloud-python-speech/scripts/readme-gen/templates/install_deps.tmpl.rst

Lines changed: 1 addition & 1 deletion
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

packages/google-cloud-python-speech/setup.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@
7676
"License :: OSI Approved :: Apache Software License",
7777
"Programming Language :: Python",
7878
"Programming Language :: Python :: 3",
79-
"Programming Language :: Python :: 3.6",
8079
"Programming Language :: Python :: 3.7",
8180
"Programming Language :: Python :: 3.8",
8281
"Programming Language :: Python :: 3.9",
@@ -89,7 +88,7 @@
8988
namespace_packages=namespaces,
9089
install_requires=dependencies,
9190
extras_require=extras,
92-
python_requires=">=3.6",
91+
python_requires=">=3.7",
9392
scripts=[
9493
"scripts/fixup_speech_v1_keywords.py",
9594
"scripts/fixup_speech_v1p1beta1_keywords.py",

0 commit comments

Comments
 (0)