Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 01d3127

Browse filesBrowse files
authored
feat(pubsub): regenerate pubsub library using gapic-generator v1.32.0 (#17167)
Updates post processing to account for dropping support for Python 3.7, 3.8, 3.9 and impacts that has on using 3.10 for lower bounds testing. Changes: * adds `grpcio-status`, `opentelemetry-api`, `opentelemetry-sdk` to `constraints-3.10.txt` and installs `pandas` extra in `prerelease_deps` and `core_deps_from_source` nox sessions. * updates dependency versions in `constraints-3.10.txt` to match expectations in the `setup.py` file. * Refined post-processing replacement rules in ``librarian/generator-input/client-post-processing/pubsub-integration.yaml` to make these dependency and constraint alignments.
1 parent 042dc5c commit 01d3127
Copy full SHA for 01d3127

11 files changed

+105-158Lines changed: 105 additions & 158 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.librarian/generator-input/client-post-processing/pubsub-integration.yaml‎

Copy file name to clipboardExpand all lines: .librarian/generator-input/client-post-processing/pubsub-integration.yaml
+25-1Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ replacements:
382382
- "packages/google-cloud-pubsub/setup.py"
383383
before: '([ \t]+)("grpc-google-iam-v1.*",\n)\]\nextras = \{\}'
384384
after: |-
385-
\g<1>\g<2>\g<1>"grpcio-status >= 1.44.0",
385+
\g<1>\g<2>\g<1>"grpcio-status >= 1.51.3",
386386
\g<1>"opentelemetry-api >= 1.27.0",
387387
\g<1>"opentelemetry-sdk >= 1.27.0",
388388
]
@@ -511,3 +511,27 @@ replacements:
511511
\g<1>"pubsub_v1/**",
512512
\g<1>"_build",
513513
count: 1
514+
515+
- paths:
516+
- "packages/google-cloud-pubsub/testing/constraints-3.10.txt"
517+
before: 'grpc-google-iam-v1==0\.14\.0\n(?!grpcio-status)'
518+
after: |-
519+
grpc-google-iam-v1==0.14.0
520+
grpcio-status==1.51.3
521+
opentelemetry-api==1.27.0
522+
opentelemetry-sdk==1.27.0
523+
count: 1
524+
525+
- paths:
526+
- "packages/google-cloud-pubsub/testing/constraints-3.10.txt"
527+
before: 'grpcio==1.44.0'
528+
after: 'grpcio==1.51.3'
529+
count: 1
530+
531+
- paths:
532+
- "packages/google-cloud-pubsub/setup.py"
533+
before: '"grpcio-status >= 1\.44\.0",'
534+
after: '"grpcio-status >= 1.51.3",'
535+
count: 1
536+
537+
Collapse file

‎librarian.yaml‎

Copy file name to clipboardExpand all lines: librarian.yaml
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1661,7 +1661,6 @@ libraries:
16611661
version: 2.38.0
16621662
apis:
16631663
- path: google/pubsub/v1
1664-
skip_generate: true
16651664
python:
16661665
library_type: GAPIC_COMBO
16671666
opt_args_by_api:
Collapse file

‎packages/google-cloud-pubsub/docs/conf.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/docs/conf.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -83,7 +83,7 @@
8383

8484
# General information about the project.
8585
project = "google-cloud-pubsub"
86-
copyright = "2025, Google, LLC"
86+
copyright = "2026, Google, LLC"
8787
author = "Google APIs"
8888

8989
# The version info for the project you're documenting, acts as replacement for
Collapse file

‎packages/google-cloud-pubsub/google/pubsub_v1/__init__.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/google/pubsub_v1/__init__.py
+4-21Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -21,13 +21,7 @@
2121

2222
__version__ = package_version.__version__
2323

24-
if sys.version_info >= (3, 8): # pragma: NO COVER
25-
from importlib import metadata
26-
else: # pragma: NO COVER
27-
# TODO(https://github.com/googleapis/python-api-core/issues/835): Remove
28-
# this code path once we drop support for Python 3.7
29-
import importlib_metadata as metadata
30-
24+
from importlib import metadata
3125

3226
from .services.publisher import PublisherAsyncClient, PublisherClient
3327
from .services.schema_service import SchemaServiceAsyncClient, SchemaServiceClient
@@ -116,28 +110,17 @@
116110
# An older version of api_core is installed which does not define the
117111
# functions above. We do equivalent checks manually.
118112
try:
119-
import sys
120113
import warnings
121114

122115
_py_version_str = sys.version.split()[0]
123116
_package_label = "google.pubsub_v1"
124-
if sys.version_info < (3, 9):
117+
if sys.version_info < (3, 10):
125118
warnings.warn(
126119
"You are using a non-supported Python version "
127120
+ f"({_py_version_str}). Google will not post any further "
128121
+ f"updates to {_package_label} supporting this Python version. "
129122
+ "Please upgrade to the latest Python version, or at "
130-
+ f"least to Python 3.9, and then update {_package_label}.",
131-
FutureWarning,
132-
)
133-
if sys.version_info[:2] == (3, 9):
134-
warnings.warn(
135-
f"You are using a Python version ({_py_version_str}) "
136-
+ f"which Google will stop supporting in {_package_label} in "
137-
+ "January 2026. Please "
138-
+ "upgrade to the latest Python version, or at "
139-
+ "least to Python 3.10, before then, and "
140-
+ f"then update {_package_label}.",
123+
+ f"least to Python 3.10, and then update {_package_label}.",
141124
FutureWarning,
142125
)
143126

Collapse file

‎packages/google-cloud-pubsub/noxfile.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/noxfile.py
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -31,7 +31,6 @@
3131
LINT_PATHS.append("samples")
3232

3333
ALL_PYTHON = [
34-
"3.9",
3534
"3.10",
3635
"3.11",
3736
"3.12",
@@ -439,7 +438,6 @@ def docs(session):
439438
shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True)
440439
session.run(
441440
"sphinx-build",
442-
"-W", # warnings as errors
443441
"-T", # show full traceback on exception
444442
"-N", # no colors
445443
"-b",
Collapse file

‎packages/google-cloud-pubsub/setup.py‎

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/setup.py
+5-6Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -39,7 +39,7 @@
3939
release_status = "Development Status :: 5 - Production/Stable"
4040

4141
dependencies = [
42-
"google-api-core[grpc] >= 2.11.0, <3.0.0",
42+
"google-api-core[grpc] >= 2.17.1, <3.0.0",
4343
# Exclude incompatible versions of `google-auth`
4444
# See https://github.com/googleapis/google-cloud-python/issues/12364
4545
"google-auth >= 2.14.1, <3.0.0,!=2.24.0,!=2.25.0",
@@ -48,7 +48,7 @@
4848
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
4949
"protobuf >= 4.25.8, < 8.0.0",
5050
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
51-
"grpcio-status >= 1.33.2",
51+
"grpcio-status >= 1.51.3",
5252
"opentelemetry-api >= 1.27.0",
5353
"opentelemetry-sdk >= 1.27.0",
5454
]
@@ -74,15 +74,14 @@
7474
long_description=readme,
7575
author="Google LLC",
7676
author_email="googleapis-packages@google.com",
77-
license="Apache 2.0",
77+
license="Apache-2.0",
7878
url=url,
7979
classifiers=[
8080
release_status,
8181
"Intended Audience :: Developers",
8282
"License :: OSI Approved :: Apache Software License",
8383
"Programming Language :: Python",
8484
"Programming Language :: Python :: 3",
85-
"Programming Language :: Python :: 3.9",
8685
"Programming Language :: Python :: 3.10",
8786
"Programming Language :: Python :: 3.11",
8887
"Programming Language :: Python :: 3.12",
@@ -93,7 +92,7 @@
9392
],
9493
platforms="Posix; MacOS X; Windows",
9594
packages=packages,
96-
python_requires=">=3.9",
95+
python_requires=">=3.10",
9796
install_requires=dependencies,
9897
extras_require=extras,
9998
include_package_data=True,
Collapse file
+15-11Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1-
# -*- coding: utf-8 -*-
2-
# This constraints file is required for unit tests.
3-
# List all library dependencies and extras in this file.
4-
google-api-core
5-
google-auth
6-
grpcio
7-
proto-plus
8-
protobuf
9-
# cryptography is a direct dependency of google-auth
10-
cryptography
11-
grpc-google-iam-v1
1+
# This constraints file is used to check that lower bounds
2+
# are correct in setup.py
3+
# List all library dependencies and extras in this file,
4+
# pinning their versions to their lower bounds.
5+
# For example, if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0",
6+
# then this file should have google-cloud-foo==1.14.0
7+
google-api-core==2.17.1
8+
google-auth==2.14.1
9+
grpcio==1.51.3
10+
proto-plus==1.22.3
11+
protobuf==4.25.8
12+
grpc-google-iam-v1==0.14.0
13+
grpcio-status==1.51.3
14+
opentelemetry-api==1.27.0
15+
opentelemetry-sdk==1.27.0
Collapse file

‎packages/google-cloud-pubsub/testing/constraints-3.9.txt‎

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/testing/constraints-3.9.txt
-14Lines changed: 0 additions & 14 deletions
This file was deleted.
Collapse file

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

Copy file name to clipboardExpand all lines: packages/google-cloud-pubsub/tests/unit/gapic/pubsub_v1/test_publisher.py
+16-34Lines changed: 16 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
2-
# Copyright 2025 Google LLC
2+
# Copyright 2026 Google LLC
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
55
# you may not use this file except in compliance with the License.
@@ -13,18 +13,12 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
import os
17-
18-
# try/except added for compatibility with python < 3.8
19-
try:
20-
from unittest import mock
21-
from unittest.mock import AsyncMock # pragma: NO COVER
22-
except ImportError: # pragma: NO COVER
23-
import mock
24-
2516
import json
2617
import math
18+
import os
2719
from collections.abc import AsyncIterable, Iterable, Mapping, Sequence
20+
from unittest import mock
21+
from unittest.mock import AsyncMock
2822

2923
import grpc
3024
import pytest
@@ -3120,11 +3114,7 @@ async def test_list_topics_async_pages():
31203114
RuntimeError,
31213115
)
31223116
pages = []
3123-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
3124-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
3125-
async for page_ in ( # pragma: no branch
3126-
await client.list_topics(request={})
3127-
).pages:
3117+
async for page_ in (await client.list_topics(request={})).pages:
31283118
pages.append(page_)
31293119
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
31303120
assert page_.raw_page.next_page_token == token
@@ -3672,11 +3662,7 @@ async def test_list_topic_subscriptions_async_pages():
36723662
RuntimeError,
36733663
)
36743664
pages = []
3675-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
3676-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
3677-
async for page_ in ( # pragma: no branch
3678-
await client.list_topic_subscriptions(request={})
3679-
).pages:
3665+
async for page_ in (await client.list_topic_subscriptions(request={})).pages:
36803666
pages.append(page_)
36813667
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
36823668
assert page_.raw_page.next_page_token == token
@@ -4221,11 +4207,7 @@ async def test_list_topic_snapshots_async_pages():
42214207
RuntimeError,
42224208
)
42234209
pages = []
4224-
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
4225-
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
4226-
async for page_ in ( # pragma: no branch
4227-
await client.list_topic_snapshots(request={})
4228-
).pages:
4210+
async for page_ in (await client.list_topic_snapshots(request={})).pages:
42294211
pages.append(page_)
42304212
for page_, token in zip(pages, ["abc", "def", "ghi", ""]):
42314213
assert page_.raw_page.next_page_token == token
@@ -4898,7 +4880,7 @@ def test_create_topic_rest_required_fields(request_type=pubsub.Topic):
48984880

48994881
expected_params = [("$alt", "json;enum-encoding=int")]
49004882
actual_params = req.call_args.kwargs["params"]
4901-
assert expected_params == actual_params
4883+
assert sorted(expected_params) == sorted(actual_params)
49024884

49034885

49044886
def test_create_topic_rest_unset_required_fields():
@@ -5068,7 +5050,7 @@ def test_update_topic_rest_required_fields(request_type=pubsub.UpdateTopicReques
50685050

50695051
expected_params = [("$alt", "json;enum-encoding=int")]
50705052
actual_params = req.call_args.kwargs["params"]
5071-
assert expected_params == actual_params
5053+
assert sorted(expected_params) == sorted(actual_params)
50725054

50735055

50745056
def test_update_topic_rest_unset_required_fields():
@@ -5253,7 +5235,7 @@ def test_publish_rest_required_fields(request_type=pubsub.PublishRequest):
52535235

52545236
expected_params = [("$alt", "json;enum-encoding=int")]
52555237
actual_params = req.call_args.kwargs["params"]
5256-
assert expected_params == actual_params
5238+
assert sorted(expected_params) == sorted(actual_params)
52575239

52585240

52595241
def test_publish_rest_unset_required_fields():
@@ -5438,7 +5420,7 @@ def test_get_topic_rest_required_fields(request_type=pubsub.GetTopicRequest):
54385420

54395421
expected_params = [("$alt", "json;enum-encoding=int")]
54405422
actual_params = req.call_args.kwargs["params"]
5441-
assert expected_params == actual_params
5423+
assert sorted(expected_params) == sorted(actual_params)
54425424

54435425

54445426
def test_get_topic_rest_unset_required_fields():
@@ -5619,7 +5601,7 @@ def test_list_topics_rest_required_fields(request_type=pubsub.ListTopicsRequest)
56195601

56205602
expected_params = [("$alt", "json;enum-encoding=int")]
56215603
actual_params = req.call_args.kwargs["params"]
5622-
assert expected_params == actual_params
5604+
assert sorted(expected_params) == sorted(actual_params)
56235605

56245606

56255607
def test_list_topics_rest_unset_required_fields():
@@ -5876,7 +5858,7 @@ def test_list_topic_subscriptions_rest_required_fields(
58765858

58775859
expected_params = [("$alt", "json;enum-encoding=int")]
58785860
actual_params = req.call_args.kwargs["params"]
5879-
assert expected_params == actual_params
5861+
assert sorted(expected_params) == sorted(actual_params)
58805862

58815863

58825864
def test_list_topic_subscriptions_rest_unset_required_fields():
@@ -6135,7 +6117,7 @@ def test_list_topic_snapshots_rest_required_fields(
61356117

61366118
expected_params = [("$alt", "json;enum-encoding=int")]
61376119
actual_params = req.call_args.kwargs["params"]
6138-
assert expected_params == actual_params
6120+
assert sorted(expected_params) == sorted(actual_params)
61396121

61406122

61416123
def test_list_topic_snapshots_rest_unset_required_fields():
@@ -6376,7 +6358,7 @@ def test_delete_topic_rest_required_fields(request_type=pubsub.DeleteTopicReques
63766358

63776359
expected_params = [("$alt", "json;enum-encoding=int")]
63786360
actual_params = req.call_args.kwargs["params"]
6379-
assert expected_params == actual_params
6361+
assert sorted(expected_params) == sorted(actual_params)
63806362

63816363

63826364
def test_delete_topic_rest_unset_required_fields():
@@ -6554,7 +6536,7 @@ def test_detach_subscription_rest_required_fields(
65546536

65556537
expected_params = [("$alt", "json;enum-encoding=int")]
65566538
actual_params = req.call_args.kwargs["params"]
6557-
assert expected_params == actual_params
6539+
assert sorted(expected_params) == sorted(actual_params)
65586540

65596541

65606542
def test_detach_subscription_rest_unset_required_fields():

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.