From bf15ff10a0a0fee025d332242675b9127111fb66 Mon Sep 17 00:00:00 2001 From: abbrowne126 <81702808+abbrowne126@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:21:25 -0500 Subject: [PATCH 1/2] chore: fix noxfile pin --- noxfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/noxfile.py b/noxfile.py index d1b3c15d1..0e3b8d8cd 100644 --- a/noxfile.py +++ b/noxfile.py @@ -363,8 +363,7 @@ def cover(session): session.run("coverage", "erase") -# py > 3.10 not supported yet -@nox.session(python="3.10") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" From a5163f545f83514e745c3ba9273bf96bcc627e10 Mon Sep 17 00:00:00 2001 From: abbrowne126 <81702808+abbrowne126@users.noreply.github.com> Date: Thu, 22 Jan 2026 15:27:47 -0500 Subject: [PATCH 2/2] chore: remove all mentions of py3.7+py3.8 that aren't autogenerated --- .github/sync-repo-settings.yaml | 4 ---- .kokoro/samples/python3.7/common.cfg | 4 ++-- .librarian/generator-input/librarian.py | 2 +- .librarian/generator-input/noxfile.py | 2 -- .librarian/generator-input/setup.py | 10 +++------- CONTRIBUTING.rst | 6 +----- README.rst | 12 +++++++----- librarian.py | 14 +++++++++++--- mypy.ini | 2 +- noxfile.py | 2 -- samples/snippets/requirements-test.txt | 7 ++----- samples/snippets/requirements.txt | 12 +++--------- scripts/readme-gen/templates/install_deps.tmpl.rst | 2 +- setup.py | 10 +++------- 14 files changed, 35 insertions(+), 54 deletions(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index bfde18cc0..ecc31984d 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -11,8 +11,6 @@ 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' @@ -21,8 +19,6 @@ branchProtectionRules: - 'docs' - 'docfx' - 'lint' - - 'unit (3.7)' - - 'unit (3.8)' - 'unit (3.9)' - 'unit (3.10)' - 'unit (3.11)' diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg index 9156c5975..bef43522b 100644 --- a/.kokoro/samples/python3.7/common.cfg +++ b/.kokoro/samples/python3.7/common.cfg @@ -10,7 +10,7 @@ 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. @@ -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" \ No newline at end of file +build_file: "python-pubsub/.kokoro/trampoline_v2.sh" diff --git a/.librarian/generator-input/librarian.py b/.librarian/generator-input/librarian.py index 5e6af7955..612003377 100644 --- a/.librarian/generator-input/librarian.py +++ b/.librarian/generator-input/librarian.py @@ -326,7 +326,7 @@ if count < 1: raise Exception(".coveragerc replacement failed.") - s.move([library], excludes=["noxfile.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"]) + s.move([library], excludes=["noxfile.py", "README.rst", "docs/**/*", "setup.py"]) s.remove_staging_dirs() # ---------------------------------------------------------------------------- diff --git a/.librarian/generator-input/noxfile.py b/.librarian/generator-input/noxfile.py index fd552166c..170360d6f 100644 --- a/.librarian/generator-input/noxfile.py +++ b/.librarian/generator-input/noxfile.py @@ -37,8 +37,6 @@ DEFAULT_PYTHON_VERSION = "3.14" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.7", - "3.8", "3.9", "3.10", "3.11", diff --git a/.librarian/generator-input/setup.py b/.librarian/generator-input/setup.py index dd2809f82..761bc90ce 100644 --- a/.librarian/generator-input/setup.py +++ b/.librarian/generator-input/setup.py @@ -47,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" @@ -82,8 +80,6 @@ "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", @@ -97,7 +93,7 @@ packages=packages, install_requires=dependencies, extras_require=extras, - python_requires=">=3.7", + python_requires=">=3.9", include_package_data=True, zip_safe=False, ) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 417b1e9f8..e4c9a7009 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -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, 3.13 and 3.14 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 @@ -221,8 +221,6 @@ Supported Python Versions We support: -- `Python 3.7`_ -- `Python 3.8`_ - `Python 3.9`_ - `Python 3.10`_ - `Python 3.11`_ @@ -230,8 +228,6 @@ We support: - `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/ diff --git a/README.rst b/README.rst index 97010e998..86ea7e48e 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Python Client for Google Cloud Pub / Sub ======================================== -|GA| |pypi| |versions| +|GA| |pypi| |versions| `Google Cloud Pub / Sub`_ is a fully-managed real-time messaging service that allows you to send and receive messages between independent applications. You @@ -60,11 +60,13 @@ dependencies. Supported Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^ -Python >= 3.7 +Python >= 3.9 Deprecated Python Versions ^^^^^^^^^^^^^^^^^^^^^^^^^^ -Python <= 3.6. +Python < 3.9 + +The last version of this library compatible with Python 3.7 and 3.8 is google-cloud-pubsub==2.34.0. The last version of this library compatible with Python 2.7 is google-cloud-pubsub==1.7.0. @@ -146,7 +148,7 @@ the topic, and subscribe to that, passing a callback function. with pubsub_v1.SubscriberClient() as subscriber: subscriber.create_subscription( - name=subscription_name, topic=topic_name) + name=subscription_name, topic=topic_name) future = subscriber.subscribe(subscription_name, callback) The future returned by the call to ``subscriber.subscribe`` can be used to @@ -190,7 +192,7 @@ For example, to use JSON Web Tokens, provide a `google.auth.jwt.Credentials`_ in # The same for the publisher, except that the "audience" claim needs to be adjusted publisher_audience = "https://pubsub.googleapis.com/google.pubsub.v1.Publisher" - credentials_pub = credentials.with_claims(audience=publisher_audience) + credentials_pub = credentials.with_claims(audience=publisher_audience) publisher = pubsub_v1.PublisherClient(credentials=credentials_pub) .. _Credentials: https://google-auth.readthedocs.io/en/latest/reference/google.auth.credentials.html#google.auth.credentials.Credentials diff --git a/librarian.py b/librarian.py index 5e6af7955..ecaa36d0e 100644 --- a/librarian.py +++ b/librarian.py @@ -326,7 +326,15 @@ if count < 1: raise Exception(".coveragerc replacement failed.") - s.move([library], excludes=["noxfile.py", "README.rst", "docs/**/*", "setup.py", "testing/constraints-3.7.txt", "testing/constraints-3.8.txt"]) + s.move( + [library], + excludes=[ + "noxfile.py", + "README.rst", + "docs/**/*", + "setup.py", + ], + ) s.remove_staging_dirs() # ---------------------------------------------------------------------------- @@ -338,10 +346,10 @@ 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", "3.14"], + 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"], + system_test_external_dependencies=["psutil", "flaky"], ) s.move(templated_files, excludes=[".coveragerc", ".github/**", "README.rst", "docs/**", ".kokoro/**"]) diff --git a/mypy.ini b/mypy.ini index 574c5aed3..a3cb5c292 100644 --- a/mypy.ini +++ b/mypy.ini @@ -1,3 +1,3 @@ [mypy] -python_version = 3.7 +python_version = 3.14 namespace_packages = True diff --git a/noxfile.py b/noxfile.py index 0e3b8d8cd..ed5fdd609 100644 --- a/noxfile.py +++ b/noxfile.py @@ -41,8 +41,6 @@ DEFAULT_PYTHON_VERSION = "3.14" UNIT_TEST_PYTHON_VERSIONS: List[str] = [ - "3.7", - "3.8", "3.9", "3.10", "3.11", diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 7659e3676..a4969d6fe 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1,9 +1,6 @@ backoff==2.2.1 -pytest===7.4.4; python_version == '3.7' -pytest===8.3.5; python_version == '3.8' -pytest==8.4.2; python_version >= '3.9' +pytest==8.4.2 mock==5.2.0 flaky==3.8.1 -google-cloud-bigquery===3.30.0; python_version <= '3.8' -google-cloud-bigquery==3.38.0; python_version >= '3.9' +google-cloud-bigquery==3.38.0 google-cloud-storage==3.4.0 diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 63a78cd67..997d5a201 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1,13 +1,7 @@ google-cloud-pubsub==2.31.1 avro==1.12.0 -protobuf===4.24.4; python_version == '3.7' -protobuf===5.29.4; python_version == '3.8' -protobuf==6.32.1; python_version >= '3.9' +protobuf==6.32.1 avro==1.12.0 -opentelemetry-api===1.22.0; python_version == '3.7' -opentelemetry-sdk===1.22.0; python_version == '3.7' -opentelemetry-api===1.33.1; python_version == '3.8' -opentelemetry-sdk===1.33.1; python_version == '3.8' -opentelemetry-api==1.37.0; python_version >= '3.9' -opentelemetry-sdk==1.37.0; python_version >= '3.9' +opentelemetry-api==1.37.0 +opentelemetry-sdk==1.37.0 opentelemetry-exporter-gcp-trace==1.9.0 diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst index 6f069c6c8..f21db80c4 100644 --- a/scripts/readme-gen/templates/install_deps.tmpl.rst +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -12,7 +12,7 @@ Install Dependencies .. _Python Development Environment Setup Guide: https://cloud.google.com/python/setup -#. Create a virtualenv. Samples are compatible with Python 3.7+. +#. Create a virtualenv. Samples are compatible with Python 3.9+. .. code-block:: bash diff --git a/setup.py b/setup.py index 74a11ebf6..0d9ae4e58 100644 --- a/setup.py +++ b/setup.py @@ -51,10 +51,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.", + "opentelemetry-sdk >= 1.27.0", ] extras = {"libcst": "libcst >= 0.3.10"} url = "https://github.com/googleapis/python-pubsub" @@ -86,8 +84,6 @@ "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", @@ -101,7 +97,7 @@ packages=packages, install_requires=dependencies, extras_require=extras, - python_requires=">=3.7", + python_requires=">=3.9", include_package_data=True, zip_safe=False, )