Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit bf78e44

Browse files
authored
Merge branch 'main' into patch-1
2 parents 6477877 + 868f201 commit bf78e44

715 files changed

Lines changed: 70491 additions & 7706 deletions

File tree

Some content is hidden

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

.flake8

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,44 @@
11
[flake8]
22
ignore =
3+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E123, E124
34
# Closing bracket mismatches opening bracket's line.
45
# This works poorly with type annotations in method declarations.
56
E123, E124
67
# Line over-indented for visual indent.
78
# This works poorly with type annotations in method declarations.
9+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E126, E128, E131
810
E126, E128, E131
911
# Line break after binary operator.
1012
# This catches line breaks after "and" / "or" as a means of breaking up
1113
# long if statements, which PEP 8 explicitly encourages.
14+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): W504
1215
W504
16+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E203
17+
E203
18+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E501
19+
E501
20+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E712
21+
E712
22+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E711
23+
E711
24+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E722
25+
E722
26+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): E741
27+
E741
28+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): F401
29+
F401
30+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): F541
31+
F541
32+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): F841
33+
F841
34+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): F811
35+
F811
36+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): W503
37+
W503
38+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2333): W291
39+
W291
40+
exclude =
41+
# Exclude golden files
42+
tests/integration
43+
# Exclude generated protobuf code
44+
*_pb2.py

.githooks/pre-commit

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,6 @@ if [ -x /usr/lib/git-core/google_hook ]; then
9393
/usr/lib/git-core/google_hook pre-commit "$@"
9494
fi
9595

96-
# Check Python format.
97-
if [ $NUM_PYTHON_FILES_CHANGED -gt 0 ]
98-
then
99-
echo_status "Running Python linter..."
100-
find gapic tests -name "*.py" -not -path 'tests/integration/goldens/*' | xargs autopep8 --diff --exit-code
101-
FORMAT_STATUS=$?
102-
if [ $FORMAT_STATUS != 0 ]
103-
then
104-
echo_error "Linting failed." "Please try again after running autopep8 on the gapic/ and tests/ directories."
105-
exit 1
106-
fi
107-
fi
108-
10996
# Check unit tests.
11097
if [ $NUM_PYTHON_FILES_CHANGED -gt 0 ] || [ $NUM_UNIT_GOLDEN_FILES_CHANGED -gt 0 ]
11198
then

.github/.OwlBot.lock.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
# limitations under the License.
1414
docker:
1515
image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest
16-
digest: sha256:04c35dc5f49f0f503a306397d6d043685f8d2bb822ab515818c4208d7fb2db3a
17-
# created: 2025-01-16T15:24:11.364245182Z
16+
digest: sha256:5581906b957284864632cde4e9c51d1cc66b0094990b27e689132fe5cd036046
17+
# created: 2025-03-05

.github/sync-repo-settings.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ branchProtectionRules:
6565
- 'goldens-lint'
6666
- 'goldens-prerelease'
6767
- 'goldens-unit'
68-
- 'style-check'
68+
- 'lint'
6969
- 'snippetgen'
7070
- 'unit (3.7)'
7171
- 'unit (3.8)'

.github/workflows/tests.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ jobs:
390390
nox -f tests/integration/goldens/eventarc/noxfile.py -s prerelease_deps
391391
nox -f tests/integration/goldens/logging/noxfile.py -s prerelease_deps
392392
nox -f tests/integration/goldens/redis/noxfile.py -s prerelease_deps
393-
style-check:
393+
lint:
394394
runs-on: ubuntu-latest
395395
steps:
396396
- uses: actions/checkout@v4
@@ -399,9 +399,9 @@ jobs:
399399
with:
400400
python-version: "3.13"
401401
cache: 'pip'
402-
- name: Install autopep8
402+
- name: Install nox.
403403
run: |
404-
python -m pip install autopep8
405-
- name: Check diff
404+
python -m pip install nox
405+
- name: Run lint
406406
run: |
407-
find gapic tests -name "*.py" -not -path 'tests/**/goldens/*' | xargs autopep8 --diff --exit-code
407+
nox -s lint

.kokoro/build.sh

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

1616
set -eo pipefail
1717

18+
CURRENT_DIR=$(dirname "${BASH_SOURCE[0]}")
19+
1820
if [[ -z "${PROJECT_ROOT:-}" ]]; then
19-
PROJECT_ROOT="github/gapic-generator-python"
21+
PROJECT_ROOT=$(realpath "${CURRENT_DIR}/..")
2022
fi
2123

22-
cd "${PROJECT_ROOT}"
24+
pushd "${PROJECT_ROOT}"
2325

2426
# Disable buffering, so that the logs stream through.
2527
export PYTHONUNBUFFERED=1
@@ -28,10 +30,16 @@ export PYTHONUNBUFFERED=1
2830
env | grep KOKORO
2931

3032
# Setup service account credentials.
31-
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
33+
if [[ -f "${KOKORO_GFILE_DIR}/service-account.json" ]]
34+
then
35+
export GOOGLE_APPLICATION_CREDENTIALS=${KOKORO_GFILE_DIR}/service-account.json
36+
fi
3237

3338
# Setup project id.
34-
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
39+
if [[ -f "${KOKORO_GFILE_DIR}/project-id.json" ]]
40+
then
41+
export PROJECT_ID=$(cat "${KOKORO_GFILE_DIR}/project-id.json")
42+
fi
3543

3644
# If this is a continuous build, send the test log to the FlakyBot.
3745
# See https://github.com/googleapis/repo-automation-bots/tree/main/packages/flakybot.
@@ -46,7 +54,7 @@ fi
4654
# If NOX_SESSION is set, it only runs the specified session,
4755
# otherwise run all the sessions.
4856
if [[ -n "${NOX_SESSION:-}" ]]; then
49-
python3 -m nox -s ${NOX_SESSION:-}
57+
python3 -m nox -s ${NOX_SESSION:-}
5058
else
51-
python3 -m nox
59+
python3 -m nox
5260
fi

.kokoro/docker/docs/Dockerfile

Lines changed: 0 additions & 89 deletions
This file was deleted.

.kokoro/docker/docs/requirements.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)