Skip to content

Update README for buf v2 commands/config #197

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

Merged
merged 2 commits into from
Oct 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,31 +82,31 @@ message Transaction {

When using the runtime library after installing it with `pip`, it's necessary to generate the Python code for the core `buf.protovalidate` Protobuf package. `buf` provides an efficient method for this:

1. **Initialize a New Configuration File**:
1. **Initialize a New Configuration File**:
```shell
buf mod init
buf config init
```
This initializes the `buf.yaml` configuration file at the root of the Protobuf source files.

2. **Module Configuration and Dependencies**:
```yaml
# buf.yaml
version: v1
deps:
version: v2
deps:
- buf.build/bufbuild/protovalidate
```

Ensure your dependencies are up-to-date with:
```shell
buf mod update
buf dep update
```

3. **Setup Code Generation**:
```yaml
# buf.gen.yaml
version: v1
version: v2
plugins:
- plugin: buf.build/protocolbuffers/python:v23.4
- remote: buf.build/protocolbuffers/python
out: gen
```

Expand Down
Loading