From b358e8c6f8546f854a3986d0d7d1c593203ea881 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 13 Aug 2021 11:56:39 -0400 Subject: [PATCH] chore: drop mention of Python 2.7 from templates (#217) Source-Link: https://github.com/googleapis/synthtool/commit/facee4cc1ea096cd8bcc008bb85929daa7c414c0 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 Co-authored-by: Owl Bot --- .../google-cloud-vision/.github/.OwlBot.lock.yaml | 2 +- packages/google-cloud-vision/noxfile.py | 12 +++++++++--- .../samples/snippets/crop_hints/noxfile.py | 6 +++--- .../samples/snippets/detect/noxfile.py | 6 +++--- .../samples/snippets/document_text/noxfile.py | 6 +++--- .../samples/snippets/face_detection/noxfile.py | 6 +++--- .../samples/snippets/product_search/noxfile.py | 6 +++--- .../samples/snippets/quickstart/noxfile.py | 6 +++--- .../samples/snippets/web/noxfile.py | 6 +++--- .../readme-gen/templates/install_deps.tmpl.rst | 2 +- 10 files changed, 32 insertions(+), 26 deletions(-) diff --git a/packages/google-cloud-vision/.github/.OwlBot.lock.yaml b/packages/google-cloud-vision/.github/.OwlBot.lock.yaml index b771c37caef8..a9fcd07cc43b 100644 --- a/packages/google-cloud-vision/.github/.OwlBot.lock.yaml +++ b/packages/google-cloud-vision/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/repo-automation-bots/owlbot-python:latest - digest: sha256:a1a891041baa4ffbe1a809ac1b8b9b4a71887293c9101c88e8e255943c5aec2d + digest: sha256:9743664022bd63a8084be67f144898314c7ca12f0a03e422ac17c733c129d803 diff --git a/packages/google-cloud-vision/noxfile.py b/packages/google-cloud-vision/noxfile.py index 7d7db4efecec..710271bb33b1 100644 --- a/packages/google-cloud-vision/noxfile.py +++ b/packages/google-cloud-vision/noxfile.py @@ -84,9 +84,15 @@ def default(session): constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - - session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + session.install( + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", + "-c", + constraints_path, + ) session.install("-e", ".", "-c", constraints_path) diff --git a/packages/google-cloud-vision/samples/snippets/crop_hints/noxfile.py b/packages/google-cloud-vision/samples/snippets/crop_hints/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/crop_hints/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/crop_hints/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/detect/noxfile.py b/packages/google-cloud-vision/samples/snippets/detect/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/detect/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/detect/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/document_text/noxfile.py b/packages/google-cloud-vision/samples/snippets/document_text/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/document_text/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/document_text/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/face_detection/noxfile.py b/packages/google-cloud-vision/samples/snippets/face_detection/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/face_detection/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/face_detection/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/product_search/noxfile.py b/packages/google-cloud-vision/samples/snippets/product_search/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/product_search/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/product_search/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/quickstart/noxfile.py b/packages/google-cloud-vision/samples/snippets/quickstart/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/quickstart/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/quickstart/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/samples/snippets/web/noxfile.py b/packages/google-cloud-vision/samples/snippets/web/noxfile.py index 125bb619cc49..e73436a15626 100644 --- a/packages/google-cloud-vision/samples/snippets/web/noxfile.py +++ b/packages/google-cloud-vision/samples/snippets/web/noxfile.py @@ -39,7 +39,7 @@ TEST_CONFIG = { # You can opt out from the test for specific Python versions. - 'ignored_versions': ["2.7"], + 'ignored_versions': [], # Old samples are opted out of enforcing Python type hints # All new samples should feature them @@ -88,8 +88,8 @@ def get_pytest_env_vars() -> Dict[str, str]: # DO NOT EDIT - automatically generated. -# All versions used to tested samples. -ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"] +# All versions used to test samples. +ALL_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] # Any default versions that should be ignored. IGNORED_VERSIONS = TEST_CONFIG['ignored_versions'] diff --git a/packages/google-cloud-vision/scripts/readme-gen/templates/install_deps.tmpl.rst b/packages/google-cloud-vision/scripts/readme-gen/templates/install_deps.tmpl.rst index a0406dba8c84..275d649890d7 100644 --- a/packages/google-cloud-vision/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/packages/google-cloud-vision/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. +#. Create a virtualenv. Samples are compatible with Python 3.6+. .. code-block:: bash