Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ replacements:
"grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
"proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'",
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
],
"protobuf": ["protobuf >= 3.20.2, < 7.0.0"],
Expand Down Expand Up @@ -656,7 +656,7 @@ replacements:
grpcio==1.59.0
grpcio-status==1.59.0
proto-plus==1.22.3
protobuf==4.25.8
protobuf==6.33.5
grpc-google-iam-v1==0.14.0
opentelemetry-api==1.1.0
requests==2.22.0
Expand Down
2 changes: 1 addition & 1 deletion packages/bigframes/testing/constraints-3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ pluggy==1.6.0
prompt_toolkit==3.0.52
propcache==0.4.1
proto-plus==1.27.1
protobuf==4.25.8
protobuf==6.33.5
psygnal==0.15.1
ptyprocess==0.7.0
pure_eval==0.2.3
Expand Down
2 changes: 1 addition & 1 deletion packages/bigframes/testing/constraints-3.11.txt
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ prompt_toolkit==3.0.51
propcache==0.3.2
prophet==1.1.7
proto-plus==1.26.1
protobuf==5.29.5
protobuf==6.33.5
psutil==5.9.5
psycopg2==2.9.10
psygnal==0.14.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
_PACKAGE_DEPENDENCY_WARNINGS = [
DependencyConstraint(
"google.protobuf",
minimum_fully_supported_version="4.25.8",
minimum_fully_supported_version="6.33.5",
recommended_version="6.x",
)
]
Expand All @@ -52,7 +52,7 @@
def parse_version_to_tuple(version_string: str) -> ParsedVersion:
"""Safely converts a semantic version string to a comparable tuple of integers.

Example: "4.25.8" -> (4, 25, 8)
Example: "6.33.5" -> (6, 33, 5)
Ignores non-numeric parts and handles common version formats.

Args:
Expand Down
23 changes: 4 additions & 19 deletions packages/google-api-core/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,51 +289,36 @@ def default(

@nox.session(python=ALL_PYTHON)
@nox.parametrize(
["install_grpc", "install_async_rest", "python_versions", "legacy_proto"],
["install_grpc", "install_async_rest", "python_versions"],
[
(True, False, None, None), # Run unit tests with grpcio installed
(False, False, None, None), # Run unit tests without grpcio installed
(True, False, None), # Run unit tests with grpcio installed
(False, False, None), # Run unit tests without grpcio installed
(
True,
True,
None,
None,
), # Run unit tests with grpcio and async rest installed
# TODO: Remove once we stop support for protobuf 4.x.
(
True,
False,
["3.10", "3.11"],
4,
), # Run proto4 tests with grpcio/grpcio-gcp installed
Comment on lines 301 to 306

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This parameterized test case is redundant as it is a subset of the first test case (True, False, None). Please remove this block to avoid code redundancy.

References
  1. Remove duplicate lines of code, especially duplicate assertions in tests, to keep the codebase clean and avoid redundancy.

],
)
def unit(
session, install_grpc, install_async_rest, python_versions=None, legacy_proto=None
session, install_grpc, install_async_rest, python_versions=None
):
"""Run the unit test suite with the given configuration parameters.

If `python_versions` is provided, the test suite only runs when the Python version (xx.yy) is
one of the values in `python_versions`.

If `legacy_proto` is provided, this test suite will explicitly install the proto library at
that major version. Only a few values are supported at any one time; the intent is to test
deprecated but noyet abandoned versions.
"""

if python_versions and session.python not in python_versions:
session.log(f"Skipping session for Python {session.python}")
session.skip()

match legacy_proto:
case 4:
# Pin protobuf to a 4.x version to ensure coverage for the legacy code path.
session.install("protobuf>=4.25.8,<5.0.0")
case None | False:
pass
case _:
assert False, f"Unknown legacy_proto: {legacy_proto}"

default(
session=session,
install_grpc=install_grpc,
Expand Down
2 changes: 1 addition & 1 deletion packages/google-api-core/testing/constraints-3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
googleapis-common-protos==1.63.2
protobuf==5.29.6
protobuf==6.33.5
google-auth==2.14.1
requests==2.33.0
grpcio==1.41.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# e.g., if pyproject.toml has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
googleapis-common-protos==1.63.2
protobuf==5.29.6
protobuf==6.33.5
google-auth==2.14.1
requests==2.33.0
grpcio==1.41.0
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-access-context-manager/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
release_status = "Development Status :: 4 - Beta"
dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
]

# Setup boilerplate below this line.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
google-api-core==2.11.0
2 changes: 1 addition & 1 deletion packages/google-cloud-audit-log/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
version = "0.6.0"
release_status = "Development Status :: 4 - Beta"
dependencies = [
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
"googleapis-common-protos >= 1.56.2, < 2.0.0",
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
# Pin the version to the lower bound.
# e.g., if setup.py has "google-cloud-foo >= 1.14.0, < 2.0.0dev",
# Then this file should have google-cloud-foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
googleapis-common-protos==1.63.2
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ opentelemetry-api==1.16.0
opentelemetry-sdk==1.16.0
opentelemetry-instrumentation==0.41b0
proto-plus==1.22.3
protobuf==4.25.8
protobuf==6.33.5
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@

def parse_version_to_tuple(version_string: str):
"""Safely converts a semantic version string to a comparable tuple of integers.
Example: "4.25.8" -> (4, 25, 8)
Example: "6.33.5" -> (6, 33, 5)
Ignores non-numeric parts and handles common version formats.
Args:
version_string: Version string in the format "x.y.z" or "x.y.z<suffix>"
Expand Down Expand Up @@ -98,8 +98,8 @@ def _get_version(dependency_name):
return (None, "--")

