Skip to content
This repository has been archived by the owner on Nov 29, 2023. It is now read-only.

Commit

Permalink
chore: clean up dependencies and use constraints for testing (#110)
Browse files Browse the repository at this point in the history
This PR was generated using Autosynth. 🌈

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: googleapis/synthtool@86ed43d
Source-Link: googleapis/synthtool@f5c5904
  • Loading branch information
yoshi-automation committed Mar 23, 2021
1 parent dc07688 commit 3d6431c
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -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
6 changes: 3 additions & 3 deletions UPGRADING.md
Expand Up @@ -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
Expand Down Expand Up @@ -148,4 +148,4 @@ from google.cloud import texttospeech

encoding = texttospeech.AudioEncoding.MP3
voice = texttospeech.VoiceSelectionParams(language_code="en-US")
```
```
22 changes: 14 additions & 8 deletions noxfile.py
Expand Up @@ -18,6 +18,7 @@

from __future__ import absolute_import
import os
import pathlib
import shutil

import nox
Expand All @@ -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",
Expand Down Expand Up @@ -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(
Expand All @@ -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")

Expand All @@ -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:
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Expand Up @@ -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 = {}

Expand Down
9 changes: 4 additions & 5 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-texttospeech.git",
"sha": "139e6e8511cdce4c0be7983520f7efc47092f3b1"
"sha": "dc07688434edf0774a8b19d2c6250eddc942b60a"
}
},
{
Expand All @@ -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"
}
}
],
Expand Down Expand Up @@ -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"
]
}
3 changes: 1 addition & 2 deletions testing/constraints-3.6.txt
Expand Up @@ -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
Empty file removed texttospeech-v1beta1-py.tar.gz
Empty file.

0 comments on commit 3d6431c

Please sign in to comment.