Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
119d155
chore: add support for python 3.14
ohmayr Oct 10, 2025
face4f7
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
4955cb9
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
727ae5d
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
e15caae
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
9ee84f1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 10, 2025
5ff43ff
Edited client library files for 3.14 support
gkevinzheng Oct 20, 2025
f230636
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
e157972
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
c23eeee
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
89d3996
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
848d7a1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
5f346a6
Noxfile changes
gkevinzheng Oct 20, 2025
dff44bb
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
f6c6fae
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
2c44a75
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
02016f1
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
fcd47fa
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 20, 2025
d5cf0e5
Updated owlbot version
gkevinzheng Oct 21, 2025
0438b64
Updated default python version in noxfile
gkevinzheng Oct 21, 2025
958da36
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Oct 21, 2025
bf38343
Fixed system test version in owlbot.py
gkevinzheng Oct 21, 2025
e96df9f
Fixed noxfile version + samples test sink cleanup
gkevinzheng Oct 21, 2025
903c532
Disabled protobuf cpp testing for 3.14
gkevinzheng Oct 21, 2025
a3b49f4
Fixed linting errors
gkevinzheng Oct 21, 2025
cc41714
Use bucket.delete_blobs instead of deleting blobs individually
gkevinzheng Oct 22, 2025
4f618b2
Force delete buckets
gkevinzheng Oct 29, 2025
1520cd1
Merge remote-tracking branch 'origin/main' into add-314-support
parthea Nov 12, 2025
5c996f8
set python 3.14 as the default version
parthea Nov 12, 2025
3af9757
🦉 Updates from OwlBot post-processor
gcf-owl-bot[bot] Nov 12, 2025
e6e5d63
set python 3.14 as the default version for system tests
parthea Nov 12, 2025
3e16ec9
Merge branch 'main' into sanche-add-314-support
daniel-sanche Dec 12, 2025
443d324
fixed multiprocessing in tests
daniel-sanche Dec 12, 2025
6cec435
Update setup.py
daniel-sanche Dec 12, 2025
5f73874
re-applied librarian changes
daniel-sanche Dec 12, 2025
9fa784c
update version for skip
daniel-sanche Dec 12, 2025
eefccba
revert new dependencies
daniel-sanche Dec 12, 2025
5468c4e
changed librarian system test version
daniel-sanche Dec 12, 2025
c8f2bf1
fixed lint
daniel-sanche Dec 12, 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
60 changes: 60 additions & 0 deletions .kokoro/samples/python3.14/common.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Format: //devtools/kokoro/config/proto/build.proto

# Build logs will be here
action {
define_artifacts {
regex: "**/*sponge_log.xml"
}
}

# Specify which tests to run
env_vars: {
key: "RUN_TESTS_SESSION"
value: "py-3.14"
}

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

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-logging/.kokoro/test-samples.sh"
}

# Configure the docker image for kokoro-trampoline.
env_vars: {
key: "TRAMPOLINE_IMAGE"
value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker"
}

# Download secrets for samples
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples"

# Download trampoline resources.
gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline"

# Use the trampoline script to run in docker.
build_file: "python-logging/.kokoro/trampoline_v2.sh"


#############################################
# this section merged from .kokoro/common_env_vars.cfg using owlbot.py

env_vars: {
key: "PRODUCT_AREA_LABEL"
value: "observability"
}
env_vars: {
key: "PRODUCT_LABEL"
value: "logging"
}
env_vars: {
key: "LANGUAGE_LABEL"
value: "python"
}

###################################################

6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/continuous.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
11 changes: 11 additions & 0 deletions .kokoro/samples/python3.14/periodic-head.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}

env_vars: {
key: "TRAMPOLINE_BUILD_FILE"
value: "github/python-logging/.kokoro/test-samples-against-head.sh"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/periodic.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "False"
}
6 changes: 6 additions & 0 deletions .kokoro/samples/python3.14/presubmit.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Format: //devtools/kokoro/config/proto/build.proto

env_vars: {
key: "INSTALL_LIBRARY_FROM_SOURCE"
value: "True"
}
3 changes: 2 additions & 1 deletion .librarian/generator-input/librarian.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ def place_before(path, text, *before_text, escape=None):
"google-cloud-testutils",
"opentelemetry-sdk"
],
system_test_python_versions=["3.12"],
system_test_python_versions=["3.14"],
unit_test_python_versions=["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"],
unit_test_external_dependencies=["flask", "webob", "django"],
samples=True,
)
Expand Down
10 changes: 6 additions & 4 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.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
Expand Down Expand Up @@ -72,7 +72,7 @@ We use `nox <https://nox.readthedocs.io/en/latest/>`__ to instrument our tests.

- To run a single unit test::

$ nox -s unit-3.13 -- -k <name of test>
$ nox -s unit-3.14 -- -k <name of test>


.. note::
Expand Down Expand Up @@ -143,12 +143,12 @@ Running System Tests
$ nox -s system

# Run a single system test
$ nox -s system-3.12 -- -k <name of test>
$ nox -s system-3.14 -- -k <name of test>


.. note::

System tests are only configured to run under Python 3.12.
System tests are only configured to run under Python 3.14.
For expediency, we do not run them in older versions of Python 3.

