8000 chore(python): skip docfx in main presubmit (#889) · googleapis/synthtool@fb53b6f · GitHub
[go: up one dir, main page]

Skip to content

Commit fb53b6f

Browse files
authored
chore(python): skip docfx in main presubmit (#889)
* chore(python): skip docfx in main presubmit * fix: properly template the repo name
1 parent 67f09bf commit fb53b6f

File tree

4 files changed

+34
-6
lines changed

4 files changed

+34
-6
lines changed

synthtool/gcp/templates/python_library/.kokoro/build.sh

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515

1616
set -eo pipefail
1717

18-
cd github/{{ metadata['repo']['repo'].split('/')[1] }}
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/{{ metadata['repo']['repo'].split('/')[1] }}"
20+
fi
21+
22+
cd "${PROJECT_ROOT}"
1923

2024
# Disable buffering, so that the logs stream through.
2125
export PYTHONUNBUFFERED=1
@@ -30,16 +34,16 @@ 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
3842

3943
# If NOX_SESSION is set, it only runs the specified session,
4044
# otherwise run all the sessions.
4145
if [[ -n "${NOX_SESSION:-}" ]]; then
42-
python3.6 -m nox -s "${NOX_SESSION:-}"
46+
python3 -m nox -s ${NOX_SESSION:-}
4347
else
44-
python3.6 -m nox
48+
python3 -m nox
4549
fi

synthtool/gcp/templates/python_library/.kokoro/docs/docs-presubmit.cfg

Lines changed: 11 additions & 0 deletions
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/{{ metadata['repo']['repo'].split('/')[1] }}/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}

synthtool/gcp/templates/python_library/.trampolinerc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,14 @@
1818
required_envvars+=(
1919
"STAGING_BUCKET"
2020
"V2_STAGING_BUCKET"
21+
"NOX_SESSION"
2122
)
2223

2324
# Add env vars which are passed down into the container here.
2425
pass_down_envvars+=(
2526
"STAGING_BUCKET"
2627
"V2_STAGING_BUCKET"
28+
"NOX_SESSION"
2729
)
2830

2931
# Prevent unintentional override on the default image.

synthtool/gcp/templates/python_library/noxfile.py.j2

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@ DEFAULT_PYTHON_VERSION="{{ default_python_version }}"
3030
SYSTEM_TEST_PYTHON_VERSIONS=[{% for v in system_test_python_versions %}"{{v}}"{% if not loop.last %},{% endif %}{% endfor %}]
3131
UNIT_TEST_PYTHON_VERSIONS=[{% for v in unit_test_python_versions %}"{{v}}"{% if not loop.last %},{% endif %}{% endfor %}]
3232

33+
# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
34+
nox.options.sessions = [
35+
"unit",
36+
"system",
37+
"cover",
38+
"lint",
39+
"lint_setup_py",
40+
"blacken",
41+
"docs",
42+
]
43+
3344
@nox.session(python=DEFAULT_PYTHON_VERSION)
3445
def lint(session):
3546
"""Run linters.

0 commit comments

Comments
 (0)
0