-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (66 loc) · 1.86 KB
/
Makefile
File metadata and controls
80 lines (66 loc) · 1.86 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
.PHONY: help install install-dev test lint format clean run docker build
help:
@echo "Available commands:"
@echo " install Install dependencies (with UV or pip fallback)"
@echo " install-dev Install dev dependencies"
@echo " install-pip Install using pip only"
@echo " test Run tests"
@echo " test-all Run comprehensive test suite"
@echo " lint Run linting"
@echo " format Format code"
@echo " clean Clean build artifacts"
@echo " run Run the server"
@echo " docker Build Docker image"
@echo " build Build package"
# Check if UV is available, fallback to pip
# Note: Windows PowerShell compatibility - use Select-String instead of grep
install:
@if command -v uv >/dev/null 2>&1; then \
echo "Using UV for installation..."; \
uv sync; \
else \
echo "UV not found, using pip fallback..."; \
pip install -e .; \
fi
install-dev:
@if command -v uv >/dev/null 2>&1; then \
echo "Using UV for dev installation..."; \
uv sync --dev; \
else \
echo "UV not found, using pip for dev installation..."; \
pip install -e .; \
pip install pytest pytest-cov freezegun ruff pyright; \
fi
install-pip:
pip install -e .
test:
python -m pytest tests/ -v
test-all:
python -m pytest tests/ --tb=short
test-coverage:
python -m pytest tests/ --cov=chronos_protocol --cov-report=html
lint:
ruff check .
pyright .
format:
ruff format .
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
run:
python -m chronos_protocol
docker:
docker build -t chronos-protocol .
run-docker:
docker run -it --rm -v $(PWD)/data:/app/data chronos-protocol
build:
@if command -v uv >/dev/null 2>&1; then \
echo "Building with UV..."; \
uv build; \
else \
echo "UV not found, using pip build..."; \
python -m build; \
fi