This alone will not run the tests. You'll need to change some local
Expand Down Expand Up @@ -228,6 +228,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/
Expand All @@ -236,6 +237,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`_.
Expand Down
23 changes: 15 additions & 8 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,15 @@
ISORT_VERSION = "isort==5.11.0"
LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"]

DEFAULT_PYTHON_VERSION = "3.10"
DEFAULT_PYTHON_VERSION = "3.14"

UNIT_TEST_PYTHON_VERSIONS: List[str] = [
"3.9",
"3.10",
"3.11",
"3.12",
"3.13",
"3.14",
]
UNIT_TEST_STANDARD_DEPENDENCIES = [
"mock",
Expand All @@ -58,7 +59,7 @@
UNIT_TEST_EXTRAS: List[str] = []
UNIT_TEST_EXTRAS_BY_PYTHON: Dict[str, List[str]] = {}

SYSTEM_TEST_PYTHON_VERSIONS: List[str] = ["3.12"]
SYSTEM_TEST_PYTHON_VERSIONS: List[str] = [DEFAULT_PYTHON_VERSION]
SYSTEM_TEST_STANDARD_DEPENDENCIES: List[str] = [
"mock",
"pytest",
Expand All @@ -79,7 +80,12 @@
CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute()

nox.options.sessions = [
"unit",
"unit-3.9",
"unit-3.10",
"unit-3.11",
"unit-3.12",
"unit-3.13",
"unit-3.14",
"system",
"cover",
"lint",
Expand Down Expand Up @@ -143,7 +149,7 @@ def format(session):
@nox.session(python=DEFAULT_PYTHON_VERSION)
def lint_setup_py(session):
"""Verify that setup.py is valid (including RST check)."""
session.install("docutils", "pygments")
session.install("setuptools", "docutils", "pygments")
session.run("python", "setup.py", "check", "--restructuredtext", "--strict")


Expand Down Expand Up @@ -182,8 +188,8 @@ 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"):
py_version = tuple([int(v) for v in session.python.split(".")])
if protobuf_implementation == "cpp" and py_version >= (3, 11):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
Expand Down Expand Up @@ -383,15 +389,16 @@ def docfx(session):
)


@nox.session(python="3.13")
@nox.session(python=DEFAULT_PYTHON_VERSION)
@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"):
py_version = tuple([int(v) for v in session.python.split(".")])
if protobuf_implementation == "cpp" and py_version >= (3, 11):
session.skip("cpp implementation is not supported in python 3.11+")

# Install all dependencies
Expand Down
6 changes: 3 additions & 3 deletions samples/snippets/export_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ def _create_sink_name():


@backoff.on_exception(backoff.expo, Exception, max_time=60, raise_on_giveup=False)
def _delete_object(obj):
obj.delete()
def _delete_object(obj, **kwargs):
obj.delete(**kwargs)


# Runs once for entire test suite
Expand Down Expand Up @@ -79,7 +79,7 @@ def cleanup_old_sinks():
# Bucket timestamp is int(time.time() * 1000)
bucket_timestamp = int(match.group(1))
if TIMESTAMP - bucket_timestamp // 1000 > CLEANUP_THRESHOLD:
_delete_object(bucket)
_delete_object(bucket, force=True)


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion samples/snippets/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pytest_env_vars() -> Dict[str, str]:

# DO NOT EDIT - automatically generated.
# All versions used to test samples.
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
ALL_VERSIONS = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

# Any default versions that should be ignored.
IGNORED_VERSIONS = TEST_CONFIG["ignored_versions"]
Expand Down
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"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",
],
Expand Down
16 changes: 16 additions & 0 deletions testing/constraints-3.14.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# -*- coding: utf-8 -*-
# This constraints file is required for unit tests.
# List all library dependencies and extras in this file.
google-api-core
google-auth
proto-plus
protobuf
google-cloud-core
google-cloud-appengine-logging
google-cloud-audit-log
grpc-google-iam-v1
opentelemetry-api

# optional dependencies
django
flask
12 changes: 7 additions & 5 deletions tests/system/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,8 +721,9 @@ def test_log_handler_otel_integration(self):
self.assertTrue(entries[0].trace_sampled, expected_tracesampled)

def test_log_handler_close(self):
from multiprocessing import Process
import multiprocessing

ctx = multiprocessing.get_context("fork")
LOG_MESSAGE = "This is a test of handler.close before exiting."
LOGGER_NAME = "close-test"
handler_name = self._logger_name(LOGGER_NAME)
Expand All @@ -746,16 +747,17 @@ def subprocess_main():
cloud_logger.warning(LOG_MESSAGE)
handler.close()

proc = Process(target=subprocess_main)
proc = ctx.Process(target=subprocess_main)
proc.start()
proc.join()
entries = _list_entries(logger)
self.assertEqual(len(entries), 1)
self.assertEqual(entries[0].payload, LOG_MESSAGE)

def test_log_client_flush_handlers(self):
from multiprocessing import Process
import multiprocessing

ctx = multiprocessing.get_context("fork")
LOG_MESSAGE = "This is a test of client.flush_handlers before exiting."
LOGGER_NAME = "close-test"
handler_name = self._logger_name(LOGGER_NAME)
Expand All @@ -779,7 +781,7 @@ def subprocess_main():
cloud_logger.warning(LOG_MESSAGE)
Config.CLIENT.flush_handlers()

proc = Process(target=subprocess_main)
proc = ctx.Process(target=subprocess_main)
proc.start()
proc.join()
entries = _list_entries(logger)
Expand Down Expand Up @@ -1058,7 +1060,7 @@ def retryable():
# http and gapic results should be consistent
self.assertEqual(gapic_list[0].insert_id, http_list[0].insert_id)
# returned logs should be in descending order
self.assertEqual(gapic_list[0].payload, f"test {log_count-1}")
self.assertEqual(gapic_list[0].payload, f"test {log_count - 1}")

RetryErrors(
(ServiceUnavailable, InternalServerError, AssertionError),
Expand Down
Loading