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

Commit

Permalink
chore: update templates (#73)
Browse files Browse the repository at this point in the history
* chore(python): skip docfx in main presubmit

* chore(python): skip docfx in main presubmit

* fix: properly template the repo name

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Fri Jan 8 10:32:13 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: fb53b6fb373b7c3edf4e55f3e8036bc6d73fa483
Source-Link: googleapis/synthtool@fb53b6f

* chore: add missing quotation mark

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Mon Jan 11 09:43:06 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: 16ec872dd898d7de6e1822badfac32484b5d9031
Source-Link: googleapis/synthtool@16ec872

* chore: add 3.9 to noxfile template

Since the python-docs-samples noxfile-template doesn't sync with this, I wanted to make sure the noxfile template matched the most recent change [here](https://github.com/GoogleCloudPlatform/python-docs-samples/pull/4968/files)

cc @tmatsuo

Source-Author: Leah E. Cole <6719667+leahecole@users.noreply.github.com>
Source-Date: Fri Jan 15 17:24:05 2021 -0800
Source-Repo: googleapis/synthtool
Source-Sha: 56ddc68f36b32341e9f22c2c59b4ce6aa3ba635f
Source-Link: googleapis/synthtool@56ddc68

* build(python): make `NOX_SESSION` optional

I added this accidentally in #889. `NOX_SESSION` should be passed down if it is set but not marked required.

Source-Author: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com>
Source-Date: Tue Jan 19 09:38:04 2021 -0700
Source-Repo: googleapis/synthtool
Source-Sha: ba960d730416fe05c50547e975ce79fcee52c671
Source-Link: googleapis/synthtool@ba960d7
  • Loading branch information
yoshi-automation committed Jan 20, 2021
1 parent 9a2eef6 commit 864dc09
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 10 deletions.
16 changes: 10 additions & 6 deletions .kokoro/build.sh
Expand Up @@ -15,7 +15,11 @@

set -eo pipefail

cd github/python-secret-manager
if [[ -z "${PROJECT_ROOT:-}" ]]; then
PROJECT_ROOT="github/python-secret-manager"
fi

cd "${PROJECT_ROOT}"

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

# Remove old nox
python3.6 -m pip uninstall --yes --quiet nox-automation
python3 -m pip uninstall --yes --quiet nox-automation

# Install nox
python3.6 -m pip install --upgrade --quiet nox
python3.6 -m nox --version
python3 -m pip install --upgrade --quiet nox
python3 -m nox --version

# If NOX_SESSION is set, it only runs the specified session,
# otherwise run all the sessions.
if [[ -n "${NOX_SESSION:-}" ]]; then
python3.6 -m nox -s "${NOX_SESSION:-}"
python3 -m nox -s ${NOX_SESSION:-}
else
python3.6 -m nox
python3 -m nox
fi
11 changes: 11 additions & 0 deletions .kokoro/docs/docs-presubmit.cfg
Expand Up @@ -15,3 +15,14 @@ env_vars: {
key: "TRAMPOLINE_IMAGE_UPLOAD"
value: "false"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-secret-manager/.kokoro/build.sh"
}

# Only run this nox session.
env_vars: {
key: "NOX_SESSION"
value: "docs docfx"
}
1 change: 1 addition & 0 deletions .trampolinerc
Expand Up @@ -24,6 +24,7 @@ required_envvars+=(
pass_down_envvars+=(
"STAGING_BUCKET"
"V2_STAGING_BUCKET"
"NOX_SESSION"
)

# Prevent unintentional override on the default image.
Expand Down
11 changes: 11 additions & 0 deletions noxfile.py
Expand Up @@ -30,6 +30,17 @@
SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"]
UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9"]

# 'docfx' is excluded since it only needs to run in 'docs-presubmit'
nox.options.sessions = [
"unit",
"system",
"cover",
"lint",
"lint_setup_py",
"blacken",
"docs",
]


@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint(session):
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/noxfile.py
Expand Up @@ -85,7 +85,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to tested samples.
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8"]
ALL_VERSIONS = ["2.7", "3.6", "3.7", "3.8", "3.9"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG['ignored_versions']
Expand Down
6 changes: 3 additions & 3 deletions synth.metadata
Expand Up @@ -4,7 +4,7 @@
"git": {
"name": ".",
"remote": "https://github.com/googleapis/python-secret-manager.git",
"sha": "856621efa53a9a12b4d4a712ca4c866a50755433"
"sha": "9a2eef65040dbe52d2b23db02640d113c26e1297"
}
},
{
Expand All @@ -19,14 +19,14 @@
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
"sha": "ba960d730416fe05c50547e975ce79fcee52c671"
}
},
{
"git": {
"name": "synthtool",
"remote": "https://github.com/googleapis/synthtool.git",
"sha": "41a4e56982620d3edcf110d76f4fcdfdec471ac8"
"sha": "ba960d730416fe05c50547e975ce79fcee52c671"
}
}
],
Expand Down

0 comments on commit 864dc09

Please sign in to comment.