Skip to content

Comments

Release <5.0 requirement on protobuf for Python 3.13 compatibility#331

Merged
d1donlydfink merged 5 commits intomainfrom
python_3_13
Jul 25, 2025
Merged

Release <5.0 requirement on protobuf for Python 3.13 compatibility#331
d1donlydfink merged 5 commits intomainfrom
python_3_13

Conversation

@ofrancon
Copy link
Contributor

This changes lets pip install work with python 3.13 without having to compile anything.

# In-house dependencies
leaf-common>=1.2.23
leaf-server-common>=0.1.20
leaf-server-common>=0.1.21
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This version of leaf-server-common does NOT depend on protobuf <5.0 anymore

grpcio-tools>=1.62.0

protobuf>=4.25.3,<5.0
protobuf>=4.25.3
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Letting protobuf float

d1donlydfink
d1donlydfink previously approved these changes Jul 25, 2025
Copy link
Collaborator

@d1donlydfink d1donlydfink left a comment

Choose a reason for hiding this comment

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

I am in concept good with this, but we need to be sure that removing the protobufs ceiling doesn't mess with the creation of the agent_service.json file for OpenAPI usage and that existing grpc connections are still fine when the new protobuf files are generated.

@andreidenissov-cog : can you help there?

@andreidenissov-cog
Copy link
Contributor

I am in concept good with this, but we need to be sure that removing the protobufs ceiling doesn't mess with the creation of the agent_service.json file for OpenAPI usage and that existing grpc connections are still fine when the new protobuf files are generated.

@andreidenissov-cog : can you help there?

OK, I'll try it out. Will need to install Python 3.13 apparently,

I am in concept good with this, but we need to be sure that removing the protobufs ceiling doesn't mess with the creation of the agent_service.json file for OpenAPI usage and that existing grpc connections are still fine when the new protobuf files are generated.

@andreidenissov-cog : can you help there?

OK, I'll try it out.

# NO CHECKED-IN PROTOBUF GENCODE
# source: neuro_san/api/grpc/agent.proto
# Protobuf Python Version: 4.25.1
# Protobuf Python Version: 6.31.1
Copy link
Collaborator

@d1donlydfink d1donlydfink Jul 25, 2025

Choose a reason for hiding this comment

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

Redid ./neuro_san/api/scripts/do_generate.sh on Python 3.12 with protobuf==6.31.1.
Here are some testing results:

  • agent_service.json is generated exactly the same way by the golang tools, as far as I can tell.
  • new protobuf 6 server with new protobuf 6 client is fine
  • new protobuf 6 server with old protobuf 4 client is fine
  • old protobuf 4 server with new protobuf 6 client is fine

What will happen is a ImportError will trip if you have an older protobuf 4 venv and you try to run against these newly generated grpc files...

  File "/home//sandbox1/esp/gitrepos/neuro-san/neuro_san/service/main_loop/server_main_loop.py", line 32, in <module>
    from neuro_san.service.grpc.grpc_agent_server import DEFAULT_SERVER_NAME
  File "/home/d/sandbox1/esp/gitrepos/neuro-san/neuro_san/service/grpc/grpc_agent_server.py", line 21, in <module>
    from neuro_san.api.grpc import agent_pb2
  File "/home//sandbox1/esp/gitrepos/neuro-san/neuro_san/api/grpc/agent_pb2.py", line 20, in <module>
    from google.protobuf import runtime_version as _runtime_version
ImportError: cannot import name 'runtime_version' from 'google.protobuf' (/home/venv/ns/lib/python3.12/site-packages/google/protobuf/__init__.py)

@d1donlydfink d1donlydfink merged commit 09306ca into main Jul 25, 2025
4 checks passed
@d1donlydfink d1donlydfink deleted the python_3_13 branch July 25, 2025 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants