-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (60 loc) · 2.43 KB
/
Makefile
File metadata and controls
76 lines (60 loc) · 2.43 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
68
69
70
71
72
73
74
75
76
.PHONY: help
help: ## Display this help.
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9\/-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
##@ Setup
.PHONY: bootstrap/uv
bootstrap/uv:
@case "$$(uname -s)" in \
Darwin*) which uv || HOMEBREW_NO_AUTO_UPDATE=1 brew install uv ;; \
Linux*) which uv || curl -LsSf https://astral.sh/uv/install.sh | sh ;; \
*) echo -e "\033[33mCannot install 'uv' automatically. Install manually instead: https://docs.astral.sh/uv/getting-started/installation/#standalone-installer\033[0m" ;; \
esac
.PHONY: bootstrap
bootstrap: bootstrap/uv ## Install the required dependencies to use this project.
##@ Formatting & linting
.PHONY: lint
lint: buf/deps ## Check protobuf files for linting errors.
buf lint
@buf breaking --against https://github.com/qdrant/qdrant-cloud-public-api.git || \
echo "⚠️ Warning: Breaking changes detected! These should generally be avoided. Continuing with code generation..."
.PHONY: format
format: buf/deps ## Format protobuf files (in-place) using `buf format`.
buf format -w
##@ Generating code
.PHONY: generate
generate: clean format lint ## Generate language bindings.
uv run buf generate
./scripts/cleanup-gencode-comments.sh
rm -rf gen-dummy/
.PHONY: build-go
build-go:
go build ./...
.PHONY: clean
clean: ## Clean the directory with the generated language bindings.
rm -rf gen/
rm -rf gen-dummy/
##@ Dependencies
.PHONY: deps
deps: ## Install the required dependencies to use this project.
HOMEBREW_NO_AUTO_UPDATE=1 brew install \
bufbuild/buf/buf uv
uv sync
.PHONY: buf/plugins
buf/plugins: ## Install the required buf plugins (those that can't be installed using Buf's deps option).
go install github.com/qdrant/qdrant-cloud-buf-plugins/cmd/buf-plugin-required-fields@latest && \
go install github.com/qdrant/qdrant-cloud-buf-plugins/cmd/buf-plugin-method-options@latest && \
go install github.com/qdrant/qdrant-cloud-buf-plugins/cmd/buf-plugin-permissions-breaking@latest
.PHONY: buf/deps
buf/deps: buf/plugins ## Install the required dependencies to work with the protobuf files.
buf dep update
.PHONY: python/dev-install
python/dev-install: ## Install the required Python dependencies to work with the project.
uv sync \
--dev \
--locked
.PHONY: py.sdist.public-api
py.sdist.public-api:
rm -rf dist
uv build -v \
--sdist \
.