-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
82 lines (67 loc) · 1.93 KB
/
Makefile
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
.PHONY: all setup test lint format check clean install install-dev build publish
# Default target
all: setup lint test
# Setup development environment
setup:
poetry install --with dev
# Run tests
test:
poetry run pytest tests/ -v
# Run all linting and type checking
lint: format-check lint-check type-check
# Format code
format:
poetry run black .
poetry run isort .
# Check formatting
format-check:
poetry run black --check .
poetry run isort --check .
# Run linting
lint-check:
poetry run ruff check .
# Run type checking
type-check:
poetry run mypy src/
# Clean up
clean:
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache
rm -rf .mypy_cache
rm -rf .ruff_cache
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Build package
build: clean
poetry build
# Install package locally
install:
poetry install
# Install development dependencies
install-dev:
poetry install --with dev
# Export requirements
requirements:
poetry export -f requirements.txt --output requirements.txt --without-hashes
poetry export -f requirements.txt --output requirements-dev.txt --with dev --without-hashes
# Run the server
run:
poetry run python -m mockllm
# Help target
help:
@echo "Available targets:"
@echo " all : Run setup, lint, and test"
@echo " setup : Set up development environment with Poetry"
@echo " test : Run tests"
@echo " lint : Run all code quality checks"
@echo " format : Format code with black and isort"
@echo " format-check : Check code formatting"
@echo " lint-check : Run ruff linter"
@echo " type-check : Run mypy type checker"
@echo " clean : Clean up build artifacts"
@echo " build : Build package"
@echo " install : Install package with Poetry"
@echo " install-dev : Install package with development dependencies"
@echo " requirements : Export requirements.txt files"
@echo " run : Run the server"