You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/getting-started.md
+19-76Lines changed: 19 additions & 76 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,101 +3,44 @@ Getting Started
3
3
4
4
## Installation
5
5
6
-
Installation from PyPI is as simple as running:
6
+
The package `betterproto2` can be simply installed from PyPI using `pip`:
7
7
8
8
```sh
9
-
python3 -m pip install -U betterproto
9
+
pip install betterproto2
10
10
```
11
11
12
-
If you are using Windows, then the following should be used instead:
12
+
!!! info
13
+
The package is compatible with all Python versions from 3.8 to 3.13.
13
14
14
-
```sh
15
-
py -3 -m pip install -U betterproto
16
-
```
17
15
18
-
To include the protoc plugin, install `betterproto[compiler]` instead of betterproto,
19
-
e.g.
16
+
## Compiling proto files
20
17
21
-
```sh
22
-
python3 -m pip install -U "betterproto[compiler]"
23
-
```
18
+
Follow the documentation of [betterproto2 compiler](https://betterproto.github.io/python-betterproto2-compiler/getting-started/) to compile your proto files.
24
19
25
20
!!! warning
26
21
Make sure that the proto files were generated with a version of `betterproto2_compiler` that is compatible with your
27
22
version of `betterproto2`.
28
23
29
-
The version `x.y.z` of `betterproto` is compatible with the version `a.b.c` of the compiler if and only if `a=x` and
30
-
`b=y`.
31
-
32
-
## Compiling proto files
33
-
34
-
35
-
Given you installed the compiler and have a proto file, e.g `example.proto`:
24
+
The version `0.x.y` of `betterproto` is compatible with the version `0.a.b` of the compiler if and only if `a=b`.
36
25
37
-
```proto
38
-
syntax = "proto3";
39
-
40
-
package hello;
41
26
42
-
// Greeting represents a message you can tell a user.
43
-
message Greeting {
44
-
string message = 1;
45
-
}
46
-
```
27
+
## Basic usage
47
28
48
-
To compile the proto you would run the following:
49
-
50
-
You can run the following to invoke protoc directly:
0 commit comments