_dependency_package = "google.protobuf"
_next_supported_version = "4.25.8"
_next_supported_version_tuple = (4, 25, 8)
_next_supported_version = "6.33.5"
_next_supported_version_tuple = (6, 33, 5)
_recommendation = " (we recommend 6.x)"
(_version_used, _version_used_string) = _get_version(_dependency_package)
if _version_used and _version_used < _next_supported_version_tuple:
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-logging/constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ grpcio==1.75.1
opentelemetry-api==1.16.0
proto-plus==1.22.3
proto-plus==1.25.0
protobuf==4.25.8
protobuf==6.33.5
2 changes: 1 addition & 1 deletion packages/google-cloud-ndb/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def main():
dependencies = [
"google-api-core[grpc] >= 2.11.0, <3.0.0",
"google-cloud-datastore >= 2.16.0, != 2.20.2, < 3.0.0",
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
"pymemcache >= 2.1.0, < 5.0.0",
"pytz >= 2022.1",
"redis >= 3.0.0, < 8.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/google-cloud-ndb/testing/constraints-3.10.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# Then this file should have foo==1.14.0
google-cloud-datastore==2.16.0
google-api-core==2.11.0
protobuf==4.25.8
protobuf==6.33.5
pymemcache==2.1.0
redis==3.0.0
pytz==2022.1
Expand Down
4 changes: 2 additions & 2 deletions packages/google-cloud-storage/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@
"grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
"proto-plus >= 1.22.3, <2.0.0; python_version < '3.13'",
"proto-plus >= 1.25.0, <2.0.0; python_version >= '3.13'",
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
"grpc-google-iam-v1 >= 0.14.0, <1.0.0",
],
"protobuf": ["protobuf >= 3.20.2, < 7.0.0"],
"protobuf": ["protobuf >= 6.33.5, < 8.0.0"],
"tracing": [
"opentelemetry-api >= 1.1.0, < 2.0.0",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ google-resumable-media==2.7.2
grpcio==1.59.0
grpcio-status==1.59.0
proto-plus==1.22.3
protobuf==4.25.8
protobuf==6.33.5
grpc-google-iam-v1==0.14.0
opentelemetry-api==1.1.0
requests==2.22.0
Expand Down
26 changes: 2 additions & 24 deletions packages/googleapis-common-protos/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,30 +210,16 @@ def install_unittest_dependencies(session, *constraints):
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
["python", "upb"],
)
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",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

# TODO(https://github.com/googleapis/synthtool/issues/1976):
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
# The 'cpp' implementation requires Protobuf<4.
if protobuf_implementation == "cpp":
session.install("protobuf<4")

# Run py.test against the unit tests.
session.run(
"py.test",
Expand Down Expand Up @@ -423,7 +409,7 @@ def docfx(session):
@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
["python", "upb"],
)
def prerelease_deps(session, protobuf_implementation):
"""
Expand All @@ -433,14 +419,6 @@ def prerelease_deps(session, protobuf_implementation):
`pip install --pre <package>`.
"""

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
session.install("-e", ".")

Expand Down
2 changes: 1 addition & 1 deletion packages/googleapis-common-protos/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ classifiers = [
"Topic :: Internet",
]
dependencies = [
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
grpcio==1.51.3
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
grpcio==1.44.0
26 changes: 2 additions & 24 deletions packages/grpc-google-iam-v1/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,30 +210,16 @@ def install_unittest_dependencies(session, *constraints):
@nox.session(python=UNIT_TEST_PYTHON_VERSIONS)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
["python", "upb"],
)
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",
"3.14",
):
session.skip("cpp implementation is not supported in python 3.11+")

constraints_path = str(
CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
)
install_unittest_dependencies(session, "-c", constraints_path)

# TODO(https://github.com/googleapis/synthtool/issues/1976):
# Remove the 'cpp' implementation once support for Protobuf 3.x is dropped.
# The 'cpp' implementation requires Protobuf<4.
if protobuf_implementation == "cpp":
session.install("protobuf<4")

# Run py.test against the unit tests.
session.run(
"py.test",
Expand Down Expand Up @@ -423,7 +409,7 @@ def docfx(session):
@nox.session(python=DEFAULT_PYTHON_VERSION)
@nox.parametrize(
"protobuf_implementation",
["python", "upb", "cpp"],
["python", "upb"],
)
def prerelease_deps(session, protobuf_implementation):
"""
Expand All @@ -433,14 +419,6 @@ def prerelease_deps(session, protobuf_implementation):
`pip install --pre <package>`.
"""

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
session.install("-e", ".")

Expand Down
2 changes: 1 addition & 1 deletion packages/grpc-google-iam-v1/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ classifiers = [
dependencies = [
"grpcio >= 1.44.0, < 2.0.0",
"googleapis-common-protos[grpc] >= 1.63.2, < 2.0.0",
"protobuf >= 4.25.8, < 8.0.0",
"protobuf >= 6.33.5, < 8.0.0",
]

[project.urls]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
grpcio==1.51.3
2 changes: 1 addition & 1 deletion packages/grpc-google-iam-v1/testing/constraints-3.9.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
#
# e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev",
# Then this file should have foo==1.14.0
protobuf==4.25.8
protobuf==6.33.5
grpcio==1.44.0
Loading
Loading