Skip to content

Looking to bump protobuf dependency > 7.0.0 #16172

Closed

Description

@ericzundel

I'm trying to upgrade bazel build rules:

In my MODULE.bazel I upgraded as follows:

 ####################################################
 # Protobuf rules
 # This is the Way to load py_proto_library and proto_library for bazel 7.x and beyond
 #
-bazel_dep(name = "protobuf", version = "33.5", dev_dependency = True)
+bazel_dep(name = "protobuf", version = "34.1", dev_dependency = True)

-bazel_dep(name = "rules_python", version = "1.8.3")
+bazel_dep(name = "rules_python", version = "1.9.0")

The protobuf rules bump has led me to an unresolvable constraint in the spanner
driver. First I tried with 3.59.0, then I increased the google-cloud-spanner version up to the latest 3.63.0.

$ update-requirements-lock.sh 
  × No solution found when resolving dependencies:
  ╰─▶ Because google-cloud-spanner==3.63.0 depends on one of:
          protobuf>=3.20.2,<4.21.0
          protobuf>4.21.0,<4.21.1
          protobuf>4.21.1,<4.21.2
          protobuf>4.21.2,<4.21.3
          protobuf>4.21.3,<4.21.4
          protobuf>4.21.4,<4.21.5
          protobuf>4.21.5,<7.0.0
      and you require protobuf>=7.34.1, we can conclude that your requirements and google-cloud-spanner==3.63.0 are incompatible.
      And because you require google-cloud-spanner==3.63.0, we can conclude that your requirements are unsatisfiable.

I'm not sure if there is good reason to have the <7.0.0 constraint on the protobuf package. The new protobuf rules seem to use: 7.34.1 by default. Here are the release notes for 7.x: https://protobuf.dev/news/2025-09-19/ from September 2025

Activity

  1. ericzundel commented on Mar 25, 2026

    @ericzundel
    Author

    Note, this isn't blocking for me, I just moved to protobuf 33.6 for now.

  2. olavloite commented on Mar 25, 2026

    @olavloite
    Contributor

    Assigning to @parthea as the last to update this specifically to <7.0.0 in googleapis/python-spanner#1320.

    Is there a specific reason for requiring <7.0.0?

  3. parthea commented on Mar 25, 2026

    @parthea
    Contributor

    We're currently blocked on grpc/grpc#41933. There is a dependency on grpcio-status via the grpc extra of google-api-core (google-api-core[grpc]).

    https://github.com/googleapis/python-spanner/blob/c37532c65ee2b2ecc52d8a4a2f5bf002cb8e039c/setup.py#L43

    grpc = [
    "grpcio >= 1.33.2, < 2.0.0",
    "grpcio >= 1.49.1, < 2.0.0; python_version >= '3.11'",
    "grpcio >= 1.75.1, < 2.0.0; python_version >= '3.14'",
    "grpcio-status >= 1.33.2, < 2.0.0",
    "grpcio-status >= 1.49.1, < 2.0.0; python_version >= '3.11'",
    "grpcio-status >= 1.75.1, < 2.0.0; python_version >= '3.14'",
    ]

    We should be able to allow Protobuf 7.x in client libraries because we have prerelease tests via the Kokoro Prerelease Dependencies presubmit that runs against Protobuf 7.x, but we will still see conflicts due to grpcio-status.

    In the build log for Kokoro Prerelease Dependencies , see this line where we have already tested Protobuf 7.x

    nox > python -c 'import google.protobuf; print(google.protobuf.__version__)'
    7.34.1
    

    We can't run tests using Protobuf 7.x outside of Kokoro Prerelease Dependencies because of grpc/grpc#41933.

    Googlers see b/495851781

  4. parthea commented on Mar 25, 2026

    @parthea
    Contributor

    Transferring to google-cloud-python as the code for google-cloud-spanner will be migrated there this week (likely tomorrow)

  5. added
    status: blockedResolving the issue is dependent on other work.
    externalThis issue is blocked on a bug with the actual product.
    on Apr 10, 2026
  6. removed their assignment
    on Apr 10, 2026
  7. parthea commented on May 1, 2026

    @parthea
    Contributor

    Completed

    "protobuf >= 4.25.8, < 8.0.0",

  8. removed
    status: blockedResolving the issue is dependent on other work.
    externalThis issue is blocked on a bug with the actual product.
    on May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: spannerIssues related to the Spanner API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions