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

Commit 6a10fff

Browse files
fix: remove libcst from requirements (#54)
This PR was generated using Autosynth. 🌈 Synth log will be available here: https://source.cloud.google.com/results/invocations/b7e3829a-3e8f-4faf-94ca-1fb2fbe956df/targets - [ ] To automatically regenerate this PR, check this box. (May take up to 24 hours.) PiperOrigin-RevId: 364411656 Source-Link: googleapis/googleapis@149a3a8 PiperOrigin-RevId: 361662015 Source-Link: googleapis/googleapis@28a5919 PiperOrigin-RevId: 359562873 Source-Link: googleapis/googleapis@07932bb PiperOrigin-RevId: 355923884 Source-Link: googleapis/googleapis@5e3dace PiperOrigin-RevId: 354996675 Source-Link: googleapis/googleapis@20712b8 PiperOrigin-RevId: 352816749 Source-Link: googleapis/googleapis@ceaaf31 PiperOrigin-RevId: 350246057 Source-Link: googleapis/googleapis@5206824
1 parent bbdf4f0 commit 6a10fff

Some content is hidden

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

49 files changed

+1688
-1085
lines changed

.coveragerc

+3-19
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,11 @@
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

214
[report]
225
fail_under = 100
236
show_missing = True
24-
omit = google/cloud/redis/__init__.py
7+
omit =
8+
google/cloud/redis/__init__.py
259
exclude_lines =
2610
# Re-enable the standard pragma
2711
pragma: NO COVER
@@ -31,4 +15,4 @@ exclude_lines =
3115
# This is added at the module level as a safeguard for if someone
3216
# generates the code and tries to run it without pip installing. This
3317
# makes it virtually impossible to test properly.
34-
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-redis
18+
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19+
PROJECT_ROOT="github/python-redis"
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-redis/.kokoro/build.sh"
22+
}
23+
24+
# Only run this nox session.
25+
env_vars: {
26+
key: "NOX_SESSION"
27+
value: "docs docfx"
28+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/python-pubsub/.kokoro/test-samples-against-head.sh"
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/python-pubsub/.kokoro/test-samples-against-head.sh"
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Format: //devtools/kokoro/config/proto/build.proto
2+
3+
env_vars: {
4+
key: "INSTALL_LIBRARY_FROM_SOURCE"
5+
value: "True"
6+
}
7+
8+
env_vars: {
9+
key: "TRAMPOLINE_BUILD_FILE"
10+
value: "github/python-pubsub/.kokoro/test-samples-against-head.sh"
11+
}

.kokoro/test-samples-against-head.sh

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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+
# https://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+
# A customized test runner for samples.
17+
#
18+
# For periodic builds, you can specify this file for testing against head.
19+
20+
# `-e` enables the script to automatically fail when a command fails
21+
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
22+
set -eo pipefail
23+
# Enables `**` to include files nested inside sub-folders
24+
shopt -s globstar
25+
26+
cd github/python-redis
27+
28+
exec .kokoro/test-samples-impl.sh

.kokoro/test-samples-impl.sh

+102
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#!/bin/bash
2+
# Copyright 2021 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+
# https://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+
17+
# `-e` enables the script to automatically fail when a command fails
18+
# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero
19+
set -eo pipefail
20+
# Enables `**` to include files nested inside sub-folders
21+
shopt -s globstar
22+
23+
# Exit early if samples directory doesn't exist
24+
if [ ! -d "./samples" ]; then
25+
echo "No tests run. `./samples` not found"
26+
exit 0
27+
fi
28+
29+
# Disable buffering, so that the logs stream through.
30+
export PYTHONUNBUFFERED=1
31+
32+
# Debug: show build environment
33+
env | grep KOKORO
34+
35+
# Install nox
36+
python3.6 -m pip install --upgrade --quiet nox
37+
38+
# Use secrets acessor service account to get secrets
39+
if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then
40+
gcloud auth activate-service-account \
41+
--key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \
42+
--project="cloud-devrel-kokoro-resources"
43+
fi
44+
45+
# This script will create 3 files:
46+
# - testing/test-env.sh
47+
# - testing/service-account.json
48+
# - testing/client-secrets.json
49+
./scripts/decrypt-secrets.sh
50+
51+
source ./testing/test-env.sh
52+
export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json
53+
54+
# For cloud-run session, we activate the service account for gcloud sdk.
55+
gcloud auth activate-service-account \
56+
--key-file "${GOOGLE_APPLICATION_CREDENTIALS}"
57+
58+
export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json
59+
60+
echo -e "\n******************** TESTING PROJECTS ********************"
61+
62+
# Switch to 'fail at end' to allow all tests to complete before exiting.
63+
set +e
64+
# Use RTN to return a non-zero value if the test fails.
65+
RTN=0
66+
ROOT=$(pwd)
67+
# Find all requirements.txt in the samples directory (may break on whitespace).
68+
for file in samples/**/requirements.txt; do
69+
cd "$ROOT"
70+
# Navigate to the project folder.
71+
file=$(dirname "$file")
72+
cd "$file"
73+
74+
echo "------------------------------------------------------------"
75+
echo "- testing $file"
76+
echo "------------------------------------------------------------"
77+
78+
# Use nox to execute the tests for the project.
79+
python3.6 -m nox -s "$RUN_TESTS_SESSION"
80+
EXIT=$?
81+
82+
# If this is a periodic build, send the test log to the FlakyBot.
83+
# See https://github.com/googleapis/repo-automation-bots/tree/master/packages/flakybot.
84+
if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then
85+
chmod +x $KOKORO_GFILE_DIR/linux_amd64/flakybot
86+
$KOKORO_GFILE_DIR/linux_amd64/flakybot
87+
fi
88+
89+
if [[ $EXIT -ne 0 ]]; then
90+
RTN=1
91+
echo -e "\n Testing failed: Nox returned a non-zero exit code. \n"
92+
else
93+
echo -e "\n Testing completed.\n"
94+
fi
95+
96+
done
97+
cd "$ROOT"
98+
99+
# Workaround for Kokoro permissions issue: delete secrets
100+
rm testing/{test-env.sh,client-secrets.json,service-account.json}
101+
102+
exit "$RTN"

0 commit comments

Comments
 (0)