Skip to content

Commit bc24d3d

Browse files
ci: use python 3.8 in docs build (#1302)
* ci: use python 3.8 in docs build * add files required for docs build * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * update docs link * remove docfx session from publish-docs.sh Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 23f5e0e commit bc24d3d

File tree

8 files changed

+82
-28
lines changed

8 files changed

+82
-28
lines changed

packages/gapic-generator/.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
- name: Set up Python
2323
uses: actions/setup-python@v3
2424
with:
25-
python-version: "3.9"
25+
python-version: "3.8"
2626
cache: 'pip'
2727
- name: Install nox.
2828
run: python -m pip install nox

packages/gapic-generator/.kokoro/docs/docs-presubmit.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ env_vars: {
2424
# Only run this nox session.
2525
env_vars: {
2626
key: "NOX_SESSION"
27-
value: "docs docfx"
27+
value: "docs"
2828
}

packages/gapic-generator/.kokoro/publish-docs.sh

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -43,22 +43,3 @@ cat docs.metadata
4343

4444
# upload docs
4545
python3 -m docuploader upload docs/_build/html --metadata-file docs.metadata --staging-bucket "${STAGING_BUCKET}"
46-
47-
48-
# docfx yaml files
49-
nox -s docfx
50-
51-
# create metadata.
52-
python3 -m docuploader create-metadata \
53-
--name=$(jq --raw-output '.name // empty' .repo-metadata.json) \
54-
--version=$(python3 setup.py --version) \
55-
--language=$(jq --raw-output '.language // empty' .repo-metadata.json) \
56-
--distribution-name=$(python3 setup.py --name) \
57-
--product-page=$(jq --raw-output '.product_documentation // empty' .repo-metadata.json) \
58-
--github-repository=$(jq --raw-output '.repo // empty' .repo-metadata.json) \
59-
--issue-tracker=$(jq --raw-output '.issue_tracker // empty' .repo-metadata.json)
60-
61-
cat docs.metadata
62-
63-
# upload docs
64-
python3 -m docuploader upload docs/_build/html/docfx_yaml --metadata-file docs.metadata --destination-prefix docfx --staging-bucket "${V2_STAGING_BUCKET}"

packages/gapic-generator/.repo-metadata.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
2-
"name": "gapic-generator-python",
2+
"name": "gapic-generator",
33
"name_pretty": "Google API Client Generator for Python",
44
"client_documentation": "https://gapic-generator-python.readthedocs.io/en/stable/",
5+
"product_documentation": "",
56
"issue_tracker": "https://github.com/googleapis/gapic-generator-python/issues",
67
"release_level": "preview",
78
"language": "python",
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright 2020 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Template for .trampolinerc
16+
17+
# Add required env vars here.
18+
required_envvars+=(
19+
)
20+
21+
# Add env vars which are passed down into the container here.
22+
pass_down_envvars+=(
23+
"NOX_SESSION"
24+
###############
25+
# Docs builds
26+
###############
27+
"STAGING_BUCKET"
28+
"V2_STAGING_BUCKET"
29+
##################
30+
# Samples builds
31+
##################
32+
"INSTALL_LIBRARY_FROM_SOURCE"
33+
"RUN_TESTS_SESSION"
34+
"BUILD_SPECIFIC_GCLOUD_PROJECT"
35+
# Target directories.
36+
"RUN_TESTS_DIRS"
37+
# The nox session to run.
38+
"RUN_TESTS_SESSION"
39+
)
40+
41+
# Prevent unintentional override on the default image.
42+
if [[ "${TRAMPOLINE_IMAGE_UPLOAD:-false}" == "true" ]] && \
43+
[[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then
44+
echo "Please set TRAMPOLINE_IMAGE if you want to upload the Docker image."
45+
exit 1
46+
fi
47+
48+
# Define the default value if it makes sense.
49+
if [[ -z "${TRAMPOLINE_IMAGE_UPLOAD:-}" ]]; then
50+
TRAMPOLINE_IMAGE_UPLOAD=""
51+
fi
52+
53+
if [[ -z "${TRAMPOLINE_IMAGE:-}" ]]; then
54+
TRAMPOLINE_IMAGE=""
55+
fi
56+
57+
if [[ -z "${TRAMPOLINE_DOCKERFILE:-}" ]]; then
58+
TRAMPOLINE_DOCKERFILE=""
59+
fi
60+
61+
if [[ -z "${TRAMPOLINE_BUILD_FILE:-}" ]]; then
62+
TRAMPOLINE_BUILD_FILE=""
63+
fi

packages/gapic-generator/README.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,9 @@ regarding:
2424
Documentation
2525
-------------
2626

27-
`Documentation`_ is available on Read the Docs.
27+
See the `documentation`_.
2828

29-
.. _documentation: https://gapic-generator-python.readthedocs.io/
29+
.. _documentation: https://googleapis.dev/python/gapic-generator-python/latest
3030

3131
.. |release level| image:: https://img.shields.io/badge/release%20level-beta-yellow.svg?style&#x3D;flat
3232
:target: https://cloud.google.com/terms/launch-stages
33-
.. |docs| image:: https://readthedocs.org/projects/gapic-generator-python/badge/?version=latest
34-
:target: https://gapic-generator-python.readthedocs.io/

packages/gapic-generator/noxfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ def snippetgen(session):
422422
session.run("py.test", "-vv", "tests/snippetgen")
423423

424424

425-
@nox.session(python="3.9")
425+
@nox.session(python="3.8")
426426
def docs(session):
427427
"""Build the docs."""
428428

packages/gapic-generator/owlbot.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,18 @@
1818
templated_files = CommonTemplates().py_library()
1919
s.move(
2020
templated_files / ".kokoro",
21-
excludes=["samples/**/*", "test-samples*"],
21+
excludes=["samples/**/*", "test-samples*", "publish-docs.sh"],
2222
)
23+
24+
# remove docfx build
25+
assert 1 == s.replace(
26+
".kokoro/docs/docs-presubmit.cfg",
27+
'value: "docs docfx"',
28+
'value: "docs"',
29+
)
30+
31+
# needed for docs build
32+
s.move(templated_files / ".trampolinerc")
33+
2334
s.move(templated_files / "LICENSE")
2435
s.move(templated_files / ".github", excludes=["workflows", "CODEOWNERS"])

0 commit comments

Comments
 (0)