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

Commit 3bed0b4

Browse files
feat(v1p1beta1): support Model Adaptation (#104)
feat: add from_service_account_info factory docs: fix sphinx identifiers test: add 3.9 unit tests
1 parent 120b3a1 commit 3bed0b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+8890
-776
lines changed

.coveragerc

+1-18
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,3 @@
1-
# -*- coding: utf-8 -*-
2-
#
3-
# Copyright 2020 Google LLC
4-
#
5-
# Licensed under the Apache License, Version 2.0 (the "License");
6-
# you may not use this file except in compliance with the License.
7-
# You may obtain a copy of the License at
8-
#
9-
# https://www.apache.org/licenses/LICENSE-2.0
10-
#
11-
# Unless required by applicable law or agreed to in writing, software
12-
# distributed under the License is distributed on an "AS IS" BASIS,
13-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14-
# See the License for the specific language governing permissions and
15-
# limitations under the License.
16-
17-
# Generated by synthtool. DO NOT EDIT!
181
[run]
192
branch = True
203

@@ -32,4 +15,4 @@ exclude_lines =
3215
# This is added at the module level as a safeguard for if someone
3316
# generates the code and tries to run it without pip installing. This
3417
# makes it virtually impossible to test properly.
35-
except pkg_resources.DistributionNotFound
18+
except pkg_resources.DistributionNotFound

.github/header-checker-lint.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{"allowedCopyrightHolders": ["Google LLC"],
2+
"allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"],
3+
"ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"],
4+
"sourceFileExtensions": [
5+
"ts",
6+
"js",
7+
"java",
8+
"sh",
9+
"Dockerfile",
10+
"yaml",
11+
"py",
12+
"html",
13+
"txt"
14+
]
15+
}

.gitignore

+3-1
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ docs.metadata
5050

5151
# Virtual environment
5252
env/
53+
54+
# Test logs
5355
coverage.xml
54-
sponge_log.xml
56+
*sponge_log.xml
5557

5658
# System test environment variables.
5759
system_tests/local_test_setup

.kokoro/build.sh

+20-6
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
set -eo pipefail
1717

18-
cd github/python-speech
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/python-speech"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
1923

2024
# Disable buffering, so that the logs stream through.
2125
export PYTHONUNBUFFERED=1
@@ -30,16 +34,26 @@ export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
3034
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
3135

3236
# Remove old nox
33-
python3.6 -m pip uninstall --yes --quiet nox-automation
37+
python3 -m pip uninstall --yes --quiet nox-automation
3438

3539
# Install nox
36-
python3.6 -m pip install --upgrade --quiet nox
37-
python3.6 -m nox --version
40+
python3 -m pip install --upgrade --quiet nox
41+
python3 -m nox --version
42+
43+
# If this is a continuous build, send the test log to the FlakyBot.
44+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
45+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"continuous"* ]]; then
46+
cleanup() {
47+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
48+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
49+
}
50+
trap cleanup EXIT HUP
51+
fi
3852

3953
# If NOX_SESSION is set, it only runs the specified session,
4054
# otherwise run all the sessions.
4155
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
56+
python3 -m nox -s ${NOX_SESSION:-}
4357
else
44-
python3.6 -m nox
58+
python3 -m nox
4559
fi

.kokoro/docs/docs-presubmit.cfg

