diff --git a/Makefile b/Makefile index 7aea39d..f270fe0 100644 --- a/Makefile +++ b/Makefile @@ -53,10 +53,14 @@ lint: --show-stats=false --fix @gofmt -l . # Lists files that are likely to be changed by the next command @go run github.com/golangci/golangci-lint/v2/cmd/golangci-lint@v2.4.0 fmt - @uvx -q sqlfluff fix -q \ - --disable-progress-bar \ - --config=internal/server/postgres/sql/.sqlfluff.toml \ - internal/server/postgres/sql/queries + @if command -v uvx > /dev/null 2>&1; then \ + uvx -q sqlfluff fix -q \ + --disable-progress-bar \ + --config=internal/server/postgres/sql/.sqlfluff.toml \ + internal/server/postgres/sql/queries; \ + else \ + echo "Warning: uvx not found, skipping SQL linting" >&2; \ + fi .PHONY: bench bench: gen @@ -101,7 +105,7 @@ ${SQLC_STAMP_FILE}: ${SQLC} ${SQLC_SOURCES} ${SQLC_SOURCE_CONFIG} ${PROTO_GO_STAMP_FILE}: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GRPC} ${PROTO_SOURCES} @echo "Generating internal protobuf code..." @rm -rf internal/gen && mkdir -p internal/gen - @${PROTOC} \ + @PATH="$(GOBIN):$$PATH" ${PROTOC} \ ${PROTO_SOURCES} \ -I=proto \ --go_out=internal/gen \ @@ -116,8 +120,7 @@ ${PROTO_GO_STAMP_FILE}: ${PROTOC} ${PROTOC_GEN_GO} ${PROTOC_GEN_GRPC} ${PROTO_SO .PHONY: path path: @if ! echo "$$PATH" | tr ':' '\n' | grep -qx "$(GOBIN)"; then \ - echo "Add 'export PATH=$$PATH:$(GOBIN)' to your shell profile to use installed tools."; \ - exit 1; \ + echo "Warning: $(GOBIN) is not in PATH. Add 'export PATH=$(GOBIN):$$PATH' to your shell profile to use installed tools."; \ fi .PHONY: tools @@ -179,6 +182,11 @@ endef export GEN_PYPROJ .PHONY: gen.proto.python gen.proto.python: ${PROTOC} + @if ! command -v uvx > /dev/null 2>&1; then \ + echo "Error: uvx is required for Python bindings generation but not found."; \ + echo "Please install uv: https://docs.astral.sh/uv/getting-started/installation/"; \ + exit 1; \ + fi @echo "Generating Python client bindings..." @rm -rf gen/python && mkdir -p gen/python/src/dp_sdk @uvx --from 'betterproto[compiler]==2.0.0b7' ${PROTOC} \