Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit 89682e9

Browse files
chore: update templates (#11)
* changes without context autosynth cannot find the source of changes triggered by earlier changes in this repository, or by version upgrades to tools such as linters. * chore(py-library): enable snippet-bot Co-authored-by: Benjamin E. Coe <bencoe@google.com> Source-Author: Takashi Matsuo <tmatsuo@google.com> Source-Date: Tue Sep 1 17:14:08 2020 +0000 Source-Repo: googleapis/synthtool Source-Sha: d91dd8aac77f7a9c5506c238038a26fa4f9e361e Source-Link: googleapis/synthtool@d91dd8a * chore(py-library): update decrypt secrets file * chore(py-library): update decrypt secrets file From https://github.com/GoogleCloudPlatform/python-docs-samples/blob/master/scripts/decrypt-secrets.sh * docs: explain conditional Co-authored-by: Jeffrey Rennie <rennie@google.com> Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Tue Sep 8 11:35:59 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: d302f93d7f47e2852e585ac35ab2d15585717ec0 Source-Link: googleapis/synthtool@d302f93 * chore(python-library): use sphinx 1.5.5 for the docfx job Originally tested at: googleapis/python-texttospeech#89 This change will fix the missing docstring in the yaml files. Source-Author: Takashi Matsuo <tmatsuo@google.com> Source-Date: Thu Sep 10 04:12:14 2020 +0000 Source-Repo: googleapis/synthtool Source-Sha: ffcee7952b74f647cbb3ef021d95422f10816fca Source-Link: googleapis/synthtool@ffcee79 * build(python): use release-publish app for notifying GitHub of releas… * build(python): use release-publish app for notifying GitHub of release status * fix: re-add pypi password Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Sep 16 08:46:42 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: 257fda18168bedb76985024bd198ed1725485488 Source-Link: googleapis/synthtool@257fda1 * build(python): add secret manager in kokoro Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Sep 16 10:24:40 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: dba48bb9bc6959c232bec9150ac6313b608fe7bd Source-Link: googleapis/synthtool@dba48bb * chore(python): add sphinx doctest extension Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Mon Sep 21 13:09:57 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: 27f4406999b1eee29e04b09b2423a8e4646c7e24 Source-Link: googleapis/synthtool@27f4406 * chore(python): remove note about editable installs `pip install -e .` is supported and is how we install the library for tests. Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Tue Sep 22 12:06:12 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: a651c5fb763c69a921aecdd3e1d8dc51dbf20f8d Source-Link: googleapis/synthtool@a651c5f * chore(python): use BUILD_SPECIFIC_GCLOUD_PROJECT for samples https://github.com/googleapis/python-talent/blob/ef045e8eb348db36d7a2a611e6f26b11530d273b/samples/snippets/noxfile_config.py#L27-L32 `BUILD_SPECIFIC_GCLOUD_PROJECT` is an alternate project used for sample tests that do poorly with concurrent runs on the same project. Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Source-Date: Wed Sep 30 13:06:03 2020 -0600 Source-Repo: googleapis/synthtool Source-Sha: 9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4 Source-Link: googleapis/synthtool@9b0da52
1 parent 845f1e3 commit 89682e9

File tree

14 files changed

+213
-88
lines changed

14 files changed

+213
-88
lines changed

.github/snippet-bot.yml

Whitespace-only changes.

.kokoro/populate-secrets.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
# Copyright 2020 Google LLC.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
set -eo pipefail
17+
18+
function now { date +"%Y-%m-%d %H:%M:%S" | tr -d '\n' ;}
19+
function msg { println "$*" >&2 ;}
20+
function println { printf '%s\n' "$(now) $*" ;}
21+
22+
23+
# Populates requested secrets set in SECRET_MANAGER_KEYS from service account:
24+
# kokoro-trampoline@cloud-devrel-kokoro-resources.iam.gserviceaccount.com
25+
SECRET_LOCATION="${KOKORO_GFILE_DIR}/secret_manager"
26+
msg "Creating folder on disk for secrets: ${SECRET_LOCATION}"
27+
mkdir -p ${SECRET_LOCATION}
28+
for key in $(echo ${SECRET_MANAGER_KEYS} | sed "s/,/ /g")
29+
do
30+
msg "Retrieving secret ${key}"
31+
docker run --entrypoint=gcloud \
32+
--volume=${KOKORO_GFILE_DIR}:${KOKORO_GFILE_DIR} \
33+
gcr.io/google.com/cloudsdktool/cloud-sdk \
34+
secrets versions access latest \
35+
--project cloud-devrel-kokoro-resources \
36+
--secret ${key} > \
37+
"${SECRET_LOCATION}/${key}"
38+
if [[ $? == 0 ]]; then
39+
msg "Secret written to ${SECRET_LOCATION}/${key}"
40+
else
41+
msg "Error retrieving secret ${key}"
42+
fi
43+
done

.kokoro/release/common.cfg

Lines changed: 13 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,18 @@ env_vars: {
2323
value: "github/python-video-transcoder/.kokoro/release.sh"
2424
}
2525

26-
# Fetch the token needed for reporting release status to GitHub
27-
before_action {
28-
fetch_keystore {
29-
keystore_resource {
30-
keystore_config_id: 73713
31-
keyname: "yoshi-automation-github-key"
32-
}
33-
}
34-
}
35-
36-
# Fetch PyPI password
37-
before_action {
38-
fetch_keystore {
39-
keystore_resource {
40-
keystore_config_id: 73713
41-
keyname: "google_cloud_pypi_password"
42-
}
43-
}
44-
}
45-
46-
# Fetch magictoken to use with Magic Github Proxy
47-
before_action {
48-
fetch_keystore {
49-
keystore_resource {
50-
keystore_config_id: 73713
51-
keyname: "releasetool-magictoken"
52-
}
53-
}
26+
# Fetch PyPI password
27+
before_action {
28+
fetch_keystore {
29+
keystore_resource {
30+
keystore_config_id: 73713
31+
keyname: "google_cloud_pypi_password"
32+
}
33+
}
5434
}
5535

56-
# Fetch api key to use with Magic Github Proxy
57-
before_action {
58-
fetch_keystore {
59-
keystore_resource {
60-
keystore_config_id: 73713
61-
keyname: "magic-github-proxy-api-key"
62-
}
63-
}
64-
}
36+
# Tokens needed to report release status back to GitHub
37+
env_vars: {
38+
key: "SECRET_MANAGER_KEYS"
39+
value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem"
40+
}

.kokoro/samples/python3.6/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.6"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py36"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-video-transcoder/.kokoro/test-samples.sh"

.kokoro/samples/python3.7/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.7"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py37"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-video-transcoder/.kokoro/test-samples.sh"

.kokoro/samples/python3.8/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ env_vars: {
1313
value: "py-3.8"
1414
}
1515

16+
# Declare build specific Cloud project.
17+
env_vars: {
18+
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
19+
value: "python-docs-samples-tests-py38"
20+
}
21+
1622
env_vars: {
1723
key: "TRAMPOLINE_BUILD_FILE"
1824
value: "github/python-video-transcoder/.kokoro/test-samples.sh"

.kokoro/trampoline.sh

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,14 @@
1515

1616
set -eo pipefail
1717

18-
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py" || ret_code=$?
18+
# Always run the cleanup script, regardless of the success of bouncing into
19+
# the container.
20+
function cleanup() {
21+
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
22+
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
23+
echo "cleanup";
24+
}
25+
trap cleanup EXIT
1926

20-
chmod +x ${KOKORO_GFILE_DIR}/trampoline_cleanup.sh
21-
${KOKORO_GFILE_DIR}/trampoline_cleanup.sh || true
22-
23-
exit ${ret_code}
27+
$(dirname $0)/populate-secrets.sh # Secret Manager secrets.
28+
python3 "${KOKORO_GFILE_DIR}/trampoline_v1.py"

CONTRIBUTING.rst

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -80,25 +80,6 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.
8080

8181
.. nox: https://pypi.org/project/nox/
8282
83-
Note on Editable Installs / Develop Mode
84-
========================================
85-
86-
- As mentioned previously, using ``setuptools`` in `develop mode`_
87-
or a ``pip`` `editable install`_ is not possible with this
88-
library. This is because this library uses `namespace packages`_.
89-
For context see `Issue #2316`_ and the relevant `PyPA issue`_.
90-
91-
Since ``editable`` / ``develop`` mode can't be used, packages
92-
need to be installed directly. Hence your changes to the source
93-
tree don't get incorporated into the **already installed**
94-
package.
95-
96-
.. _namespace packages: https://www.python.org/dev/peps/pep-0420/
97-
.. _Issue #2316: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/2316
98-
.. _PyPA issue: https://github.com/pypa/packaging-problems/issues/12
99-
.. _develop mode: https://setuptools.readthedocs.io/en/latest/setuptools.html#development-mode
100-
.. _editable install: https://pip.pypa.io/en/stable/reference/pip_install/#editable-installs
101-
10283
*****************************************
10384
I'm getting weird errors... Can you help?
10485
*****************************************

docs/conf.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
# -- General configuration ------------------------------------------------
3030

3131
# If your documentation needs a minimal Sphinx version, state it here.
32-
needs_sphinx = "1.6.3"
32+
needs_sphinx = "1.5.5"
3333

3434
# Add any Sphinx extension module names here, as strings. They can be
3535
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
@@ -39,6 +39,7 @@
3939
"sphinx.ext.autosummary",
4040
"sphinx.ext.intersphinx",
4141
"sphinx.ext.coverage",
42+
"sphinx.ext.doctest",
4243
"sphinx.ext.napoleon",
4344
"sphinx.ext.todo",
4445
"sphinx.ext.viewcode",

google/cloud/video/transcoder_v1beta1/services/transcoder_service/async_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ class TranscoderServiceAsyncClient:
5252
DEFAULT_ENDPOINT = TranscoderServiceClient.DEFAULT_ENDPOINT
5353
DEFAULT_MTLS_ENDPOINT = TranscoderServiceClient.DEFAULT_MTLS_ENDPOINT
5454

55-
job_path = staticmethod(TranscoderServiceClient.job_path)
56-
5755
job_template_path = staticmethod(TranscoderServiceClient.job_template_path)
5856

57+
job_path = staticmethod(TranscoderServiceClient.job_path)
58+
5959
from_service_account_file = TranscoderServiceClient.from_service_account_file
6060
from_service_account_json = from_service_account_file
6161

noxfile.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ def docfx(session):
173173
"""Build the docfx yaml files for this library."""
174174

175175
session.install("-e", ".")
176-
session.install("sphinx", "alabaster", "recommonmark", "sphinx-docfx-yaml")
176+
# sphinx-docfx-yaml supports up to sphinx version 1.5.5.
177+
# https://github.com/docascode/sphinx-docfx-yaml/issues/97
178+
session.install("sphinx==1.5.5", "alabaster", "recommonmark", "sphinx-docfx-yaml")
177179

178180
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
179181
session.run(

scripts/decrypt-secrets.sh

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,27 @@ ROOT=$( dirname "$DIR" )
2020
# Work from the project root.
2121
cd $ROOT
2222

23+
# Prevent it from overriding files.
24+
# We recommend that sample authors use their own service account files and cloud project.
25+
# In that case, they are supposed to prepare these files by themselves.
26+
if [[ -f "testing/test-env.sh" ]] || \
27+
[[ -f "testing/service-account.json" ]] || \
28+
[[ -f "testing/client-secrets.json" ]]; then
29+
echo "One or more target files exist, aborting."
30+
exit 1
31+
fi
32+
2333
# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources.
2434
PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}"
2535

2636
gcloud secrets versions access latest --secret="python-docs-samples-test-env" \
37+
--project="${PROJECT_ID}" \
2738
> testing/test-env.sh
2839
gcloud secrets versions access latest \
2940
--secret="python-docs-samples-service-account" \
41+
--project="${PROJECT_ID}" \
3042
> testing/service-account.json
3143
gcloud secrets versions access latest \
3244
--secret="python-docs-samples-client-secrets" \
33-
> testing/client-secrets.json
45+
--project="${PROJECT_ID}" \
46+
> testing/client-secrets.json

synth.metadata

Lines changed: 90 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
{
44
"git": {
55
"name": ".",
6-
"remote": "sso://devrel/cloud/libraries/python/python-video-transcoder",
7-
"sha": "d83d277c4513cf6c1caaf56ca3a6564cd5910c86"
6+
"remote": "https://github.com/googleapis/python-video-transcoder.git",
7+
"sha": "845f1e371cc45040c882b725e12375430260e45a"
88
}
99
},
1010
{
@@ -19,14 +19,14 @@
1919
"git": {
2020
"name": "synthtool",
2121
"remote": "https://github.com/googleapis/synthtool.git",
22-
"sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb"
22+
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
2323
}
2424
},
2525
{
2626
"git": {
2727
"name": "synthtool",
2828
"remote": "https://github.com/googleapis/synthtool.git",
29-
"sha": "05de3e1e14a0b07eab8b474e669164dbd31f81fb"
29+
"sha": "9b0da5204ab90bcc36f8cd4e5689eff1a54cc3e4"
3030
}
3131
}
3232
],
@@ -40,5 +40,91 @@
4040
"generator": "bazel"
4141
}
4242
}
43+
],
44+
"generatedFiles": [
45+
".flake8",
46+
".github/CONTRIBUTING.md",
47+
".github/ISSUE_TEMPLATE/bug_report.md",
48+
".github/ISSUE_TEMPLATE/feature_request.md",
49+
".github/ISSUE_TEMPLATE/support_request.md",
50+
".github/PULL_REQUEST_TEMPLATE.md",
51+
".github/release-please.yml",
52+
".github/snippet-bot.yml",
53+
".gitignore",
54+
".kokoro/build.sh",
55+
".kokoro/continuous/common.cfg",
56+
".kokoro/continuous/continuous.cfg",
57+
".kokoro/docker/docs/Dockerfile",
58+
".kokoro/docker/docs/fetch_gpg_keys.sh",
59+
".kokoro/docs/common.cfg",
60+
".kokoro/docs/docs-presubmit.cfg",
61+
".kokoro/docs/docs.cfg",
62+
".kokoro/populate-secrets.sh",
63+
".kokoro/presubmit/common.cfg",
64+
".kokoro/presubmit/presubmit.cfg",
65+
".kokoro/publish-docs.sh",
66+
".kokoro/release.sh",
67+
".kokoro/release/common.cfg",
68+
".kokoro/release/release.cfg",
69+
".kokoro/samples/lint/common.cfg",
70+
".kokoro/samples/lint/continuous.cfg",
71+
".kokoro/samples/lint/periodic.cfg",
72+
".kokoro/samples/lint/presubmit.cfg",
73+
".kokoro/samples/python3.6/common.cfg",
74+
".kokoro/samples/python3.6/continuous.cfg",
75+
".kokoro/samples/python3.6/periodic.cfg",
76+
".kokoro/samples/python3.6/presubmit.cfg",
77+
".kokoro/samples/python3.7/common.cfg",
78+
".kokoro/samples/python3.7/continuous.cfg",
79+
".kokoro/samples/python3.7/periodic.cfg",
80+
".kokoro/samples/python3.7/presubmit.cfg",
81+
".kokoro/samples/python3.8/common.cfg",
82+
".kokoro/samples/python3.8/continuous.cfg",
83+
".kokoro/samples/python3.8/periodic.cfg",
84+
".kokoro/samples/python3.8/presubmit.cfg",
85+
".kokoro/test-samples.sh",
86+
".kokoro/trampoline.sh",
87+
".kokoro/trampoline_v2.sh",
88+
".trampolinerc",
89+
"CODE_OF_CONDUCT.md",
90+
"CONTRIBUTING.rst",
91+
"LICENSE",
92+
"MANIFEST.in",
93+
"docs/_static/custom.css",
94+
"docs/_templates/layout.html",
95+
"docs/conf.py",
96+
"docs/multiprocessing.rst",
97+
"docs/transcoder_v1beta1/services.rst",
98+
"docs/transcoder_v1beta1/types.rst",
99+
"google/cloud/video/transcoder/__init__.py",
100+
"google/cloud/video/transcoder/py.typed",
101+
"google/cloud/video/transcoder_v1beta1/__init__.py",
102+
"google/cloud/video/transcoder_v1beta1/py.typed",
103+
"google/cloud/video/transcoder_v1beta1/services/__init__.py",
104+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/__init__.py",
105+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/async_client.py",
106+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/client.py",
107+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/pagers.py",
108+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/transports/__init__.py",
109+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/transports/base.py",
110+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/transports/grpc.py",
111+
"google/cloud/video/transcoder_v1beta1/services/transcoder_service/transports/grpc_asyncio.py",
112+
"google/cloud/video/transcoder_v1beta1/types/__init__.py",
113+
"google/cloud/video/transcoder_v1beta1/types/resources.py",
114+
"google/cloud/video/transcoder_v1beta1/types/services.py",
115+
"mypy.ini",
116+
"noxfile.py",
117+
"renovate.json",
118+
"scripts/decrypt-secrets.sh",
119+
"scripts/readme-gen/readme_gen.py",
120+
"scripts/readme-gen/templates/README.tmpl.rst",
121+
"scripts/readme-gen/templates/auth.tmpl.rst",
122+
"scripts/readme-gen/templates/auth_api_key.tmpl.rst",
123+
"scripts/readme-gen/templates/install_deps.tmpl.rst",
124+
"scripts/readme-gen/templates/install_portaudio.tmpl.rst",
125+
"setup.cfg",
126+
"testing/.gitignore",
127+
"tests/unit/gapic/transcoder_v1beta1/__init__.py",
128+
"tests/unit/gapic/transcoder_v1beta1/test_transcoder_service.py"
43129
]
44130
}

0 commit comments

Comments
 (0)