forked from punitarani/fli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (72 loc) · 2.38 KB
/
Copy pathMakefile
File metadata and controls
86 lines (72 loc) · 2.38 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
# Makefile
# List of directories and files to format and lint
TARGETS = fli/ scripts/ tests/
# Install dependencies
install:
uv sync
install-dev:
uv sync --extra dev
install-all:
uv sync --extra dev
# Run the MCP server
mcp:
uv run fli-mcp
# Build the docs
docs:
uv run --extra dev mkdocs build
# Format code using ruff
format:
uv run --extra dev ruff format $(TARGETS)
# Lint code using ruff
lint:
uv run --extra dev ruff check $(TARGETS)
# Lint and fix code using ruff
lint-fix:
uv run --extra dev ruff check --fix $(TARGETS)
# Run tests
test:
uv run --extra dev pytest -vv
test-mcp:
uv run --extra dev pytest -vv --mcp
test-fuzz:
uv run --extra dev pytest -vv --fuzz
test-all:
uv run --extra dev pytest -vv --all
# Run CI locally using act (requires Docker and act: https://github.com/nektos/act)
ci:
act -j lint -j test --workflows .github/workflows/test.yml
# Run CI in Docker container (mounts source and Docker socket for act)
ci-docker:
docker run --rm \
-v /var/run/docker.sock:/var/run/docker.sock \
-v $(PWD):/workspace \
-w /workspace \
fli-dev make ci
# Build dev container
devcontainer:
docker build -t fli-dev -f .devcontainer/Dockerfile .
# Generate the requirements.txt file
requirements:
uv export --format requirements-txt --no-hashes > requirements.txt
# Display help message by default
.DEFAULT_GOAL := help
help:
@echo "Available commands:"
@echo " make install - Install dependencies"
@echo " make install-dev - Install with dev dependencies"
@echo " make install-all - Install all dependencies"
@echo " make mcp - Run the MCP server"
@echo " make docs - Build the docs"
@echo " make format - Format code using ruff"
@echo " make lint - Lint code using ruff"
@echo " make lint-fix - Lint and fix code using ruff"
@echo " make test - Run tests"
@echo " make test-mcp - Run tests with MCP"
@echo " make test-fuzz - Run tests with fuzzing"
@echo " make test-all - Run all tests"
@echo " make ci - Run CI locally using act (requires Docker)"
@echo " make ci-docker - Run CI in Docker container"
@echo " make devcontainer - Build dev container image"
@echo " make requirements - Generate the requirements.txt file"
# Declare the targets as phony
.PHONY: help install install-dev install-all mcp docs format lint lint-fix test test-mcp test-fuzz test-all ci ci-docker devcontainer requirements