From 84ba2b4f8edf0082e9cdfa4c3b57fef36f316b3a Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 26 Nov 2025 15:51:32 +0000 Subject: [PATCH 1/5] tests: update default python runtime to 3.14 --- .github/workflows/lint.yml | 2 +- .github/workflows/mypy.yml | 2 +- .github/workflows/unittest.yml | 2 +- noxfile.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1051da0bd..3ed755f00 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.14" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/mypy.yml b/.github/workflows/mypy.yml index e6a79291d..8363e7218 100644 --- a/.github/workflows/mypy.yml +++ b/.github/workflows/mypy.yml @@ -12,7 +12,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.14" - name: Install nox run: | python -m pip install --upgrade setuptools pip wheel diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml index f260a6a55..f654277bb 100644 --- a/.github/workflows/unittest.yml +++ b/.github/workflows/unittest.yml @@ -66,7 +66,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v5 with: - python-version: "3.10" + python-version: "3.14" - name: Install coverage run: | python -m pip install --upgrade setuptools pip wheel diff --git a/noxfile.py b/noxfile.py index 04347a4f3..0b62cd2d7 100644 --- a/noxfile.py +++ b/noxfile.py @@ -30,7 +30,7 @@ PYTHON_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"] -DEFAULT_PYTHON_VERSION = "3.10" +DEFAULT_PYTHON_VERSION = "3.14" CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() # 'docfx' is excluded since it only needs to run in 'docs-presubmit' From 62be30b9da357d3bae6d27d175b8fcb431e782fb Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 26 Nov 2025 15:53:52 +0000 Subject: [PATCH 2/5] bump black version --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 0b62cd2d7..0f508060a 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,7 +23,7 @@ import nox # pytype: disable=import-error -BLACK_VERSION = "black==22.3.0" +BLACK_VERSION = "black==23.7.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] # Black and flake8 clash on the syntax for ignoring flake8's F401 in this file. BLACK_EXCLUDES = ["--exclude", "^/google/api_core/operations_v1/__init__.py"] From 1296678fdc86df98faed4459262bcf34c5015cab Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 26 Nov 2025 15:55:19 +0000 Subject: [PATCH 3/5] run black --- google/api_core/grpc_helpers_async.py | 2 +- google/api_core/operation.py | 2 +- google/api_core/operations_v1/pagers.py | 2 +- google/api_core/operations_v1/pagers_async.py | 2 +- google/api_core/operations_v1/pagers_base.py | 2 +- tests/asyncio/test_rest_streaming_async.py | 2 -- tests/unit/operations_v1/test_operations_rest_client.py | 3 --- tests/unit/test_client_logging.py | 1 - tests/unit/test_client_options.py | 2 -- tests/unit/test_page_iterator.py | 1 - 10 files changed, 5 insertions(+), 14 deletions(-) diff --git a/google/api_core/grpc_helpers_async.py b/google/api_core/grpc_helpers_async.py index 312d4df80..9e1ad1105 100644 --- a/google/api_core/grpc_helpers_async.py +++ b/google/api_core/grpc_helpers_async.py @@ -220,7 +220,7 @@ def create_channel( default_host=None, compression=None, attempt_direct_path: Optional[bool] = False, - **kwargs + **kwargs, ): """Create an AsyncIO secure channel with credentials. diff --git a/google/api_core/operation.py b/google/api_core/operation.py index 4b9c9a58b..5206243a7 100644 --- a/google/api_core/operation.py +++ b/google/api_core/operation.py @@ -78,7 +78,7 @@ def __init__( result_type, metadata_type=None, polling=polling.DEFAULT_POLLING, - **kwargs + **kwargs, ): super(Operation, self).__init__(polling=polling, **kwargs) self._operation = operation diff --git a/google/api_core/operations_v1/pagers.py b/google/api_core/operations_v1/pagers.py index 132f1c664..76efd5946 100644 --- a/google/api_core/operations_v1/pagers.py +++ b/google/api_core/operations_v1/pagers.py @@ -48,7 +48,7 @@ def __init__( request: operations_pb2.ListOperationsRequest, response: operations_pb2.ListOperationsResponse, *, - metadata: Sequence[Tuple[str, str]] = () + metadata: Sequence[Tuple[str, str]] = (), ): super().__init__( method=method, request=request, response=response, metadata=metadata diff --git a/google/api_core/operations_v1/pagers_async.py b/google/api_core/operations_v1/pagers_async.py index e2909dd50..4bb7f8c7d 100644 --- a/google/api_core/operations_v1/pagers_async.py +++ b/google/api_core/operations_v1/pagers_async.py @@ -48,7 +48,7 @@ def __init__( request: operations_pb2.ListOperationsRequest, response: operations_pb2.ListOperationsResponse, *, - metadata: Sequence[Tuple[str, str]] = () + metadata: Sequence[Tuple[str, str]] = (), ): super().__init__( method=method, request=request, response=response, metadata=metadata diff --git a/google/api_core/operations_v1/pagers_base.py b/google/api_core/operations_v1/pagers_base.py index 24caf74f2..5ef8384ef 100644 --- a/google/api_core/operations_v1/pagers_base.py +++ b/google/api_core/operations_v1/pagers_base.py @@ -47,7 +47,7 @@ def __init__( request: operations_pb2.ListOperationsRequest, response: operations_pb2.ListOperationsResponse, *, - metadata: Sequence[Tuple[str, str]] = () + metadata: Sequence[Tuple[str, str]] = (), ): """Instantiate the pager. diff --git a/tests/asyncio/test_rest_streaming_async.py b/tests/asyncio/test_rest_streaming_async.py index c9caa2b15..13549c7f9 100644 --- a/tests/asyncio/test_rest_streaming_async.py +++ b/tests/asyncio/test_rest_streaming_async.py @@ -292,7 +292,6 @@ async def test_next_escaped_characters_in_string( @pytest.mark.asyncio @pytest.mark.parametrize("response_type", [EchoResponse, httpbody_pb2.HttpBody]) async def test_next_not_array(response_type): - data = '{"hello": 0}' with mock.patch.object( ResponseMock, "content", return_value=mock_async_gen(data) @@ -352,7 +351,6 @@ async def test_check_buffer(response_type, return_value): @pytest.mark.asyncio @pytest.mark.parametrize("response_type", [EchoResponse, httpbody_pb2.HttpBody]) async def test_next_html(response_type): - data = "" with mock.patch.object( ResponseMock, "content", return_value=mock_async_gen(data) diff --git a/tests/unit/operations_v1/test_operations_rest_client.py b/tests/unit/operations_v1/test_operations_rest_client.py index 87523c5dd..2b96d4edc 100644 --- a/tests/unit/operations_v1/test_operations_rest_client.py +++ b/tests/unit/operations_v1/test_operations_rest_client.py @@ -226,7 +226,6 @@ def test_operations_client_service_account_always_use_jwt(transport_class): PYPARAM_CLIENT, ) def test_operations_client_from_service_account_file(client_class): - if "async" in str(client_class): # TODO(): Add support for service account creds to async REST transport. with pytest.raises(NotImplementedError): @@ -547,7 +546,6 @@ def test_operations_client_client_options_credentials_file( # TODO(): Add support for credentials file to async REST transport. with pytest.raises(core_exceptions.AsyncRestUnsupportedParameterError): with warn_deprecated_credentials_file(): - client_class(client_options=options, transport=transport_name) else: with mock.patch.object(transport_class, "__init__") as patched: @@ -1089,7 +1087,6 @@ async def test_cancel_operation_rest_failure_async(): PYPARAM_CLIENT_TRANSPORT_CREDENTIALS, ) def test_credentials_transport_error(client_class, transport_class, credentials): - # It is an error to provide credentials and a transport instance. transport = transport_class(credentials=credentials) with pytest.raises(ValueError): diff --git a/tests/unit/test_client_logging.py b/tests/unit/test_client_logging.py index b3b0b5c8e..c73b269fe 100644 --- a/tests/unit/test_client_logging.py +++ b/tests/unit/test_client_logging.py @@ -88,7 +88,6 @@ def test_setup_logging_w_incorrect_scope(): def test_initialize_logging(): - with mock.patch("os.getenv", return_value="foogle.bar"): with mock.patch("google.api_core.client_logging._BASE_LOGGER_NAME", "foogle"): initialize_logging() diff --git a/tests/unit/test_client_options.py b/tests/unit/test_client_options.py index 58b0286cb..54558eea0 100644 --- a/tests/unit/test_client_options.py +++ b/tests/unit/test_client_options.py @@ -55,7 +55,6 @@ def test_constructor(): def test_constructor_with_encrypted_cert_source(): - options = client_options.ClientOptions( api_endpoint="foo.googleapis.com", client_encrypted_cert_source=get_client_encrypted_cert, @@ -79,7 +78,6 @@ def test_constructor_with_both_cert_sources(): def test_constructor_with_api_key(): - options = client_options.ClientOptions( api_endpoint="foo.googleapis.com", client_cert_source=get_client_cert, diff --git a/tests/unit/test_page_iterator.py b/tests/unit/test_page_iterator.py index 560722c5d..ba0fbba4f 100644 --- a/tests/unit/test_page_iterator.py +++ b/tests/unit/test_page_iterator.py @@ -360,7 +360,6 @@ def test__has_next_page_w_max_results_not_done(self): assert iterator._has_next_page() def test__has_next_page_w_max_results_done(self): - iterator = page_iterator.HTTPIterator( mock.sentinel.client, mock.sentinel.api_request, From 2a2f0df29b0d0bec3184ba167b28e07a604d5249 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 26 Nov 2025 15:57:36 +0000 Subject: [PATCH 4/5] add setuptools to lint_setup_py nox session --- noxfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/noxfile.py b/noxfile.py index 0f508060a..37ef2caf9 100644 --- a/noxfile.py +++ b/noxfile.py @@ -261,7 +261,7 @@ def unit_w_async_rest_extra(session): def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" - session.install("docutils", "Pygments") + session.install("docutils", "Pygments", "setuptools") session.run("python", "setup.py", "check", "--restructuredtext", "--strict") From ef010c8d2f9ea678d40f77e7d0dfadd76dc82d87 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Wed, 26 Nov 2025 16:10:11 +0000 Subject: [PATCH 5/5] update contributing guide --- CONTRIBUTING.rst | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 1a1f608b6..0ac24bc08 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -21,7 +21,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.7, 3.8, 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 @@ -204,6 +204,7 @@ We support: - `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/ @@ -212,6 +213,7 @@ We support: .. _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`_.