This repository was archived by the owner on Jun 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Expand file tree Collapse file tree 5 files changed +47
-4
lines changed Original file line number Diff line number Diff line change
1
+ # Getting started
2
+
3
+ ## Install protoc
4
+
5
+ The betterproto2 compiler is a plugin of ` protoc ` , you first need to [ install] ( https://grpc.io/docs/protoc-installation/ ) it.
6
+
7
+ ## Install ` betterproto2_compiler `
8
+
9
+ It is possible to install ` betterproto2_compiler ` using pip:
10
+
11
+ ```
12
+ pip install betterproto2_compiler
13
+ ```
14
+
15
+ ## Compile a proto file
16
+
17
+ Create the following ` example.proto ` file.
18
+
19
+ ``` proto
20
+ syntax = "proto3";
21
+
22
+ package helloworld;
23
+
24
+ message HelloWorld {
25
+ string message = 1;
26
+ }
27
+ ```
28
+
29
+ You should now be able to compile it using:
30
+
31
+ ```
32
+ mkdir lib
33
+ protoc -I . --python_betterproto2_out=lib example.proto
34
+ ```
Original file line number Diff line number Diff line change 1
1
Home
2
2
====
3
3
4
- Welcome to betterproto2-compiler 's documentation!
4
+ Welcome to ` betterproto2_compiler ` 's documentation! This site will guide you through the steps needed to install and use the betterproto2 compiler.
Original file line number Diff line number Diff line change 1
- site_name : Betterproto2 Compiler
1
+ site_name : Betterproto2
2
2
site_url : https://betterproto.github.io/python-betterproto2-compiler/
3
3
theme :
4
4
name : material
5
5
palette :
6
6
primary : deep orange
7
7
accent : deep orange
8
8
9
+ features :
10
+ - navigation.tabs
11
+
12
+ nav :
13
+ - Betterproto2 : https://betterproto.github.io/python-betterproto2/
14
+ - Betterproto2 compiler :
15
+ - index.md
16
+ - Getting started : getting-started.md
17
+
9
18
plugins :
10
19
- mkdocstrings
11
20
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ pytest = "^6.2.5"
34
34
protobuf = " ^4"
35
35
36
36
[tool .poetry .scripts ]
37
- protoc-gen-python_betterproto = " betterproto2_compiler.plugin:main"
37
+ protoc-gen-python_betterproto2 = " betterproto2_compiler.plugin:main"
38
38
39
39
[tool .ruff ]
40
40
extend-exclude = [" tests/output_*" ]
Original file line number Diff line number Diff line change @@ -46,7 +46,7 @@ async def protoc(
46
46
):
47
47
path : Path = Path (path ).resolve ()
48
48
output_dir : Path = Path (output_dir ).resolve ()
49
- python_out_option : str = "python_betterproto_out " if not reference else "python_out"
49
+ python_out_option : str = "python_betterproto2_out " if not reference else "python_out"
50
50
51
51
if pydantic_dataclasses :
52
52
plugin_path = Path ("src/betterproto2_compiler/plugin/main.py" )
You can’t perform that action at this time.
0 commit comments