Skip to content
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ jobs:
run: go test ./...
working-directory: protoc-gen-connect-python

- name: check running `just generate` does not create a diff
# NOTE: running on macOS as our sed command only works there
if: startsWith(matrix.os, 'macos-')
run: uv run just checkgenerate

- uses: codecov/codecov-action@v5
if: ${{ matrix.coverage == 'cov' }}

Expand Down
2 changes: 2 additions & 0 deletions conformance/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ plugins:
- local:
- go
- run
- -C
- ../protoc-gen-connect-python
- .
out: test/gen
opt:
- imports=relative
2 changes: 2 additions & 0 deletions example/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,7 @@ plugins:
- local:
- go
- run
- -C
- ../protoc-gen-connect-python
- .
out: .
19 changes: 19 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,39 +1,51 @@
# https://just.systems/

BUF_VERSION := "v1.57.0"

[private]
@default: check

# Format Python files
format:
uv run ruff check --fix .
uv run ruff format .

# Lint Python files
lint:
uv run ruff format --check .
uv run ruff check .

# Typecheck Python files
typecheck:
uv run pyright

# Run unit tests with no extras
[working-directory: 'noextras']
test-noextras *args:
uv run --exact pytest {{args}}

# Run unit tests
test *args: (test-noextras args)
uv run pytest {{args}}

# Run lint, typecheck and test
check: lint typecheck test

# Run conformance tests
[working-directory: 'conformance']
conformance *args:
uv run pytest {{args}}

# Build docs
docs:
uv run mkdocs build

# Serve the docs locally
[working-directory: 'site']
docs-serve: docs
uv run python -m http.server 8000

# Generate conformance files
[working-directory: 'conformance']
generate-conformance:
go run github.com/bufbuild/buf/cmd/buf@{{BUF_VERSION}} generate
Expand All @@ -42,12 +54,19 @@ generate-conformance:
@# structure, we use sed to fix the imports instead.
LC_ALL=c find test/gen -type f -exec sed -i '' 's/from connectrpc.conformance.v1/from gen.connectrpc.conformance.v1/' {} +

# Generate example files
[working-directory: 'example']
generate-example:
go run github.com/bufbuild/buf/cmd/buf@{{BUF_VERSION}} generate

# Generate test files
[working-directory: 'test']
generate-test:
go run github.com/bufbuild/buf/cmd/buf@{{BUF_VERSION}} generate

# Run all generation targets, and format the generated code
generate: generate-conformance generate-example generate-test format

# Used in CI to verify that `just generate` doesn't produce a diff
checkgenerate: generate
test -z "$(git status --porcelain | tee /dev/stderr)"
2 changes: 2 additions & 0 deletions test/buf.gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ plugins:
- local:
- go
- run
- -C
- ../protoc-gen-connect-python
- .
out: .
opt:
- imports=relative