Skip to content

Commit 2cdabf9

Browse files
authored
Merge branch 'main' into feat/gapic-centralization-api-core
2 parents 70445ef + c824b6d commit 2cdabf9

1,677 files changed

Lines changed: 20397 additions & 5140 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.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: import-profiler
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
- preview
8+
# Trigger workflow on GitHub merge queue events
9+
merge_group:
10+
types: [checks_requested]
11+
12+
permissions:
13+
contents: read
14+
15+
jobs:
16+
import-profile:
17+
runs-on: ubuntu-latest
18+
timeout-minutes: 60
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v6
22+
with:
23+
fetch-depth: 2
24+
- name: Setup Python
25+
uses: actions/setup-python@v6
26+
with:
27+
python-version: "3.15"
28+
allow-prereleases: true
29+
- name: Run import profiler
30+
env:
31+
BUILD_TYPE: presubmit
32+
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref }}
33+
TEST_TYPE: import_profile
34+
PY_VERSION: "3.15"
35+
run: |
36+
ci/run_conditional_tests.sh

.librarian/generator-input/client-post-processing/bigtable-integration.yaml

Lines changed: 0 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -357,52 +357,6 @@ replacements:
357357
358358
Quick Start
359359
count: 1
360-
- paths: [
361-
packages/google-cloud-bigtable/mypy.ini
362-
]
363-
before: |
364-
\[mypy\]
365-
[\s\S]*?incremental = True
366-
after: |
367-
[mypy]
368-
python_version = 3.13
369-
namespace_packages = True
370-
check_untyped_defs = True
371-
warn_unreachable = True
372-
disallow_any_generics = True
373-
exclude = tests/unit/gapic/
374-
375-
[mypy-grpc.*]
376-
ignore_missing_imports = True
377-
378-
[mypy-google.auth.*]
379-
ignore_missing_imports = True
380-
381-
[mypy-google.iam.*]
382-
ignore_missing_imports = True
383-
384-
[mypy-google.longrunning.*]
385-
ignore_missing_imports = True
386-
387-
[mypy-google.oauth2.*]
388-
ignore_missing_imports = True
389-
390-
[mypy-google.rpc.*]
391-
ignore_missing_imports = True
392-
393-
[mypy-proto.*]
394-
ignore_missing_imports = True
395-
396-
[mypy-pytest]
397-
ignore_missing_imports = True
398-
399-
[mypy-google.cloud.*]
400-
ignore_errors = True
401-
402-
# only verify data client
403-
[mypy-google.cloud.bigtable.data.*]
404-
ignore_errors = False
405-
count: 1
406360
# Note: noxfile.py is heavily customized so we clobber the whole file.
407361
- paths: [
408362
packages/google-cloud-bigtable/noxfile.py

.librarian/generator-input/client-post-processing/datastore-integration.yaml

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -39,42 +39,6 @@ replacements:
3939
"google-cloud-core >= 2.0.0, <3.0.0",
4040
"grpcio >= 1.59.0, < 2.0.0",
4141
count: 1
42-
- paths: [
43-
"packages/google-cloud-datastore/mypy.ini",
44-
]
45-
before: |-
46-
# Performance: reuse results from previous runs to speed up 'nox'
47-
incremental = True
48-
after: |-
49-
# Performance: reuse results from previous runs to speed up "nox"
50-
incremental = True
51-
52-
[mypy-google.cloud.datastore._app_engine_key_pb2]
53-
ignore_errors = True
54-
55-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410):
56-
# Remove once this generator bug is fixed
57-
[mypy-google.cloud.datastore_v1.services.datastore.async_client]
58-
ignore_errors = True
59-
60-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2410):
61-
# Remove once this generator bug is fixed
62-
[mypy-google.cloud.datastore_v1.services.datastore.client]
63-
ignore_errors = True
64-
count: 1
65-
- paths: [
66-
"packages/google-cloud-datastore/mypy.ini",
67-
]
68-
before: |
69-
ignore_missing_imports = False
70-
71-
# TODO\(https://github.com/googleapis/gapic-generator-python/issues/2563\):
72-
# Dependencies that historically lacks py.typed markers
73-
\[mypy-google\.iam\.\*\]
74-
ignore_missing_imports = True
75-
after: |
76-
ignore_missing_imports = True
77-
count: 1
7842
- paths: [
7943
"packages/google-cloud-datastore/docs/index.rst",
8044
]

