-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathjustfile
More file actions
67 lines (52 loc) · 1.98 KB
/
justfile
File metadata and controls
67 lines (52 loc) · 1.98 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# https://just.systems/
BUF_VERSION := "v1.57.0"
[private]
@default: check
# Format Python files
format:
uv run ruff check --fix --unsafe-fixes --exit-zero .
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
test *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 }}
# Generate gRPC status
generate-status:
go run github.com/bufbuild/buf/cmd/buf@{{ BUF_VERSION }} generate
# Generate conformance files
[working-directory('conformance')]
generate-conformance:
go run github.com/bufbuild/buf/cmd/buf@{{ BUF_VERSION }} generate
@# We use the published conformance protos for tests, but need to make sure their package doesn't start with connectrpc
@# which conflicts with the runtime package. Since protoc python plugin does not provide a way to change the package
@# 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-status 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)"
# Bump the version based on the given semver change (e.g., `minor` or `patch`).
bump semver:
uv version --bump={{ semver }}
uv version --bump={{ semver }} --directory protoc-gen-connect-python