From f6f655abfcc9b26cf32d0c2bc05e9e43767c2cc2 Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Tue, 23 Mar 2021 15:50:06 -0700 Subject: [PATCH] chore: clean up dependencies and use constraints for testing (#110) This PR was generated using Autosynth. :rainbow: Synth log will be available here: https://source.cloud.google.com/results/invocations/1165163b-aa83-4d55-9f5a-0495c58bd3bf/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) Source-Link: https://github.com/googleapis/synthtool/commit/86ed43d4f56e6404d068e62e497029018879c771 Source-Link: https://github.com/googleapis/synthtool/commit/f5c5904fb0c6aa3b3730eadf4e5a4485afc65726 --- .../.pre-commit-config.yaml | 2 +- .../google-cloud-texttospeech/UPGRADING.md | 6 ++--- packages/google-cloud-texttospeech/noxfile.py | 22 ++++++++++++------- packages/google-cloud-texttospeech/setup.py | 3 +-- .../google-cloud-texttospeech/synth.metadata | 9 ++++---- .../testing/constraints-3.6.txt | 3 +-- .../texttospeech-v1beta1-py.tar.gz | 0 7 files changed, 24 insertions(+), 21 deletions(-) delete mode 100644 packages/google-cloud-texttospeech/texttospeech-v1beta1-py.tar.gz diff --git a/packages/google-cloud-texttospeech/.pre-commit-config.yaml b/packages/google-cloud-texttospeech/.pre-commit-config.yaml index a9024b15d725..32302e4883a1 100644 --- a/packages/google-cloud-texttospeech/.pre-commit-config.yaml +++ b/packages/google-cloud-texttospeech/.pre-commit-config.yaml @@ -12,6 +12,6 @@ repos: hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.8.4 + rev: 3.9.0 hooks: - id: flake8 diff --git a/packages/google-cloud-texttospeech/UPGRADING.md b/packages/google-cloud-texttospeech/UPGRADING.md index c198bb82cdb4..f1450b1f23f2 100644 --- a/packages/google-cloud-texttospeech/UPGRADING.md +++ b/packages/google-cloud-texttospeech/UPGRADING.md @@ -17,10 +17,10 @@ The 2.0.0 release requires Python 3.6+. Methods expect request objects. We provide a script that will convert most common use cases. -* Install the library +* Install the library and `libcst`. ```py -python3 -m pip install google-cloud-texttospeech +python3 -m pip install google-cloud-texttospeech libcst ``` * The script `fixup_keywords.py` is shipped with the library. It expects @@ -148,4 +148,4 @@ from google.cloud import texttospeech encoding = texttospeech.AudioEncoding.MP3 voice = texttospeech.VoiceSelectionParams(language_code="en-US") -``` \ No newline at end of file +``` diff --git a/packages/google-cloud-texttospeech/noxfile.py b/packages/google-cloud-texttospeech/noxfile.py index 9249c5b97b3b..8e9b9413d302 100644 --- a/packages/google-cloud-texttospeech/noxfile.py +++ b/packages/google-cloud-texttospeech/noxfile.py @@ -18,6 +18,7 @@ from __future__ import absolute_import import os +import pathlib import shutil import nox @@ -30,6 +31,8 @@ SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"] +CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() + # 'docfx' is excluded since it only needs to run in 'docs-presubmit' nox.options.sessions = [ "unit", @@ -84,13 +87,15 @@ def lint_setup_py(session): def default(session): # Install all test dependencies, then install this package in-place. - session.install("asyncmock", "pytest-asyncio") - session.install( - "mock", "pytest", "pytest-cov", + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) + session.install("asyncmock", "pytest-asyncio", "-c", constraints_path) - session.install("-e", ".") + session.install("mock", "pytest", "pytest-cov", "-c", constraints_path) + + session.install("-e", ".", "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -117,6 +122,9 @@ def unit(session): @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" + constraints_path = str( + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" + ) system_test_path = os.path.join("tests", "system.py") system_test_folder_path = os.path.join("tests", "system") @@ -141,10 +149,8 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install( - "mock", "pytest", "google-cloud-testutils", - ) - session.install("-e", ".") + session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) + session.install("-e", ".", "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: diff --git a/packages/google-cloud-texttospeech/setup.py b/packages/google-cloud-texttospeech/setup.py index 80865ea76c87..2642ea6c2295 100644 --- a/packages/google-cloud-texttospeech/setup.py +++ b/packages/google-cloud-texttospeech/setup.py @@ -42,9 +42,8 @@ # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" dependencies = [ - "google-api-core[grpc] >= 1.22.0, < 2.0.0dev", + "google-api-core[grpc] >= 1.22.2, < 2.0.0dev", "proto-plus >= 1.4.0", - "libcst >= 0.2.5", ] extras = {} diff --git a/packages/google-cloud-texttospeech/synth.metadata b/packages/google-cloud-texttospeech/synth.metadata index d7f42a5a7297..f2456041247d 100644 --- a/packages/google-cloud-texttospeech/synth.metadata +++ b/packages/google-cloud-texttospeech/synth.metadata @@ -4,7 +4,7 @@ "git": { "name": ".", "remote": "https://github.com/googleapis/python-texttospeech.git", - "sha": "139e6e8511cdce4c0be7983520f7efc47092f3b1" + "sha": "dc07688434edf0774a8b19d2c6250eddc942b60a" } }, { @@ -19,14 +19,14 @@ "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "86ed43d4f56e6404d068e62e497029018879c771" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "79c8dd7ee768292f933012d3a69a5b4676404cda" + "sha": "86ed43d4f56e6404d068e62e497029018879c771" } } ], @@ -163,7 +163,6 @@ "tests/unit/gapic/texttospeech_v1/__init__.py", "tests/unit/gapic/texttospeech_v1/test_text_to_speech.py", "tests/unit/gapic/texttospeech_v1beta1/__init__.py", - "tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py", - "texttospeech-v1beta1-py.tar.gz" + "tests/unit/gapic/texttospeech_v1beta1/test_text_to_speech.py" ] } \ No newline at end of file diff --git a/packages/google-cloud-texttospeech/testing/constraints-3.6.txt b/packages/google-cloud-texttospeech/testing/constraints-3.6.txt index 2923be131cf5..a37a34aff5e9 100644 --- a/packages/google-cloud-texttospeech/testing/constraints-3.6.txt +++ b/packages/google-cloud-texttospeech/testing/constraints-3.6.txt @@ -5,6 +5,5 @@ # # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 -google-api-core==1.22.0 +google-api-core==1.22.2 proto-plus==1.4.0 -libcst==0.2.5 \ No newline at end of file diff --git a/packages/google-cloud-texttospeech/texttospeech-v1beta1-py.tar.gz b/packages/google-cloud-texttospeech/texttospeech-v1beta1-py.tar.gz deleted file mode 100644 index e69de29bb2d1..000000000000