Skip to content

Compatibility of generated Python code with protoc >= 3.19.0 #11123

@aabmass

Description

@aabmass

I have some questions regarding the compatibility guarantees of generated code with individual language APIs, specifically Python. According to https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates:

each language has its own major version that can be incremented independently of other languages, as covered later in this topic with the Python release. [...] The first instance of this new versioning scheme is the new version of the Python API, 4.21.0

As everyone is aware from #10051

Python upb requires generated code that has been generated from protoc 3.19.0 or newer.

That makes sense going forward when trying to use upb with protobuf 4.x. Some questions:

  1. Will code generated with protoc >= 3.19.0 continue to work with Python protobuf 3.x? When will protoc stop being compatible with protobuf 3.x?
  2. Now that individual language API major versions are incremented independently, how are users expected to know which protoc version generates code compatible with which individual language API version? Right now, the latest protoc version is 3.21.10 which "targets" python 4.x afaict. The mismatch of major versions here is confusing.

I found #4945 referencing compatibility tests, but they were deleted in #8570. Apologies if this Is this documented somewhere and I missed it.

Additional context

open-telemetry/opentelemetry-python#2880 (comment)

Metadata

Metadata

Labels

documentationinactiveDenotes the issue/PR has not seen activity in the last 90 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions