Skip to content

Commit 097d574

Browse files
committed
v2
1 parent 85e62fe commit 097d574

9 files changed

Lines changed: 45879 additions & 644 deletions

File tree

‎FASTAPI/FaceVision/Makefile‎

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
PYTHON ?= python3
2+
PIP ?= $(PYTHON) -m pip
3+
HOST ?= http://127.0.0.1:8000
4+
LOCUST_FILE := Testing/locustfile.py
5+
6+
.PHONY: help install run locust locust-headless freeze clean test format lint format-check all
7+
8+
help:
9+
@echo "Available commands:"
10+
@echo " make install Install dependencies"
11+
@echo " make run Start FastAPI application"
12+
@echo " make locust Start Locust web UI"
13+
@echo " make locust-headless Run headless load test"
14+
@echo " make freeze Export installed packages"
15+
@echo " make clean Remove Python cache files"
16+
17+
install:
18+
$(PIP) install -r requirements.txt
19+
20+
run:
21+
$(PYTHON) -m uvicorn main:app --reload --host 0.0.0.0 --port 8000
22+
23+
locust:
24+
$(PYTHON) -m locust -f $(LOCUST_FILE) --host $(HOST)
25+
26+
locust-headless:
27+
$(PYTHON) -m locust -f $(LOCUST_FILE) \
28+
--host $(HOST) \
29+
--headless \
30+
-u 10 \
31+
-r 2 \
32+
-t 60s
33+
34+
freeze:
35+
$(PIP) freeze > requirements.txt
36+
37+
clean:
38+
find . -type d -name "__pycache__" -exec rm -rf {} +
39+
find . -type f -name "*.pyc" -delete
40+
41+
test:
42+
$(PYTHON) -m pytest
43+
44+
format:
45+
$(PYTHON) -m black .
46+
47+
format-check:
48+
$(PYTHON) -m black --check .
49+
50+
lint:
51+
$(PYTHON) -m ruff check .
52+
53+
all: format-check lint test

0 commit comments

Comments
 (0)