-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
55 lines (42 loc) · 1.23 KB
/
Makefile
File metadata and controls
55 lines (42 loc) · 1.23 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
# Makefile for Calculator Project
.PHONY: run ui dev test unit-test api-test lint format clean docker docker-up docker-down
## Run FastAPI app with Uvicorn
run:
uvicorn main:app --reload --host 0.0.0.0 --port 8000
## Run Streamlit UI
ui:
streamlit run streamlit_app.py
## Run FastAPI (backend) + Streamlit (frontend) together
dev:
@echo "🚀 Starting FastAPI backend + Streamlit frontend..."
@gnome-terminal -- bash -c "uvicorn main:app --reload --host 0.0.0.0 --port 8000; exec bash" || \
start cmd /k "uvicorn main:app --reload --host 0.0.0.0 --port 8000" &
@streamlit run streamlit_app.py
## Run all tests with coverage report
test:
pytest --cov=app --cov-report=term-missing
## Run functional/unit tests only
unit-test:
pytest func_tests
## Run API tests only
api-test:
pytest api_test
## Lint with flake8
lint:
flake8 app func_tests api_test main.py
## Format code with black
format:
black app func_tests api_test main.py
## Remove __pycache__ and logs
clean:
find . -type d -name '__pycache__' -exec rm -r {} +
rm -rf logs
## Build Docker image
docker:
docker build -t calculator-api .
## Run Docker container with docker-compose
docker-up:
docker-compose up --build
## Stop Docker container
docker-down:
docker-compose down