-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
84 lines (67 loc) · 2.19 KB
/
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
.PHONY: version version-full install upgrade test dev build lint
# Versioning
version_full ?= $(shell $(MAKE) --silent version-full)
version_small ?= $(shell $(MAKE) --silent version)
# App location
default_location := swedencentral
openai_location := swedencentral
search_location := westeurope
# Container configuration
container_name := ghcr.io/microsoft/deepthink-api
# Bicep outputs
api_url ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["apiUrl"].value')
blob_account_name ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["blobAccountName"].value')
front_url ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["frontUrl"].value')
static_url ?= $(shell az deployment sub show --name $(name) | yq '.properties.outputs["staticUrl"].value')
version:
@bash ./cicd/version/version.sh -g . -c
version-full:
@bash ./cicd/version/version.sh -g . -c -m
install:
@echo "➡️ Installing venv..."
uv venv --python 3.13 --allow-existing
@echo "➡️ Installing crawl4ai dependencies..."
uv run playwright install
$(MAKE) install-deps
install-deps:
@echo "➡️ Syncing dependencies..."
uv sync --extra dev
upgrade:
@echo "➡️ Updating Git submodules..."
git submodule update --init --recursive
@echo "➡️ Compiling requirements..."
uv lock --upgrade
test:
$(MAKE) test-static
$(MAKE) test-unit
test-static:
@echo "➡️ Test dependencies issues (deptry)..."
uv run deptry app
@echo "➡️ Test code smells (Ruff)..."
uv run ruff check
@echo "➡️ Test types (Pyright)..."
uv run pyright
test-unit:
@echo "➡️ Unit tests (Pytest)..."
uv run pytest \
--junit-xml=test-reports/$(version_full)-simple.xml \
--log-file=test-reports/$(version_full)-simple.log \
--maxprocesses=2 \
-n=logical \
tests/*.py
dev:
VERSION=$(version_full) CI=true uv run gunicorn app.main:api \
--access-logfile - \
--bind 0.0.0.0:8080 \
--graceful-timeout 60 \
--proxy-protocol \
--reload \
--reload-extra-file .env \
--timeout 60 \
--worker-class uvicorn.workers.UvicornWorker \
--workers 2
lint:
@echo "➡️ Fix with formatter..."
uv run ruff format
@echo "➡️ Lint with linter..."
uv run ruff check --fix