Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit 4746c9f

Browse files
chore(python): drop python 3.6 (#420)
Source-Link: googleapis/synthtool@4f89b13 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: nicain <nicholascain@google.com>
1 parent 406e84d commit 4746c9f

File tree

7 files changed

+92
-50
lines changed

7 files changed

+92
-50
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
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:a5d81b61dfd1a432d3c03f51a25d2e71b37be24da509966d50724aea7c57c5c2
17-
# created: 2022-07-04T12:33:08.125873124Z
16+
digest: sha256:e7bb19d47c13839fe8c147e50e02e8b6cf5da8edd1af8b82208cd6f66cc2829c
17+
# created: 2022-07-05T18:31:20.838186805Z

.github/workflows/unittest.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
runs-on: ubuntu-latest
99
strategy:
1010
matrix:
11-
python: ['3.6', '3.7', '3.8', '3.9', '3.10']
11+
python: ['3.7', '3.8', '3.9', '3.10']
1212
steps:
1313
- name: Checkout
1414
uses: actions/checkout@v3

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-dialogflow-cx/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

README.rst

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
Python Client for Dialogflow CX API
2-
=================================================
2+
===================================
33

4-
|GA| |pypi| |versions|
4+
|stable| |pypi| |versions|
55

6-
`Dialogflow CX API`_: Builds conversational interfaces (for example, chatbots, and voice-powered apps and devices).
6+
`Dialogflow CX API`_:
77

88
- `Client Library Documentation`_
99
- `Product Documentation`_
1010

11-
.. |GA| image:: https://img.shields.io/badge/support-ga-gold.svg
12-
: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
1313
.. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-dialogflow-cx.svg
1414
:target: https://pypi.org/project/google-cloud-dialogflow-cx/
1515
.. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-dialogflow-cx.svg
1616
:target: https://pypi.org/project/google-cloud-dialogflow-cx/
1717
.. _Dialogflow CX API: https://cloud.google.com/dialogflow/cx/docs
18-
.. _Client Library Documentation: https://googleapis.dev/python/dialogflow-cx/latest
18+
.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/dialogflow/latest
1919
.. _Product Documentation: https://cloud.google.com/dialogflow/cx/docs
2020

2121
Quick Start
@@ -47,6 +47,27 @@ dependencies.
4747
.. _`virtualenv`: https://virtualenv.pypa.io/en/latest/
4848

4949

50+
Code samples and snippets
51+
~~~~~~~~~~~~~~~~~~~~~~~~~
52+
53+
Code samples and snippets live in the `samples/` folder.
54+
55+
56+
Supported Python Versions
57+
^^^^^^^^^^^^^^^^^^^^^^^^^
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.
60+
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.
69+
70+
5071
Mac/Linux
5172
^^^^^^^^^
5273

@@ -71,12 +92,12 @@ Windows
7192
Next Steps
7293
~~~~~~~~~~
7394

74-
- Read the `Client Library Documentation`_ for Cloud Dialogflow CX API
75-
API to see other available methods on the client.
95+
- Read the `Client Library Documentation`_ for Dialogflow CX API
96+
to see other available methods on the client.
7697
- Read the `Dialogflow CX API Product documentation`_ to learn
7798
more about the product and see How-to Guides.
7899
- View this `README`_ to see the full list of Cloud
79100
APIs that we cover.
80101

81-
.. _Dialogflow CX API Product documentation: https://cloud.google.com/dialogflow/cx/docs
82-
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
102+
.. _Dialogflow CX API Product documentation: https://cloud.google.com/dialogflow/cx/docs
103+
.. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst

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",
@@ -330,28 +330,15 @@ def docfx(session):
330330
def prerelease_deps(session):
331331
"""Run all tests with prerelease versions of dependencies installed."""
332332

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

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

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

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

382394
# Print out prerelease package versions
383395
session.run(
@@ -386,5 +398,16 @@ def prerelease_deps(session):
386398
session.run("python", "-c", "import grpc; print(grpc.__version__)")
387399

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

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"]

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

0 commit comments

Comments
 (0)