diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..0ad1c7d2 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,22 @@ +on: + pull_request: + branches: + - v1 +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..bc3bfb53 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - v1 +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 00000000..76d739a7 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - v1 +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8'] + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Python + uses: actions/setup-python@v3 + with: + python-version: "3.8" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v3 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=78 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 63125c10..bee9b837 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Start the releasetool reporter @@ -28,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-texttospeech python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index 25ed0e04..47f03dd7 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,42 +23,18 @@ env_vars: { value: "github/python-texttospeech/.kokoro/release.sh" } -# Fetch the token needed for reporting release status to GitHub -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "yoshi-automation-github-key" - } - } -} - # Fetch PyPI password before_action { fetch_keystore { keystore_resource { keystore_config_id: 73713 - keyname: "google_cloud_pypi_password" + keyname: "google-cloud-pypi-token-keystore-1" } } } -# Fetch magictoken to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "releasetool-magictoken" - } - } -} - -# Fetch api key to use with Magic Github Proxy -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "magic-github-proxy-api-key" - } - } +# Tokens needed to report release status back to GitHub +env_vars: { + key: "SECRET_MANAGER_KEYS" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 64f4e406..6269f50e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ [1]: https://pypi.org/project/google-cloud-texttospeech/#history +### [1.0.2](https://github.com/googleapis/python-texttospeech/compare/v1.0.1...v1.0.2) (2022-03-31) + + +### Bug Fixes + +* **deps:** require google-api-core >= 1.31.5, >= 2.3.2 on v1 release ([#268](https://github.com/googleapis/python-texttospeech/issues/268)) ([8355750](https://github.com/googleapis/python-texttospeech/commit/8355750a271f36d41256a771d4e6ace0dc887c88)) + ### [1.0.1](https://www.github.com/googleapis/python-texttospeech/compare/v1.0.0...v1.0.1) (2020-02-28) diff --git a/docs/conf.py b/docs/conf.py index d98858fc..0abcb2c6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -65,9 +65,9 @@ master_doc = "index" # General information about the project. -project = u"google-cloud-texttospeech" -copyright = u"2019, Google" -author = u"Google APIs" +project = "google-cloud-texttospeech" +copyright = "2019, Google" +author = "Google APIs" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the @@ -261,7 +261,7 @@ ( master_doc, "google-cloud-texttospeech.tex", - u"google-cloud-texttospeech Documentation", + "google-cloud-texttospeech Documentation", author, "manual", ) @@ -296,7 +296,7 @@ ( master_doc, "google-cloud-texttospeech", - u"google-cloud-texttospeech Documentation", + "google-cloud-texttospeech Documentation", [author], 1, ) @@ -315,7 +315,7 @@ ( master_doc, "google-cloud-texttospeech", - u"google-cloud-texttospeech Documentation", + "google-cloud-texttospeech Documentation", author, "google-cloud-texttospeech", "google-cloud-texttospeech Library", diff --git a/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py b/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py index b1e7bfed..515d1558 100644 --- a/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py +++ b/google/cloud/texttospeech_v1/proto/cloud_tts_pb2_grpc.py @@ -7,15 +7,14 @@ class TextToSpeechStub(object): - """Service that implements Google Cloud Text-to-Speech API. - """ + """Service that implements Google Cloud Text-to-Speech API.""" def __init__(self, channel): """Constructor. - Args: - channel: A grpc.Channel. - """ + Args: + channel: A grpc.Channel. + """ self.ListVoices = channel.unary_unary( "/google.cloud.texttospeech.v1.TextToSpeech/ListVoices", request_serializer=google_dot_cloud_dot_texttospeech__v1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.SerializeToString, @@ -29,20 +28,18 @@ def __init__(self, channel): class TextToSpeechServicer(object): - """Service that implements Google Cloud Text-to-Speech API. - """ + """Service that implements Google Cloud Text-to-Speech API.""" def ListVoices(self, request, context): - """Returns a list of Voice supported for synthesis. - """ + """Returns a list of Voice supported for synthesis.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def SynthesizeSpeech(self, request, context): """Synthesizes speech synchronously: receive results after all text input - has been processed. - """ + has been processed. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") diff --git a/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py b/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py index a469e83d..018831dd 100644 --- a/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py +++ b/google/cloud/texttospeech_v1beta1/proto/cloud_tts_pb2_grpc.py @@ -7,15 +7,14 @@ class TextToSpeechStub(object): - """Service that implements Google Cloud Text-to-Speech API. - """ + """Service that implements Google Cloud Text-to-Speech API.""" def __init__(self, channel): """Constructor. - Args: - channel: A grpc.Channel. - """ + Args: + channel: A grpc.Channel. + """ self.ListVoices = channel.unary_unary( "/google.cloud.texttospeech.v1beta1.TextToSpeech/ListVoices", request_serializer=google_dot_cloud_dot_texttospeech__v1beta1_dot_proto_dot_cloud__tts__pb2.ListVoicesRequest.SerializeToString, @@ -29,20 +28,18 @@ def __init__(self, channel): class TextToSpeechServicer(object): - """Service that implements Google Cloud Text-to-Speech API. - """ + """Service that implements Google Cloud Text-to-Speech API.""" def ListVoices(self, request, context): - """Returns a list of Voice supported for synthesis. - """ + """Returns a list of Voice supported for synthesis.""" context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") def SynthesizeSpeech(self, request, context): """Synthesizes speech synchronously: receive results after all text input - has been processed. - """ + has been processed. + """ context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details("Method not implemented!") raise NotImplementedError("Method not implemented!") diff --git a/noxfile.py b/noxfile.py index ee2264a9..c7685700 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,14 +23,19 @@ import nox -BLACK_VERSION = "black==19.3b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] if os.path.exists("samples"): BLACK_PATHS.append("samples") +DEFAULT_PYTHON_VERSION = "3.8" -@nox.session(python="3.7") +# Error if a python version is missing +nox.options.error_on_missing_interpreters = True + + +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -42,7 +47,7 @@ def lint(session): session.run("flake8", "google", "tests") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): """Run black. @@ -56,7 +61,7 @@ def blacken(session): session.run("black", *BLACK_PATHS) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") @@ -121,7 +126,7 @@ def system(session): session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -134,12 +139,12 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") + session.install("sphinx<3.0.0", "alabaster", "recommonmark", "Jinja2<3.1") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/setup.py b/setup.py index fa759977..3ec6e149 100644 --- a/setup.py +++ b/setup.py @@ -35,13 +35,15 @@ name = "google-cloud-texttospeech" description = "Google Cloud Text-to-Speech API client library" -version = "1.0.1" +version = "1.0.2" # Should be one of: # 'Development Status :: 3 - Alpha' # 'Development Status :: 4 - Beta' # 'Development Status :: 5 - Production/Stable' release_status = "Development Status :: 5 - Production/Stable" -dependencies = ["google-api-core[grpc] >= 1.14.0, < 2.0.0dev"] +dependencies = [ + "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0" +] extras = {}