-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
90 lines (72 loc) · 2.13 KB
/
Makefile
File metadata and controls
90 lines (72 loc) · 2.13 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
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
85
86
87
88
89
90
IMAGE_NAME = coapy-server
PORT = 5683
.PHONY: help
help:
@echo "Available commands:"
@echo " make setup - Install dependencies using uv"
@echo " make run - Run the CoAP server locally"
@echo " make lint - Run code quality checks (ruff & mypy)"
@echo " make test - Run tests (pytest)"
@echo " make docker-build - Build the Docker image"
@echo " make docker-run - Run the server in a Docker container"
@echo " make clean - Remove temporary files and caches"
.PHONY: setup
setup:
uv sync
.PHONY: run
run:
uv run python -m src.main
.PHONY: run-client-get
run-client-get:
uv run python -m tests.integration.manual_tests.client_script_get
.PHONY: run-client-post
run-client-post:
uv run python -m tests.integration.manual_tests.client_script_post
.PHONY: run-client-put
run-client-put:
uv run python -m tests.integration.manual_tests.client_script_put
.PHONY: run-client-delete
run-client-delete:
uv run python -m tests.integration.manual_tests.client_script_delete
.PHONY: run-client-404
run-client-404:
uv run python -m tests.integration.manual_tests.client_script_not_found
.PHONY: run-client-405
run-client-405:
uv run python -m tests.integration.manual_tests.client_script_method_not_allowed
.PHONY: stress-test
stress-test:
uv run python -m tests.integration.stress_test
.PHONY: lint
lint:
@echo "Running Ruff (Linter)..."
uv run ruff check src/
@echo "Running Mypy (Type Checker)..."
uv run mypy src/
.PHONY: format
format:
uv run ruff format src/
.PHONY: test-unit
test-unit:
uv run pytest tests/unit
.PHONY: test-integration
test-integration:
uv run pytest tests/integration/*
.PHONY: docker-build
docker-build:
docker build -t $(IMAGE_NAME) .
.PHONY: docker-run
docker-run:
docker run -d --rm -p $(PORT):$(PORT)/udp --name $(IMAGE_NAME)_inst $(IMAGE_NAME)
@echo "Server is running in background. To see logs: docker logs -f $(IMAGE_NAME)_inst"
.PHONY: docker-stop
docker-stop:
docker stop $(IMAGE_NAME)_inst
.PHONY: clean
clean:
rm -rf .venv
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .ruff_cache
rm -rf __pycache__
find . -type d -name "__pycache__" -exec rm -rf {} +