Skip to content

Commit 32cb21c

Browse files
author
Ben Bonenfant
committed
cleanup fork
1 parent 95c8ad4 commit 32cb21c

File tree

5 files changed

+5
-27
lines changed

5 files changed

+5
-27
lines changed

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "betterproto"
3-
version = "2.0.0b5"
3+
version = "2.0.0b5+pachv1.0.0"
44
description = "A better Protobuf / gRPC generator & library"
55
authors = ["Daniel G. Taylor <danielgtaylor@gmail.com>"]
66
readme = "README.md"
@@ -44,7 +44,6 @@ protoc-gen-python_betterproto = "betterproto.plugin:main"
4444

4545
[tool.poetry.extras]
4646
compiler = ["black", "isort", "jinja2"]
47-
grpcio = ["grpcio"]
4847

4948

5049
# Dev workflow tasks

src/betterproto/grpc/grpcio_server.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,4 @@ def register_servicers(server: "grpc.aio.Server", *servicers: ServicerBase):
3131
)
3232
for servicer in servicers
3333
)
34-
)
34+
)

src/betterproto/plugin/models.py

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,18 +211,11 @@ def comment(self) -> str:
211211
proto_file=self.source_file, path=self.path, indent=self.comment_indent
212212
)
213213

214-
@dataclass
215-
class Options:
216-
grpc_kind: str = "grpclib"
217-
include_google: bool = False
218-
219-
220214

221215
@dataclass
222216
class PluginRequestCompiler:
223217

224218
plugin_request_obj: CodeGeneratorRequest
225-
options: Options
226219
output_packages: Dict[str, "OutputTemplate"] = field(default_factory=dict)
227220

228221
@property
@@ -811,7 +804,7 @@ def py_input_message_type(self) -> str:
811804
package=self.output_file.package,
812805
imports=self.output_file.imports,
813806
source_type=self.proto_obj.input_type,
814-
unwrap=False, # TODO: was True
807+
unwrap=False,
815808
).strip('"')
816809

817810
@property

src/betterproto/plugin/parser.py

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
FieldCompiler,
2828
MapEntryCompiler,
2929
MessageCompiler,
30-
Options,
3130
OneOfFieldCompiler,
3231
OutputTemplate,
3332
PluginRequestCompiler,
@@ -66,26 +65,13 @@ def _traverse(
6665
yield from _traverse([4], proto_file.message_type)
6766

6867

69-
def parse_options(plugin_options: List[str]) -> Options:
70-
options = Options()
71-
for option in plugin_options:
72-
if option == "INCLUDE_GOOGLE":
73-
options.include_google = True
74-
return options
75-
76-
7768
def generate_code(request: CodeGeneratorRequest) -> CodeGeneratorResponse:
7869
response = CodeGeneratorResponse()
7970

8071
plugin_options = request.parameter.split(",") if request.parameter else []
8172
response.supported_features = CodeGeneratorResponseFeature.FEATURE_PROTO3_OPTIONAL
8273

83-
options = parse_options(plugin_options)
84-
85-
request_data = PluginRequestCompiler(
86-
plugin_request_obj=request, options=options
87-
)
88-
74+
request_data = PluginRequestCompiler(plugin_request_obj=request)
8975
# Gather output packages
9076
for proto_file in request.proto_file:
9177
output_package_name = proto_file.package

src/betterproto/templates/template.py.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,4 +232,4 @@ class {{ service.py_name }}Base(ServicerBase):
232232
{% endfor %}
233233
}
234234

235-
{% endfor %}
235+
{% endfor %}

0 commit comments

Comments
 (0)