Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
3ffe30e
feat: Add Python 3.14 support
google-labs-jules[bot] Oct 10, 2025
1e89dbc
feat: Add Python 3.14 support
google-labs-jules[bot] Oct 10, 2025
ae8e7fb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
2d915c6
feat: Add Python 3.14 support
google-labs-jules[bot] Oct 10, 2025
abc3a7a
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
d8cd0a3
feat: Add Python 3.14 support and drop Python 3.7/3.8
google-labs-jules[bot] Oct 13, 2025
3c2a458
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 13, 2025
81a33c1
Update .kokoro/samples/python3.14/common.cfg
chalmerlowe Oct 13, 2025
23dc8d3
feat: Add Python 3.14 support and drop Python 3.7/3.8
google-labs-jules[bot] Oct 15, 2025
583179c
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 15, 2025
2479c2b
feat: Add Python 3.14 support
google-labs-jules[bot] Oct 15, 2025
49e15a2
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 15, 2025
61b301d
feat: Add Python 3.14 support and remove 3.7/3.8 from nox
google-labs-jules[bot] Oct 17, 2025
d710446
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 17, 2025
e83dbf1
feat: Add Python 3.14 support and fix nox session
google-labs-jules[bot] Oct 20, 2025
bf41dee
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
c5272c4
feat: Add Python 3.14 support and update CI
google-labs-jules[bot] Oct 20, 2025
69233d1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
43b1b51
feat: Add Python 3.14 support and fix scheduler shutdown
google-labs-jules[bot] Oct 20, 2025
ee497e7
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
760c06c
feat: Add Python 3.14 support and fix nox session
google-labs-jules[bot] Oct 20, 2025
dbecfe8
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
b90685b
Apply suggestion from @chalmerlowe
chalmerlowe Oct 20, 2025
e60937f
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
0fa4f69
updates type hint to accound for 3.14 changes and updates tests now t…
chalmerlowe Oct 20, 2025
8880472
edits to correct for failing tests
chalmerlowe Oct 21, 2025
2f3e30a
experimenting with time limits for threading.Barrier
chalmerlowe Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/sync-repo-settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,20 @@ branchProtectionRules:
- 'Kokoro - Against Pub/Sub Lite samples'
- 'cla/google'
- 'Samples - Lint'
- 'Samples - Python 3.7'
- 'Samples - Python 3.8'
- 'Samples - Python 3.9'
- 'Samples - Python 3.10'
- 'Samples - Python 3.11'
- 'Samples - Python 3.12'
- 'Samples - Python 3.13'
- 'Samples - Python 3.14'
- 'OwlBot Post Processor'
- 'docs'
- 'docfx'
- 'lint'
- 'unit (3.7)'
- 'unit (3.8)'
- 'unit (3.9)'
- 'unit (3.10)'
- 'unit (3.11)'
- 'unit (3.12)'
- 'unit (3.13)'
- 'unit (3.14)'
- 'cover'
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ action {
# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.7"
value: "py-3.14"
}

# Declare build specific Cloud project.
env_vars: {
key: "BUILD_SPECIFIC_GCLOUD_PROJECT"
value: "python-docs-samples-tests-py37"
value: "python-docs-samples-tests-314"
}

env_vars: {
Expand All @@ -37,4 +37,4 @@ gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-pubsub/.kokoro/trampoline_v2.sh"
build_file: "python-pubsub/.kokoro/trampoline_v2.sh"
40 changes: 0 additions & 40 deletions .kokoro/samples/python3.8/common.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/continuous.cfg

This file was deleted.

11 changes: 0 additions & 11 deletions .kokoro/samples/python3.8/periodic-head.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/periodic.cfg

This file was deleted.

6 changes: 0 additions & 6 deletions .kokoro/samples/python3.8/presubmit.cfg

This file was deleted.

14 changes: 6 additions & 8 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ In order to add a feature:
documentation.

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

- The feature must not add unnecessary dependencies (where
"unnecessary" is of course subjective, but new dependencies should
Expand Down Expand Up @@ -195,11 +195,11 @@ configure them just like the System Tests.

# Run all tests in a folder
$ cd samples/snippets
$ nox -s py-3.8
$ nox -s py-3.9

# Run a single sample test
$ cd samples/snippets
$ nox -s py-3.8 -- -k <name of test>
$ nox -s py-3.9 -- -k <name of test>

********************************************
Note About ``README`` as it pertains to PyPI
Expand All @@ -221,29 +221,27 @@ Supported Python Versions

We support:

- `Python 3.7`_
- `Python 3.8`_
- `Python 3.9`_
- `Python 3.10`_
- `Python 3.11`_
- `Python 3.12`_
- `Python 3.13`_
- `Python 3.14`_

.. _Python 3.7: https://docs.python.org/3.7/
.. _Python 3.8: https://docs.python.org/3.8/
.. _Python 3.9: https://docs.python.org/3.9/
.. _Python 3.10: https://docs.python.org/3.10/
.. _Python 3.11: https://docs.python.org/3.11/
.. _Python 3.12: https://docs.python.org/3.12/
.. _Python 3.13: https://docs.python.org/3.13/
.. _Python 3.14: https://docs.python.org/3.14/


Supported versions can be found in our ``noxfile.py`` `config`_.

.. _config: https://github.com/googleapis/python-pubsub/blob/main/noxfile.py


We also explicitly decided to support Python 3 beginning with version 3.7.
We also explicitly decided to support Python 3 beginning with version 3.9.
Reasons for this include:

- Encouraging use of newest versions of Python 3
Expand Down
9 changes: 7 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,16 @@ dependencies.

Supported Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^
Python >= 3.7
- Python 3.9
- Python 3.10
- Python 3.11
- Python 3.12
- Python 3.13
- Python 3.14

Deprecated Python Versions
^^^^^^^^^^^^^^^^^^^^^^^^^^
Python <= 3.6.
Python <= 3.8.

The last version of this library compatible with Python 2.7 is google-cloud-pubsub==1.7.0.

Expand Down
1 change: 1 addition & 0 deletions constraints-3.14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
grpcio >= 1.75.1
2 changes: 1 addition & 1 deletion google/cloud/pubsub_v1/subscriber/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class Scheduler(metaclass=abc.ABCMeta):

@property
@abc.abstractmethod
def queue(self) -> queue.Queue: # pragma: NO COVER
def queue(self) -> "queue.Queue": # pragma: NO COVER
"""Queue: A concurrency-safe queue specific to the underlying
concurrency implementation.

Expand Down
19 changes: 14 additions & 5 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@
DEFAULT_PYTHON_VERSION = "3.13"

UNIT_TEST_PYTHON_VERSIONS: List[str] = [
"3.7",
"3.8",
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand Down Expand Up @@ -234,7 +233,12 @@ def install_unittest_dependencies(session, *constraints):
def unit(session, protobuf_implementation):
# Install all test dependencies, then install this package in-place.

if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
if protobuf_implementation == "cpp" and session.python in (
"3.11",
"3.12",
"3.13",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
Expand Down Expand Up @@ -436,15 +440,20 @@ def docfx(session):
)


@nox.session(python="3.13")
@nox.session(python="3.14")
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
)
def prerelease_deps(session, protobuf_implementation):
"""Run all tests with prerelease versions of dependencies installed."""

if protobuf_implementation == "cpp" and session.python in ("3.11", "3.12", "3.13"):
if protobuf_implementation == "cpp" and session.python in (
"3.11",
"3.12",
"3.13",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

# Install all dependencies
Expand Down
2 changes: 1 addition & 1 deletion owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@
samples=True,
cov_level=99,
versions=gcp.common.detect_versions(path="./google", default_first=True),
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"],
unit_test_python_versions=["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
unit_test_dependencies=["flaky"],
system_test_python_versions=["3.12"],
system_test_external_dependencies=["psutil","flaky"],
Expand Down
14 changes: 6 additions & 8 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"grpcio >= 1.51.3, < 2.0.0", # https://github.com/googleapis/python-pubsub/issues/609
"grpcio >= 1.51.3, < 2.0.0; python_version < '3.14'", # https://github.com/googleapis/python-pubsub/issues/609
"grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
# google-api-core >= 1.34.0 is allowed in order to support google-api-core 1.x
"google-auth >= 2.14.1, <3.0.0",
"google-api-core[grpc] >= 1.34.0, <3.0.0,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
Expand All @@ -46,10 +47,8 @@
"protobuf>=3.20.2,<7.0.0,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"grpc-google-iam-v1 >= 0.12.4, < 1.0.0",
"grpcio-status >= 1.33.2",
"opentelemetry-api <= 1.22.0; python_version<='3.7'",
"opentelemetry-api >= 1.27.0; python_version>='3.8'",
"opentelemetry-sdk <= 1.22.0; python_version<='3.7'",
"opentelemetry-sdk >= 1.27.0; python_version>='3.8'",
"opentelemetry-api >= 1.27.0",
"opentelemetry-sdk >= 1.27.0",
]
extras = {"libcst": "libcst >= 0.3.10"}
url = "https://github.com/googleapis/python-pubsub"
Expand Down Expand Up @@ -81,21 +80,20 @@
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Operating System :: OS Independent",
"Topic :: Internet",
],
platforms="Posix; MacOS X; Windows",
packages=packages,
install_requires=dependencies,
extras_require=extras,
python_requires=">=3.7",
python_requires=">=3.9",
scripts=["scripts/fixup_pubsub_v1_keywords.py"],
include_package_data=True,
zip_safe=False,
Expand Down
13 changes: 0 additions & 13 deletions testing/constraints-3.7.txt

This file was deleted.

7 changes: 0 additions & 7 deletions testing/constraints-3.8.txt

This file was deleted.

9 changes: 4 additions & 5 deletions tests/unit/pubsub_v1/publisher/test_publisher_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,11 +308,10 @@ def test_opentelemetry_flow_control_exception(creds, span_exporter):
future2.result()

spans = span_exporter.get_finished_spans()
# Span 1 = Publisher Flow Control Span of first publish
# Span 2 = Publisher Batching Span of first publish
# Span 3 = Publisher Flow Control Span of second publish(raises FlowControlLimitError)
# Span 4 = Publish Create Span of second publish(raises FlowControlLimitError)
assert len(spans) == 4
# The number of spans created is non-deterministic.
# The first successful publish can create 2 or 4 spans. The second,
# failing publish creates 2 spans.
assert len(spans) in [4, 6]

failed_flow_control_span = spans[2]
finished_publish_create_span = spans[3]
Expand Down
Loading