+11
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,14 @@ env_vars: {
1515
key: "TRAMPOLINE_IMAGE_UPLOAD"
1616
value: "false"
1717
}
18+
19+
env_vars: {
20+
key: "TRAMPOLINE_BUILD_FILE"
21+
value: "github/python-speech/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}

.trampolinerc

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ required_envvars+=(
2424
pass_down_envvars+=(
2525
"STAGING_BUCKET"
2626
"V2_STAGING_BUCKET"
27+
"NOX_SESSION"
2728
)
2829

2930
# Prevent unintentional override on the default image.

CONTRIBUTING.rst

+18-4
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,14 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
7070
- To test your changes, run unit tests with ``nox``::
7171

7272
$ nox -s unit-2.7
73-
$ nox -s unit-3.7
73+
$ nox -s unit-3.8
7474
$ ...
7575

76+
- Args to pytest can be passed through the nox command separated by a `--`. For
77+
example, to run a single test::
78+
79+
$ nox -s unit-3.8 -- -k <name of test>
80+
7681
.. note::
7782

7883
The unit tests and system tests are described in the
@@ -93,8 +98,12 @@ On Debian/Ubuntu::
9398
************
9499
Coding Style
95100
************
101+
- We use the automatic code formatter ``black``. You can run it using
102+
the nox session ``blacken``. This will eliminate many lint errors. Run via::
103+
104+
$ nox -s blacken
96105

97-
- PEP8 compliance, with exceptions defined in the linter configuration.
106+
- PEP8 compliance is required, with exceptions defined in the linter configuration.
98107
If you have ``nox`` installed, you can test that you have not introduced
99108
any non-compliant code via::
100109

@@ -133,13 +142,18 @@ Running System Tests
133142

134143
- To run system tests, you can execute::
135144

136-
$ nox -s system-3.7
145+
# Run all system tests
146+
$ nox -s system-3.8
137147
$ nox -s system-2.7
138148

149+
# Run a single system test
150+
$ nox -s system-3.8 -- -k <name of test>
151+
152+
139153
.. note::
140154

141155
System tests are only configured to run under Python 2.7 and
142-
Python 3.7. For expediency, we do not run them in older versions
156+
Python 3.8. For expediency, we do not run them in older versions
143157
of Python 3.
144158

145159
This alone will not run the tests. You'll need to change some local

LICENSE

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Apache License
1+
2+
Apache License
23
Version 2.0, January 2004
3-
https://www.apache.org/licenses/
4+
http://www.apache.org/licenses/
45

56
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
67

@@ -192,7 +193,7 @@
192193
you may not use this file except in compliance with the License.
193194
You may obtain a copy of the License at
194195

195-
https://www.apache.org/licenses/LICENSE-2.0
196+
http://www.apache.org/licenses/LICENSE-2.0
196197

197198
Unless required by applicable law or agreed to in writing, software
198199
distributed under the License is distributed on an "AS IS" BASIS,

MANIFEST.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@
1616

1717
# Generated by synthtool. DO NOT EDIT!
1818
include README.rst LICENSE
19-
recursive-include google *.json *.proto
19+
recursive-include google *.json *.proto py.typed
2020
recursive-include tests *
2121
global-exclude *.py[co]
2222
global-exclude __pycache__
2323

2424
# Exclude scripts for samples readmegen
25-
prune scripts/readme-gen
25+
prune scripts/readme-gen

docs/_static/custom.css

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
div#python2-eol {
22
border-color: red;
33
border-width: medium;
4-
}
4+
}
5+
6+
/* Ensure minimum width for 'Parameters' / 'Returns' column */
7+
dl.field-list > dt {
8+
min-width: 100px
9+
}

docs/speech_v1/services.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Services for Google Cloud Speech v1 API
22
=======================================
3+
.. toctree::
4+
:maxdepth: 2
35

4-
.. automodule:: google.cloud.speech_v1.services.speech
5-
:members:
6-
:inherited-members:
6+
speech

docs/speech_v1/speech.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Speech
2+
------------------------
3+
4+
.. automodule:: google.cloud.speech_v1.services.speech
5+
:members:
6+
:inherited-members:

docs/speech_v1/types.rst

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Types for Google Cloud Speech v1 API
33

44
.. automodule:: google.cloud.speech_v1.types
55
:members:
6+
:undoc-members:
67
:show-inheritance:

docs/speech_v1p1beta1/adaptation.rst

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Adaptation
2+
----------------------------
3+
4+
.. automodule:: google.cloud.speech_v1p1beta1.services.adaptation
5+
:members:
6+
:inherited-members:
7+
8+
9+
.. automodule:: google.cloud.speech_v1p1beta1.services.adaptation.pagers
10+
:members:
11+
:inherited-members:

docs/speech_v1p1beta1/services.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
Services for Google Cloud Speech v1p1beta1 API
22
==============================================
3+
.. toctree::
4+
:maxdepth: 2
35

4-
.. automodule:: google.cloud.speech_v1p1beta1.services.speech
5-
:members:
6-
:inherited-members:
6+
adaptation
7+
speech

docs/speech_v1p1beta1/speech.rst

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Speech
2+
------------------------
3+
4+
.. automodule:: google.cloud.speech_v1p1beta1.services.speech
5+
:members:
6+
:inherited-members:

docs/speech_v1p1beta1/types.rst

+1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ Types for Google Cloud Speech v1p1beta1 API
33

44
.. automodule:: google.cloud.speech_v1p1beta1.types
55
:members:
6+
:undoc-members:
67
:show-inheritance:

0 commit comments

Comments
 (0)