Mark the python generator for editions support.

Editions has been implemented in all three implementations already, and this simply enables it.

PiperOrigin-RevId: 582139104
pull/14700/head
Mike Kruskal 1 year ago committed by Copybara-Service
parent fac9fdc283
commit b01bd1ba17
  1. 3
      src/google/protobuf/compiler/python/generator.h
  2. 3
      src/google/protobuf/compiler/python/pyi_generator.h

@ -66,7 +66,8 @@ class PROTOC_EXPORT Generator : public CodeGenerator {
std::string* error) const override;
uint64_t GetSupportedFeatures() const override {
return Feature::FEATURE_PROTO3_OPTIONAL;
return Feature::FEATURE_PROTO3_OPTIONAL |
Feature::FEATURE_SUPPORTS_EDITIONS;
}
Edition GetMinimumEdition() const override { return Edition::EDITION_PROTO2; }
Edition GetMaximumEdition() const override { return Edition::EDITION_2023; }

@ -48,7 +48,8 @@ class PROTOC_EXPORT PyiGenerator : public google::protobuf::compiler::CodeGenera
// CodeGenerator methods.
uint64_t GetSupportedFeatures() const override {
// Code generators must explicitly support proto3 optional.
return CodeGenerator::FEATURE_PROTO3_OPTIONAL;
return Feature::FEATURE_PROTO3_OPTIONAL |
Feature::FEATURE_SUPPORTS_EDITIONS;
}
bool Generate(const FileDescriptor* file, const std::string& parameter,
GeneratorContext* generator_context,

Loading…
Cancel
Save