Skip to content

Commit 35c1a58

Browse files
committed
feat(pubsub): drop support for Python 3.7, 3.8, and 3.9
Regenerates google-cloud-pubsub using the custom v0.14.0 pseudo-version librarian build on top of pristine, up-to-date main. - Natively drop Python 3.9 support in constraints and python_requires pins using generator 1.32.0 - Correctly generates setup.py with grpcio>=1.44.0 natively, avoiding any version regressions - Segregates all post-processing EOL warning rules into package-specific pubsub-integration.yaml, keeping global configs clean - Clean up collections.abc.KeysView typing compatibility fallback try-except in leaser.py - Manually updates contributing.rst warning filters and commands to drop Python 3.7-3.9 - Restores credentials_file warning filter and adds opentelemetry SelectableGroups filter in pytest.ini - Passes all Nox docker validations (unit, lint, prerelease_deps) cleanly in parallel
1 parent 3ef95d6 commit 35c1a58

7 files changed

Lines changed: 39 additions & 28 deletions

File tree

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

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,10 +528,32 @@ replacements:
528528
after: 'grpcio==1.51.3'
529529
count: 1
530530

531+
531532
- paths:
532-
- "packages/google-cloud-pubsub/setup.py"
533-
before: '"grpcio-status >= 1\.44\.0",'
534-
after: '"grpcio-status >= 1.51.3",'
533+
- "packages/google-cloud-pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py"
534+
before: "try:\\s*\\n\\s*from collections\\.abc import KeysView[\\s\\S]*?from typing import KeysView"
535+
after: "from collections.abc import KeysView"
536+
count: 1
537+
538+
- paths:
539+
- "packages/google-cloud-pubsub/CONTRIBUTING.rst"
540+
before: "- The feature must work fully on the following CPython versions:\n 3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows."
541+
after: "- The feature must work fully on the following CPython versions:\n 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows."
542+
count: 1
543+
544+
- paths:
545+
- "packages/google-cloud-pubsub/CONTRIBUTING.rst"
546+
before: "We support:\n\n- `Python 3.9`_\n- `Python 3.10`_\n- `Python 3.11`_\n- `Python 3.12`_\n- `Python 3.13`_\n- `Python 3.14`_\n\n.. _Python 3.9: https://docs.python.org/3.9/\n.. _Python 3.10: https://docs.python.org/3.10/"
547+
after: "We support:\n\n- `Python 3.10`_\n- `Python 3.11`_\n- `Python 3.12`_\n- `Python 3.13`_\n- `Python 3.14`_\n\n.. _Python 3.10: https://docs.python.org/3.10/"
548+
count: 1
549+
550+
- paths:
551+
- "packages/google-cloud-pubsub/CONTRIBUTING.rst"
552+
before: "We also explicitly decided to support Python 3 beginning with version 3.7."
553+
after: "We also explicitly decided to support Python 3 beginning with version 3.10."
535554
count: 1
536555

537556

557+
558+
559+

librarian.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1659,7 +1659,7 @@ libraries:
16591659
version: 2.38.0
16601660
apis:
16611661
- path: google/pubsub/v1
1662-
skip_generate: true
1662+
16631663
python:
16641664
library_type: GAPIC_COMBO
16651665
opt_args_by_api:

packages/google-cloud-pubsub/CONTRIBUTING.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ In order to add a feature:
2222
documentation.
2323

2424
- The feature must work fully on the following CPython versions:
25-
3.9, 3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
25+
3.10, 3.11, 3.12, 3.13 and 3.14 on both UNIX and Windows.
2626

2727
- The feature must not add unnecessary dependencies (where
2828
"unnecessary" is of course subjective, but new dependencies should
@@ -221,14 +221,12 @@ Supported Python Versions
221221

222222
We support:
223223

224-
- `Python 3.9`_
225224
- `Python 3.10`_
226225
- `Python 3.11`_
227226
- `Python 3.12`_
228227
- `Python 3.13`_
229228
- `Python 3.14`_
230229

231-
.. _Python 3.9: https://docs.python.org/3.9/
232230
.. _Python 3.10: https://docs.python.org/3.10/
233231
.. _Python 3.11: https://docs.python.org/3.11/
234232
.. _Python 3.12: https://docs.python.org/3.12/
@@ -241,7 +239,7 @@ Supported versions can be found in our ``noxfile.py`` `config`_.
241239
.. _config: https://github.com/googleapis/python-pubsub/blob/main/noxfile.py
242240

243241

244-
We also explicitly decided to support Python 3 beginning with version 3.7.
242+
We also explicitly decided to support Python 3 beginning with version 3.10.
245243
Reasons for this include:
246244

247245
- Encouraging use of newest versions of Python 3

packages/google-cloud-pubsub/README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ Supported Python Versions
6262
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
6363
Python.
6464

65-
Python >= 3.9, including 3.14
65+
Python >= 3.10, including 3.14
6666

6767
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
6868
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
6969

7070
Unsupported Python Versions
7171
^^^^^^^^^^^^^^^^^^^^^^^^^^^
72-
Python <= 3.8
72+
Python <= 3.9
73+
7374

7475
If you are using an `end-of-life`_
7576
version of Python, we recommend that you update as soon as possible to an actively supported version.

packages/google-cloud-pubsub/docs/README.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,15 @@ Supported Python Versions
6262
Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
6363
Python.
6464

65-
Python >= 3.9, including 3.14
65+
Python >= 3.10, including 3.14
6666

6767
.. _active: https://devguide.python.org/devcycle/#in-development-main-branch
6868
.. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
6969

7070
Unsupported Python Versions
7171
^^^^^^^^^^^^^^^^^^^^^^^^^^^
72-
Python <= 3.8
72+
Python <= 3.9
73+
7374

7475
If you are using an `end-of-life`_
7576
version of Python, we recommend that you update as soon as possible to an actively supported version.

packages/google-cloud-pubsub/google/cloud/pubsub_v1/subscriber/_protocol/leaser.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,22 +20,14 @@
2020
import threading
2121
import time
2222
import typing
23+
from collections.abc import KeysView
2324
from typing import Dict, Iterable, Optional, Union
2425

2526
from google.cloud.pubsub_v1.open_telemetry.subscribe_opentelemetry import (
2627
SubscribeOpenTelemetry,
2728
)
28-
from google.cloud.pubsub_v1.subscriber._protocol.dispatcher import _MAX_BATCH_LATENCY
29-
30-
try:
31-
from collections.abc import KeysView
32-
33-
KeysView[None] # KeysView is only subscriptable in Python 3.9+
34-
except TypeError:
35-
# Deprecated since Python 3.9, thus only use as a fallback in older Python versions
36-
from typing import KeysView
37-
3829
from google.cloud.pubsub_v1.subscriber._protocol import requests
30+
from google.cloud.pubsub_v1.subscriber._protocol.dispatcher import _MAX_BATCH_LATENCY
3931

4032
if typing.TYPE_CHECKING: # pragma: NO COVER
4133
from google.cloud.pubsub_v1.subscriber._protocol.streaming_pull_manager import (

packages/google-cloud-pubsub/pytest.ini

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,9 @@ filterwarnings =
1717
ignore:.*pkg_resources.declare_namespace:DeprecationWarning
1818
ignore:.*pkg_resources is deprecated as an API:DeprecationWarning
1919
# Remove once https://github.com/googleapis/gapic-generator-python/issues/2303 is fixed
20-
ignore:The python-bigquery library will stop supporting Python 3.7:PendingDeprecationWarning
21-
# Remove once we move off credential files https://github.com/googleapis/google-auth-library-python/pull/1812
22-
# Note that these are used in tests only
23-
ignore:Your config file at [/home/kbuilder/.docker/config.json] contains these credential helper entries:DeprecationWarning
20+
# Remove once opentelemetry stops triggering SelectableGroups DeprecationWarning on Python 3.11+
21+
ignore:.*SelectableGroups dict interface is deprecated.*:DeprecationWarning
22+
# Remove once credentials_file is completely removed
2423
ignore:The `credentials_file` argument is deprecated because of a potential security risk:DeprecationWarning
25-
ignore:You are using a Python version.*which Google will stop supporting in new releases of google\.api_core.*:FutureWarning
26-
ignore:You are using a non-supported Python version \(([\d\.]+)\)\. Google will not post any further updates to google\.api_core.*:FutureWarning
2724
# These google library EOL warnings for Python versions don't matter for the purposes of a test.
2825
ignore::FutureWarning:google.*:

0 commit comments

Comments
 (0)