Skip to content

Commit 0003c87

Browse files
authored
Merge branch 'main' into chore-update-librarian-2026-06-26
2 parents c68f029 + c824b6d commit 0003c87

19 files changed

Lines changed: 325 additions & 42 deletions

File tree

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

ci/run_single_test.sh

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

Lines changed: 40 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,44 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
from google.api_core.gapic_v1 import client_info
16-
from google.api_core.gapic_v1 import config
17-
from google.api_core.gapic_v1 import config_async
18-
from google.api_core.gapic_v1 import method
19-
from google.api_core.gapic_v1 import method_async
20-
from google.api_core.gapic_v1 import routing_header
15+
import importlib.util
16+
from typing import Set
2117

22-
__all__ = [
23-
"client_info",
24-
"config",
25-
"config_async",
26-
"method",
27-
"method_async",
28-
"routing_header",
29-
]
18+
_has_grpc = importlib.util.find_spec("grpc") is not None
19+
20+
# PEP 0810: Explicit Lazy Imports
21+
# Python 3.15+ natively intercepts and defers these imports.
22+
# Developers can disable this behavior and force eager imports.
23+
# For more information, see:
24+
# https://docs.python.org/3.15/library/sys.html#sys.set_lazy_imports_filter
25+
# Older Python versions safely ignore this variable.
26+
__lazy_modules__: Set[str] = {
27+
"google.api_core.gapic_v1.client_info",
28+
"google.api_core.gapic_v1.routing_header",
29+
}
30+
__all__ = ["client_info", "routing_header"]
31+
32+
if _has_grpc:
33+
__lazy_modules__.update(
34+
{
35+
"google.api_core.gapic_v1.config",
36+
"google.api_core.gapic_v1.config_async",
37+
"google.api_core.gapic_v1.method",
38+
"google.api_core.gapic_v1.method_async",
39+
}
40+
)
41+
42+
from google.api_core.gapic_v1 import ( # noqa: E402
43+
client_info,
44+
routing_header,
45+
)
46+
47+
if _has_grpc:
48+
from google.api_core.gapic_v1 import ( # noqa: F401
49+
config,
50+
config_async,
51+
method,
52+
method_async,
53+
)
54+
55+
__all__.extend(["config", "config_async", "method", "method_async"])

packages/google-api-core/tests/asyncio/retry/test_retry_streaming_async.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ async def test___call___generator_send_retry(self, sleep):
293293
generator = await retry_(self._generator_mock)(error_on=3)
294294
with pytest.raises(TypeError) as exc_info:
295295
await generator.asend("cannot send to fresh generator")
296-
assert exc_info.match("can't send non-None value")
296+
assert exc_info.match("can't send non-None value")
297297
await generator.aclose()
298298

299299
# error thrown on 3

packages/google-api-core/tests/unit/retry/test_retry_streaming.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ def test___call___with_generator_send_retry(self, sleep):
263263
with pytest.raises(TypeError) as exc_info:
264264
# calling first send with non-None input should raise a TypeError
265265
result.send("can not send to fresh generator")
266-
assert exc_info.match("can't send non-None value")
266+
assert exc_info.match("can't send non-None value")
267267
# initiate iteration with None
268268
result = retry_(self._generator_mock)(error_on=3)
269269
assert result.send(None) == 0

packages/google-cloud-binary-authorization/testing/constraints-3.15.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ google-auth>=2
1010
grpcio>=1
1111
proto-plus>=1
1212
protobuf>=7
13+
grpc-google-iam-v1>=0

packages/google-cloud-chronicle/tests/unit/gapic/chronicle_v1/test_findings_refinement_service.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,9 @@ def test_list_findings_refinements_pager(transport_name: str = "grpc"):
21742174
assert pager._retry == retry
21752175
assert pager._timeout == timeout
21762176

2177+
assert pager.next_page_token == "abc"
2178+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
2179+
21772180
results = list(pager)
21782181
assert len(results) == 6
21792182
assert all(
@@ -2268,6 +2271,8 @@ async def test_list_findings_refinements_async_pager():
22682271
request={},
22692272
)
22702273
assert async_pager.next_page_token == "abc"
2274+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
2275+
22712276
responses = []
22722277
async for response in async_pager: # pragma: no branch
22732278
responses.append(response)
@@ -4231,6 +4236,9 @@ def test_list_all_findings_refinement_deployments_pager(transport_name: str = "g
42314236
assert pager._retry == retry
42324237
assert pager._timeout == timeout
42334238

4239+
assert pager.next_page_token == "abc"
4240+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
4241+
42344242
results = list(pager)
42354243
assert len(results) == 6
42364244
assert all(
@@ -4326,6 +4334,8 @@ async def test_list_all_findings_refinement_deployments_async_pager():
43264334
request={},
43274335
)
43284336
assert async_pager.next_page_token == "abc"
4337+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
4338+
43294339
responses = []
43304340
async for response in async_pager: # pragma: no branch
43314341
responses.append(response)
@@ -5536,6 +5546,9 @@ def test_list_findings_refinements_rest_pager(transport: str = "rest"):
55365546

55375547
pager = client.list_findings_refinements(request=sample_request)
55385548

5549+
assert pager.next_page_token == "abc"
5550+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
5551+
55395552
results = list(pager)
55405553
assert len(results) == 6
55415554
assert all(
@@ -6621,6 +6634,9 @@ def test_list_all_findings_refinement_deployments_rest_pager(transport: str = "r
66216634

66226635
pager = client.list_all_findings_refinement_deployments(request=sample_request)
66236636

6637+
assert pager.next_page_token == "abc"
6638+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
6639+
66246640
results = list(pager)
66256641
assert len(results) == 6
66266642
assert all(

packages/google-cloud-compute/google/cloud/compute_v1/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4365,3 +4365,4 @@ def _get_version(dependency_name):
43654365
"ZoneVmExtensionPoliciesClient",
43664366
"ZonesClient",
43674367
)
4368+
# Trigger CI check

0 commit comments

Comments
 (0)