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

Commit ef98679

Browse files
authored
Merge branch 'main' into add-showcase-test-rest-interceptors-metadata
2 parents a48fc54 + 868f201 commit ef98679

File tree

744 files changed

+95571
-7514
lines changed

Some content is hidden

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

744 files changed

+95571
-7514
lines changed

.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: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2024 Google LLC
1+
# Copyright 2025 Google LLC
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -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:2ed982f884312e4883e01b5ab8af8b6935f0216a5a2d82928d273081fc3be562
17-
# created: 2024-11-12T12:09:45.821174897Z
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: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ jobs:
6060
target: [showcase, showcase_alternative_templates, showcase_w_rest_async]
6161
logging_scope: ["", "google"]
6262

63-
runs-on: ubuntu-latest
63+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
64+
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
65+
runs-on: ubuntu-22.04
6466
steps:
6567
- uses: actions/checkout@v4
6668
- name: Set up Python "${{ matrix.python }}"
@@ -149,7 +151,10 @@ jobs:
149151
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2121) Remove `_w_rest_async` variant when async rest is GA.
150152
variant: ['', _alternative_templates, _mixins, _alternative_templates_mixins, _w_rest_async]
151153
logging_scope: ["", "google"]
152-
runs-on: ubuntu-latest
154+
155+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
156+
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
157+
runs-on: ubuntu-22.04
153158
steps:
154159
- uses: actions/checkout@v4
155160
- name: Set up Python "${{ matrix.python }}"
@@ -250,7 +255,10 @@ jobs:
250255
strategy:
251256
matrix:
252257
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
253-
runs-on: ubuntu-latest
258+
259+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
260+
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
261+
runs-on: ubuntu-22.04
254262
steps:
255263
- uses: actions/checkout@v4
256264
- name: Set up Python ${{ matrix.python }}
@@ -272,7 +280,10 @@ jobs:
272280
matrix:
273281
python: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
274282
variant: ['', _alternative_templates]
275-
runs-on: ubuntu-latest
283+
284+
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2303): use `ubuntu-latest` once this bug is fixed.
285+
# Use ubuntu-22.04 until Python 3.7 is removed from the test matrix
286+
runs-on: ubuntu-22.04
276287
steps:
277288
- uses: actions/checkout@v4
278289
- name: Set up Python ${{ matrix.python }}
@@ -379,7 +390,7 @@ jobs:
379390
nox -f tests/integration/goldens/eventarc/noxfile.py -s prerelease_deps
380391
nox -f tests/integration/goldens/logging/noxfile.py -s prerelease_deps
381392
nox -f tests/integration/goldens/redis/noxfile.py -s prerelease_deps
382-
style-check:
393+
lint:
383394
runs-on: ubuntu-latest
384395
steps:
385396
- uses: actions/checkout@v4
@@ -388,9 +399,9 @@ jobs:
388399
with:
389400
python-version: "3.13"
390401
cache: 'pip'
391-
- name: Install autopep8
402+
- name: Install nox.
392403
run: |
393-
python -m pip install autopep8
394-
- name: Check diff
404+
python -m pip install nox
405+
- name: Run lint
395406
run: |
396-
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 & 1 deletion
This file was deleted.

.kokoro/docker/docs/requirements.txt

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

0 commit comments

Comments
 (0)