Skip to content

Commit a169a8f

Browse files
Add remote plugin usage to README (#10)
Signed-off-by: Stefan VanBuren <stefan@vanburen.xyz>
1 parent f79c790 commit a169a8f

File tree

2 files changed

+17
-23
lines changed

2 files changed

+17
-23
lines changed

README.md

Lines changed: 14 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ With a protobuf definition in hand, you can generate stub code. This is
4545
easiest using buf, but you can also use protoc if you're feeling
4646
masochistic.
4747

48-
Install the compiler (e.g. `pip install protoc-gen-connect-python`), and
49-
it can be referenced as `protoc-gen-connect-python`. Alternatively, download
50-
a precompiled binary from the [releases](https://github.com/connectrpc/connect-python/releases).
51-
5248
A reasonable `buf.gen.yaml`:
5349

5450
```yaml
@@ -58,10 +54,22 @@ plugins:
5854
out: .
5955
- remote: buf.build/protocolbuffers/pyi
6056
out: .
57+
- remote: buf.build/connectrpc/python
58+
out: .
59+
```
60+
61+
Or, you can install the compiler (e.g. `pip install protoc-gen-connect-python`), and
62+
it can be referenced as `protoc-gen-connect-python`.
63+
Then, you can use `protoc-gen-connect-python` as a local plugin:
64+
65+
```yaml
6166
- local: .venv/bin/protoc-gen-connect-python
6267
out: .
6368
```
6469

70+
Alternatively, download a precompiled binary from the
71+
[releases](https://github.com/connectrpc/connect-python/releases).
72+
6573
`protoc-gen-connect-python` is only needed for code generation. Your actual
6674
application should include `connect-python` as a dependency for the runtime
6775
component.
@@ -410,25 +418,8 @@ Set up a virtual env:
410418
uv sync
411419
```
412420

413-
Then, use `uv run just check` to do development checks:
414-
415-
```console
416-
$ uv run just --list
417-
Available recipes:
418-
all # Run all checks (format, check, mypy, test, integration-test)
419-
check # Check code with ruff linter
420-
conformance-test *ARGS # Run conformance tests (requires connectconformance binary). Usage: uv run just conformance-test [ARGS...]
421-
fix # Fix auto-fixable ruff linter issues
422-
format # Format code with ruff
423-
integration-test # Run integration test against demo.connectrpc.com
424-
mypy # Run mypy type checking
425-
mypy-package
426-
mypy-tests
427-
protoc-gen *ARGS # Run protoc with connect_python plugin (development mode). usage: uv run just protoc-gen [PROTOC_ARGS...]
428-
test # Run tests
429-
```
430-
431-
For example, `uv run just check` will lint code.
421+
Then, use `uv run just` to do development checks, or check out `uv run just --list` for other targets.
422+
`just` is run via `uv` as a development dependency, but you can also install it globally and omit the `uv run` from the commands.
432423

433424
## Status
434425

justfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
BUF_VERSION := "v1.57.0"
22

3+
[private]
4+
@default: check
5+
36
format:
47
uv run ruff check --fix .
58
uv run ruff format .

0 commit comments

Comments
 (0)