Skip to content

fix: allow Protobuf 6.x #1320

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Mar 10, 2025
28 changes: 26 additions & 2 deletions owlbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,18 @@ def place_before(path, text, *before_text, escape=None):
"""@nox.session\(python=SYSTEM_TEST_PYTHON_VERSIONS\)
def system\(session\):""",
"""@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS)
@nox.parametrize("database_dialect", ["GOOGLE_STANDARD_SQL", "POSTGRESQL"])
def system(session, database_dialect):""",
@nox.parametrize(
"protobuf_implementation,database_dialect",
[
("python", "GOOGLE_STANDARD_SQL"),
("python", "POSTGRESQL"),
("upb", "GOOGLE_STANDARD_SQL"),
("upb", "POSTGRESQL"),
("cpp", "GOOGLE_STANDARD_SQL"),
("cpp", "POSTGRESQL"),
],
)
def system(session, protobuf_implementation, database_dialect):""",
)

s.replace(
Expand All @@ -248,6 +258,7 @@ def system(session, database_dialect):""",
\)""",
"""*session.posargs,
env={
"PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION": protobuf_implementation,
"SPANNER_DATABASE_DIALECT": database_dialect,
"SKIP_BACKUP_TESTS": "true",
},
Expand Down Expand Up @@ -345,6 +356,19 @@ def mockserver(session):
escape="()_*:",
)

s.replace(
"noxfile.py",
"install_systemtest_dependencies\(session, \"-c\", constraints_path\)",
"""install_systemtest_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")
"""
)

place_before(
"noxfile.py",
"UNIT_TEST_PYTHON_VERSIONS: List[str] = [",
Expand Down
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
release_status = "Development Status :: 5 - Production/Stable"

dependencies = [
"google-api-core[grpc] >= 1.34.0, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,!=2.10.*",
"google-cloud-core >= 1.4.4, < 3.0dev",
"grpc-google-iam-v1 >= 0.12.4, <1.0.0dev",
"proto-plus >= 1.22.0, <2.0.0dev",
"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.*",
"google-cloud-core >= 1.4.4, < 3.0.0",
"grpc-google-iam-v1 >= 0.12.4, <1.0.0",
"proto-plus >= 1.22.0, <2.0.0",
"sqlparse >= 0.4.4",
"proto-plus >= 1.22.2, <2.0.0dev; python_version>='3.11'",
"protobuf>=3.20.2,<6.0.0dev,!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5",
"proto-plus >= 1.22.2, <2.0.0; python_version>='3.11'",
"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-interceptor >= 0.15.4",
]
extras = {
Expand Down
Loading