ci/run_single_test.sh

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,62 @@ case ${TEST_TYPE} in
105105
;;
106106
esac
107107
;;
108+
import_profile)
109+
if [ -f setup.py ] || [ -f pyproject.toml ]; then
110+
echo "Creating temporary virtualenv for import profile..."
111+
python3 -m venv .venv-profiler
112+
source .venv-profiler/bin/activate
113+
python -m pip install --upgrade pip setuptools
114+
115+
PACKAGE_NAME=$(basename $(pwd))
116+
PROFILER_TEMP_DIR=$(mktemp -d)
117+
cp ../../scripts/import_profiler/profiler.py "${PROFILER_TEMP_DIR}/profiler.py"
118+
PROFILER_SCRIPT="${PROFILER_TEMP_DIR}/profiler.py"
119+
BASELINE_CSV="${PROFILER_TEMP_DIR}/baseline_${PACKAGE_NAME}.csv"
120+
121+
if [ -n "${TARGET_BRANCH}" ]; then
122+
# Try upstream first (for forks), then origin
123+
BASELINE_COMMIT=$(git merge-base HEAD "upstream/${TARGET_BRANCH}" 2>/dev/null || \
124+
git merge-base HEAD "origin/${TARGET_BRANCH}" 2>/dev/null || \
125+
git merge-base HEAD "${TARGET_BRANCH}" 2>/dev/null || true)
126+
if [ -n "${BASELINE_COMMIT}" ]; then
127+
echo "Checking out baseline commit ${BASELINE_COMMIT} in a temporary worktree..."
128+
REPO_PREFIX=$(git rev-parse --show-prefix)
129+
WORKTREE_DIR=$(mktemp -d)
130+
rmdir "${WORKTREE_DIR}"
131+
if git worktree add "${WORKTREE_DIR}" "${BASELINE_COMMIT}" 2>/dev/null; then
132+
(
133+
cd "${WORKTREE_DIR}/${REPO_PREFIX}"
134+
if [ -f setup.py ] || [ -f pyproject.toml ]; then
135+
pip install -e .
136+
python "${PROFILER_SCRIPT}" --package "${PACKAGE_NAME}" --iterations 11 --csv "${BASELINE_CSV}"
137+
fi
138+
)
139+
git worktree remove -f "${WORKTREE_DIR}"
140+
else
141+
echo "Failed to create git worktree for baseline. Skipping baseline generation."
142+
fi
143+
else
144+
echo "Could not find baseline commit for ${TARGET_BRANCH:-main}. Skipping baseline generation."
145+
fi
146+
fi
147+
148+
pip install -e .
149+
150+
if [ -f "${BASELINE_CSV}" ]; then
151+
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000 --diff-baseline "${BASELINE_CSV}" --diff-threshold 100
152+
else
153+
python ${PROFILER_SCRIPT} --package ${PACKAGE_NAME} --iterations 11 --fail-threshold 5000
154+
fi
155+
retval=$?
156+
deactivate
157+
rm -rf .venv-profiler
158+
rm -rf "${PROFILER_TEMP_DIR}"
159+
else
160+
echo "Skipping import_profile as this does not appear to be a Python package (no setup.py or pyproject.toml)."
161+
retval=0
162+
fi
163+
;;
108164
*)
109165
nox -s ${TEST_TYPE}
110166
retval=$?

librarian.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414
language: python
15-
version: v0.22.0
15+
version: v0.26.0
1616
repo: googleapis/google-cloud-python
1717
sources:
1818
googleapis:
@@ -635,6 +635,7 @@ libraries:
635635
apis:
636636
- path: google/bigtable/v2
637637
- path: google/bigtable/admin/v2
638+
skip_generate: true
638639
python:
639640
library_type: GAPIC_COMBO
640641
opt_args_by_api:

packages/bigframes/testing/constraints-3.11.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ google-pasta==0.2.0
172172
google-resumable-media==2.7.2
173173
googleapis-common-protos==1.70.0
174174
googledrivedownloader==1.1.0
175-
gradio==6.15.0
175+
gradio==6.15.1
176176
gradio_client==1.11.0
177177
graphviz==0.21
178178
greenlet==3.2.3

packages/google-ads-admanager/mypy.ini

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

packages/google-ads-admanager/noxfile.py

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,16 +36,24 @@
3636
"3.12",
3737
"3.13",
3838
"3.14",
39+
"3.15",
3940
]
4041

4142
DEFAULT_PYTHON_VERSION = "3.14"
4243

43-
# TODO(https://github.com/googleapis/gapic-generator-python/issues/2450):
44-
# Switch this to Python 3.15 alpha1
45-
# https://peps.python.org/pep-0790/
46-
PREVIEW_PYTHON_VERSION = "3.14"
44+
PREVIEW_PYTHON_VERSION = "3.15"
4745

4846
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()
47+
# Path to the centralized mypy configuration file at the repository root.
48+
# Search upwards to support running nox from both monorepo packages and integration test goldens.
49+
MYPY_CONFIG_FILE = next(
50+
(
51+
str(p / "mypy.ini")
52+
for p in CURRENT_DIRECTORY.parents
53+
if (p / "mypy.ini").exists()
54+
),
55+
str(CURRENT_DIRECTORY.parent.parent / "mypy.ini"),
56+
)
4957

5058
if (CURRENT_DIRECTORY / "testing").exists():
5159
LOWER_BOUND_CONSTRAINTS_FILE = (
@@ -107,6 +115,7 @@ def mypy(session):
107115
session.install(".")
108116
session.run(
109117
"mypy",
118+
f"--config-file={MYPY_CONFIG_FILE}",
110119
"-p",
111120
"google",
112121
"--check-untyped-defs",
@@ -566,7 +575,7 @@ def prerelease_deps(session, protobuf_implementation):
566575
)
567576

568577

569-
@nox.session(python=DEFAULT_PYTHON_VERSION)
578+
@nox.session(python=PREVIEW_PYTHON_VERSION)
570579
@nox.parametrize(
571580
"protobuf_implementation",
572581
["python", "upb"],
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# We use the constraints file for the latest Python version
2+
# (currently this file) to check that the latest
3+
# major versions of dependencies are supported in setup.py.
4+
# List all library dependencies and extras in this file.
5+
# Require the latest major version be installed for each dependency.
6+
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
7+
# Then this file should have google-cloud-foo>=1
8+
google-api-core>=2
9+
google-auth>=2
10+
grpcio>=1
11+
proto-plus>=1
12+
protobuf>=7

packages/google-ads-admanager/tests/unit/gapic/admanager_v1/test_ad_break_service.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1607,6 +1607,9 @@ def test_list_ad_breaks_rest_pager(transport: str = "rest"):
16071607

16081608
pager = client.list_ad_breaks(request=sample_request)
16091609

1610+
assert pager.next_page_token == "abc"
1611+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
1612+
16101613
results = list(pager)
16111614
assert len(results) == 6
16121615
assert all(isinstance(i, ad_break_messages.AdBreak) for i in results)

0 commit comments

Comments
 (0)