Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (54 loc) · 1.82 KB
/
Copy pathMakefile
File metadata and controls
68 lines (54 loc) · 1.82 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
.PHONY: setup compile sync test build build-macos build-linux build-windows test-setup format lint cleanup bump help
help:
@echo "Available targets:"
@echo " setup - Install uv (if needed), sync dependencies, and install pre-commit hooks"
@echo " compile - Update uv.lock"
@echo " sync - Sync dependencies with uv.lock"
@echo " test - Run tests using pytest"
@echo " build - Build Go backend for current platform"
@echo " build-macos - Build Go backend for macOS (arm64 and amd64)"
@echo " build-linux - Build Go backend for Linux (amd64)"
@echo " build-windows - Build Go backend for Windows (amd64)"
@echo " test-setup - Build the backend for current platform and build the package"
@echo " format - Format code with black"
@echo " lint - Lint code with ruff and mypy"
@echo " cleanup - Remove build artifacts and virtual environment"
@echo " bump - Update Go dependencies and sync Python environment"
setup:
@if ! command -v uv >/dev/null 2>&1; then pip install uv; fi
$(MAKE) sync
compile:
uv lock
sync:
uv sync --extra dev --extra docs
test:
uv run pytest $(ARGS)
build:
$(MAKE) -C backend build
build-macos:
$(MAKE) -C backend build-macos
build-linux:
$(MAKE) -C backend build-linux
build-windows:
$(MAKE) -C backend build-windows
test-setup:
rm -rf build dist *.egg-info
$(MAKE) build
uv build && echo ok
format:
uv run black .
lint:
uv run ruff check . --exclude "whatsfly/proto/*" --fix
uv run ruff format . --exclude "whatsfly/proto/*"
uv run mypy .
cleanup:
rm -rf build dist *.egg-info whatsfly/last_binary_update.txt whatsfly/__pycache__ whatsfly/*/__pycache__ .venv
bump:
$(MAKE) -C backend bump
$(MAKE) compile
$(MAKE) sync
$(MAKE) setup
$(MAKE) format
$(MAKE) test-setup
$(MAKE) cleanup
$(MAKE) sync