Skip to content

Invalid generation when package is camel case #514

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
deogo opened this issue Jul 31, 2023 · 1 comment
Closed

Invalid generation when package is camel case #514

deogo opened this issue Jul 31, 2023 · 1 comment

Comments

@deogo
Copy link

deogo commented Jul 31, 2023

grpcio = "1.54.0"
grpcio-tools = "^1.52.0"
betterproto = {version = "2.0.0b6", extras = ["compiler"]}

Compiling proto like this

syntax = "proto3";

package helloThere;

// Greeting represents a message you can tell a user.
message Greeting {
  string message = 1;
  Model model = 2;
}

message Model {
    double value = 1;
}

creates python file

from dataclasses import dataclass

import betterproto

from .. import HelloThereModel as _HelloThereModel__


@dataclass(eq=False, repr=False)
class Greeting(betterproto.Message):
    """Greeting represents a message you can tell a user."""

    message: str = betterproto.string_field(1)
    model: "_HelloThereModel__" = betterproto.message_field(2)


@dataclass(eq=False, repr=False)
class Model(betterproto.Message):
    value: float = betterproto.double_field(1)

Which does not work due to some relative imports
If you fix package name helloThere -> hello_there it work ok

@Gobot1234
Copy link
Collaborator

Duplicate of #437

@Gobot1234 Gobot1234 closed this as not planned Won't fix, can't repro, duplicate, stale Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants