Skip to content

Add editions support #179

@Mitchman215

Description

@Mitchman215

Summary

Stay up-to-date with recent protobuf changes

What is the feature request for?

The core library

The Problem

Currently, if I try to run protoc with betterproto2 on a .proto file that has edition = "2023";, it fails. Here's exact repro behavior:

Make test.proto file:

edition = "2023";

message Hi {
  uint32 foo = 1;
}

Run protoc on it:

protoc --python_betterproto2_out=out test.proto 

Currently, this gives the following console output:

Writing __init__.py
test.proto: is an editions file, but code generator protoc-gen-python_betterproto2 hasn't been updated to support editions yet.  Please ask the owner of this code generator to add support or switch back to proto2/proto3.

See https://protobuf.dev/editions/overview/ for more information.--python_betterproto2_out:

For context, I am using betterproto2-compiler version 0.9.0 and libprotoc version 33.4

The Ideal Solution

Implement editions support, allowing python code generation from .proto files that uses something like edition = "2023"; as opposed to syntax = "proto3";

The Current Solution

Use proto2/proto3 instead of editions.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions