Skip to content

Commit 7cfeded

Browse files
partheahebaalazzeh
authored andcommitted
chore: regenerate google-cloud-pubsub and google-cloud-spanner (#17721)
Closes #17720 Closes #17718
1 parent 63caee8 commit 7cfeded

17 files changed

Lines changed: 231 additions & 77 deletions

File tree

librarian.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1686,7 +1686,6 @@ libraries:
16861686
version: 2.39.0
16871687
apis:
16881688
- path: google/pubsub/v1
1689-
skip_generate: true
16901689
python:
16911690
library_type: GAPIC_COMBO
16921691
opt_args_by_api:
@@ -1933,7 +1932,6 @@ libraries:
19331932
- docs/spanner_v1/table.rst
19341933
- docs/spanner_v1/transaction.rst
19351934
- tests/unit/gapic/conftest.py
1936-
skip_generate: true
19371935
python:
19381936
library_type: GAPIC_COMBO
19391937
opt_args_by_api:

packages/google-cloud-pubsub/mypy.ini

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

packages/google-cloud-pubsub/noxfile.py

Lines changed: 13 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 = (
@@ -615,7 +623,7 @@ def prerelease_deps(session, protobuf_implementation):
615623
)
616624

617625

618-
@nox.session(python=DEFAULT_PYTHON_VERSION)
626+
@nox.session(python=PREVIEW_PYTHON_VERSION)
619627
@nox.parametrize(
620628
"protobuf_implementation",
621629
["python", "upb"],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
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
13+
grpc-google-iam-v1>=0

packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/test_publisher.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,6 +3000,9 @@ def test_list_topics_pager(transport_name: str = "grpc"):
30003000
assert pager._retry == retry
30013001
assert pager._timeout == timeout
30023002

3003+
assert pager.next_page_token == "abc"
3004+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
3005+
30033006
results = list(pager)
30043007
assert len(results) == 6
30053008
assert all(isinstance(i, pubsub.Topic) for i in results)
@@ -3088,6 +3091,8 @@ async def test_list_topics_async_pager():
30883091
request={},
30893092
)
30903093
assert async_pager.next_page_token == "abc"
3094+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
3095+
30913096
responses = []
30923097
async for response in async_pager: # pragma: no branch
30933098
responses.append(response)
@@ -3545,6 +3550,9 @@ def test_list_topic_subscriptions_pager(transport_name: str = "grpc"):
35453550
assert pager._retry == retry
35463551
assert pager._timeout == timeout
35473552

3553+
assert pager.next_page_token == "abc"
3554+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
3555+
35483556
results = list(pager)
35493557
assert len(results) == 6
35503558
assert all(isinstance(i, str) for i in results)
@@ -3637,6 +3645,8 @@ async def test_list_topic_subscriptions_async_pager():
36373645
request={},
36383646
)
36393647
assert async_pager.next_page_token == "abc"
3648+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
3649+
36403650
responses = []
36413651
async for response in async_pager: # pragma: no branch
36423652
responses.append(response)
@@ -4093,6 +4103,9 @@ def test_list_topic_snapshots_pager(transport_name: str = "grpc"):
40934103
assert pager._retry == retry
40944104
assert pager._timeout == timeout
40954105

4106+
assert pager.next_page_token == "abc"
4107+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
4108+
40964109
results = list(pager)
40974110
assert len(results) == 6
40984111
assert all(isinstance(i, str) for i in results)
@@ -4185,6 +4198,8 @@ async def test_list_topic_snapshots_async_pager():
41854198
request={},
41864199
)
41874200
assert async_pager.next_page_token == "abc"
4201+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
4202+
41884203
responses = []
41894204
async for response in async_pager: # pragma: no branch
41904205
responses.append(response)
@@ -5758,6 +5773,9 @@ def test_list_topics_rest_pager(transport: str = "rest"):
57585773

57595774
pager = client.list_topics(request=sample_request)
57605775

5776+
assert pager.next_page_token == "abc"
5777+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
5778+
57615779
results = list(pager)
57625780
assert len(results) == 6
57635781
assert all(isinstance(i, pubsub.Topic) for i in results)
@@ -6018,6 +6036,9 @@ def test_list_topic_subscriptions_rest_pager(transport: str = "rest"):
60186036

60196037
pager = client.list_topic_subscriptions(request=sample_request)
60206038

6039+
assert pager.next_page_token == "abc"
6040+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
6041+
60216042
results = list(pager)
60226043
assert len(results) == 6
60236044
assert all(isinstance(i, str) for i in results)
@@ -6275,6 +6296,9 @@ def test_list_topic_snapshots_rest_pager(transport: str = "rest"):
62756296

62766297
pager = client.list_topic_snapshots(request=sample_request)
62776298

6299+
assert pager.next_page_token == "abc"
6300+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
6301+
62786302
results = list(pager)
62796303
assert len(results) == 6
62806304
assert all(isinstance(i, str) for i in results)

packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/test_schema_service.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2390,6 +2390,9 @@ def test_list_schemas_pager(transport_name: str = "grpc"):
23902390
assert pager._retry == retry
23912391
assert pager._timeout == timeout
23922392

2393+
assert pager.next_page_token == "abc"
2394+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
2395+
23932396
results = list(pager)
23942397
assert len(results) == 6
23952398
assert all(isinstance(i, schema.Schema) for i in results)
@@ -2478,6 +2481,8 @@ async def test_list_schemas_async_pager():
24782481
request={},
24792482
)
24802483
assert async_pager.next_page_token == "abc"
2484+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
2485+
24812486
responses = []
24822487
async for response in async_pager: # pragma: no branch
24832488
responses.append(response)
@@ -2929,6 +2934,9 @@ def test_list_schema_revisions_pager(transport_name: str = "grpc"):
29292934
assert pager._retry == retry
29302935
assert pager._timeout == timeout
29312936

2937+
assert pager.next_page_token == "abc"
2938+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
2939+
29322940
results = list(pager)
29332941
assert len(results) == 6
29342942
assert all(isinstance(i, schema.Schema) for i in results)
@@ -3021,6 +3029,8 @@ async def test_list_schema_revisions_async_pager():
30213029
request={},
30223030
)
30233031
assert async_pager.next_page_token == "abc"
3032+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
3033+
30243034
responses = []
30253035
async for response in async_pager: # pragma: no branch
30263036
responses.append(response)
@@ -5615,6 +5625,9 @@ def test_list_schemas_rest_pager(transport: str = "rest"):
56155625

56165626
pager = client.list_schemas(request=sample_request)
56175627

5628+
assert pager.next_page_token == "abc"
5629+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
5630+
56185631
results = list(pager)
56195632
assert len(results) == 6
56205633
assert all(isinstance(i, schema.Schema) for i in results)
@@ -5877,6 +5890,9 @@ def test_list_schema_revisions_rest_pager(transport: str = "rest"):
58775890

58785891
pager = client.list_schema_revisions(request=sample_request)
58795892

5893+
assert pager.next_page_token == "abc"
5894+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
5895+
58805896
results = list(pager)
58815897
assert len(results) == 6
58825898
assert all(isinstance(i, schema.Schema) for i in results)

packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/test_subscriber.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2824,6 +2824,9 @@ def test_list_subscriptions_pager(transport_name: str = "grpc"):
28242824
assert pager._retry == retry
28252825
assert pager._timeout == timeout
28262826

2827+
assert pager.next_page_token == "abc"
2828+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
2829+
28272830
results = list(pager)
28282831
assert len(results) == 6
28292832
assert all(isinstance(i, pubsub.Subscription) for i in results)
@@ -2916,6 +2919,8 @@ async def test_list_subscriptions_async_pager():
29162919
request={},
29172920
)
29182921
assert async_pager.next_page_token == "abc"
2922+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
2923+
29192924
responses = []
29202925
async for response in async_pager: # pragma: no branch
29212926
responses.append(response)
@@ -5490,6 +5495,9 @@ def test_list_snapshots_pager(transport_name: str = "grpc"):
54905495
assert pager._retry == retry
54915496
assert pager._timeout == timeout
54925497

5498+
assert pager.next_page_token == "abc"
5499+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
5500+
54935501
results = list(pager)
54945502
assert len(results) == 6
54955503
assert all(isinstance(i, pubsub.Snapshot) for i in results)
@@ -5578,6 +5586,8 @@ async def test_list_snapshots_async_pager():
55785586
request={},
55795587
)
55805588
assert async_pager.next_page_token == "abc"
5589+
assert str(async_pager).startswith(f"{async_pager.__class__.__name__}<")
5590+
55815591
responses = []
55825592
async for response in async_pager: # pragma: no branch
55835593
responses.append(response)
@@ -7653,6 +7663,9 @@ def test_list_subscriptions_rest_pager(transport: str = "rest"):
76537663

76547664
pager = client.list_subscriptions(request=sample_request)
76557665

7666+
assert pager.next_page_token == "abc"
7667+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
7668+
76567669
results = list(pager)
76577670
assert len(results) == 6
76587671
assert all(isinstance(i, pubsub.Subscription) for i in results)
@@ -9030,6 +9043,9 @@ def test_list_snapshots_rest_pager(transport: str = "rest"):
90309043

90319044
pager = client.list_snapshots(request=sample_request)
90329045

9046+
assert pager.next_page_token == "abc"
9047+
assert str(pager).startswith(f"{pager.__class__.__name__}<")
9048+
90339049
results = list(pager)
90349050
assert len(results) == 6
90359051
assert all(isinstance(i, pubsub.Snapshot) for i in results)

packages/google-cloud-spanner/mypy.ini

Lines changed: 0 additions & 15 deletions
This file was deleted.
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-cloud-spanner/tests/system/_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
import uuid
1919

2020
from google.api_core import datetime_helpers, exceptions
21-
from google.cloud.spanner_v1 import instance as instance_mod
2221
from test_utils import retry
2322

23+
from google.cloud.spanner_v1 import instance as instance_mod
2424
from tests import _fixtures
2525

2626
CREATE_INSTANCE_ENVVAR = "GOOGLE_CLOUD_TESTS_CREATE_SPANNER_INSTANCE"

0 commit comments

Comments
 (0)