From cc12a451f8643d3eacc8f7b72d09d3f8d7b906c3 Mon Sep 17 00:00:00 2001 From: Anuraag Agrawal Date: Thu, 1 Oct 2026 15:06:59 +0900 Subject: [PATCH] Document compatibility between gencode and runtime --- docs/faq.md | 5 +++-- docs/getting-started/quickstart.md | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/faq.md b/docs/faq.md index 1341fd9..08e4811 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -172,5 +172,6 @@ either major or minor versions. - Dropping support for EOL Python versions can happen on minor version releases. - Display and informational features such as formatting comment lines from a proto descriptor. -In addition, currently we only guarantee code generated by the same version of `protoc-gen-py` as `protobuf-py` will work. -This will be relaxed in the future. +Code generated by a version of `protoc-gen-py` will continue to work with any newer version of `protobuf-py` +within the same major version series, but may not work with older versions, e.g., code generated with 1.2 +will work with 1.4, but may not work with 2.0 or 1.1. diff --git a/docs/getting-started/quickstart.md b/docs/getting-started/quickstart.md index 4b8ecc9..7d1c23a 100644 --- a/docs/getting-started/quickstart.md +++ b/docs/getting-started/quickstart.md @@ -75,6 +75,11 @@ The generated file is checked in to version control; re-run generation only when Generated files should never be edited by hand. They contain a `DO NOT EDIT` comment and will be overwritten on the next `buf generate`. +!!! note + Code generated with a version of `protoc-gen-py` will continue to work with any newer version of `protobuf-py` + within the same major version series, but may not work with older versions, e.g., code generated with 1.2 + will work with 1.4, but may not work with 2.0 or 1.1. + ## Create messages Import and instantiate the generated class using keyword arguments: