-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (42 loc) · 1016 Bytes
/
Makefile
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
VIRTUAL_ENV ?=
PY = $(VIRTUAL_ENV)/bin/python
ifeq "$(VIRTUAL_ENV)" ""
.PHONY: check_venv
check_venv:
@echo "not in a virtual env ... could try this:"
@echo "python3 -m venv .venv; . .venv/bin/activate"
@exit 1
endif
.PHONY: all
all: install build load
.PHONY: install
install: requirements.txt requirements-test.txt
uv pip sync requirements-test.txt
uv pip install -e .
.PHONY: pip-compile
pip-compile: requirements.txt requirements-test.txt
requirements.txt: requirements.in
uv pip compile $< -o $@
requirements-test.txt: requirements-test.in requirements.txt
uv pip compile $< -o $@
.PHONY: test
test:
$(PY) -m pytest
.PHONY: lint
lint:
$(PY) -m ruff check
.venv:
uv venv .venv
ifeq "$(realpath $(VIRTUAL_ENV))" "$(realpath .venv)"
.PHONY: clean
clean:
rm -rf .venv src/*.egg-info
find . -type d -name __pycache__ -delete
endif
###
.PHONY: build
build: install
docker build . -t kgrok-remote
.PHONY: load
load: build
kind load docker-image kgrok-remote || k3d image load kgrok-remote