-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
50 lines (38 loc) · 1.5 KB
/
Copy pathMakefile
File metadata and controls
50 lines (38 loc) · 1.5 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
.PHONY: help install run run-remote test lint format docker-up docker-down clean
PY ?= python3
VENV ?= .venv
PIP := $(VENV)/bin/pip
PYBIN := $(VENV)/bin/python
MODEL_SERVER_URL ?= http://localhost:39671
help:
@echo "OpenCR developer targets:"
@echo " make install # venv + base/dev deps"
@echo " make run # start dev server on http://localhost:39672, using MODEL_SERVER_URL"
@echo " make run-remote # start dev server pointing at MODEL_SERVER_URL"
@echo " make test # run pytest suite"
@echo " make lint # ruff check"
@echo " make format # ruff format"
@echo " make docker-up # docker compose up (NVIDIA GPU stack)"
@echo " make docker-down # docker compose down"
$(VENV):
$(PY) -m venv $(VENV)
$(PIP) install -U pip
install: $(VENV)
$(PIP) install -r ocr_pipeline/requirements.txt
$(PIP) install -r requirements-dev.txt
run: $(VENV)
MODEL_BACKEND=remote MODEL_SERVER_URL=$(MODEL_SERVER_URL) $(PYBIN) -m uvicorn ocr_pipeline.main:app --host 0.0.0.0 --port 39672 --reload
run-remote: $(VENV)
MODEL_BACKEND=remote MODEL_SERVER_URL=$(MODEL_SERVER_URL) $(PYBIN) -m uvicorn ocr_pipeline.main:app --host 0.0.0.0 --port 39672 --reload
test: $(VENV)
PYTHONPATH=. $(PYBIN) -m pytest -q
lint: $(VENV)
$(VENV)/bin/ruff check ocr_pipeline tests scripts
format: $(VENV)
$(VENV)/bin/ruff format ocr_pipeline tests scripts
docker-up:
docker compose up -d
docker-down:
docker compose down
clean:
rm -rf $(VENV) .pytest_cache .ruff_cache **/__pycache__