-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Labels
compiler-bugThe compiler is brokenThe compiler is brokengood first issueGood for newcomersGood for newcomers
Description
Say you have two files service1.proto
and service2.proto
with same package assigned:
service1.proto:
syntax = "proto3";
package service;
/* Service1 */
service Service1 {}
service2.proto:
syntax = "proto3";
package service;
/* Service2 */
service Service2 {}
Compiling these together with the command python3 -m grpc_tools.protoc -I . --python_betterproto_out=./ service1.proto service2.proto
results in this:
service/init.py:
# Generated by the protocol buffer compiler. DO NOT EDIT!
# sources: service1.proto, service2.proto
# plugin: python-betterproto
from dataclasses import dataclass
from typing import Dict
import betterproto
from betterproto.grpc.grpclib_server import ServiceBase
import grpclib
class Service1Stub(betterproto.ServiceStub):
"""Service1"""
class Service2Stub(betterproto.ServiceStub):
"""Service1"""
class Service1Base(ServiceBase):
"""Service1"""
def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
return {}
class Service2Base(ServiceBase):
"""Service1"""
def __mapping__(self) -> Dict[str, grpclib.const.Handler]:
return {}
As you can see the comment for Service2 got overwritten.
I have reproduced this with current master branch, which I believe is version 2.0.0b2 with commit hash 6c1c41e .
Metadata
Metadata
Assignees
Labels
compiler-bugThe compiler is brokenThe compiler is brokengood first issueGood for newcomersGood for newcomers