-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (53 loc) · 1.62 KB
/
Makefile
File metadata and controls
63 lines (53 loc) · 1.62 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
.PHONY: setup install clean lint test run proto help
# Default target
help:
@echo "Available targets:"
@echo " setup - Install Poetry and project dependencies"
@echo " install - Install the package in development mode"
@echo " clean - Clean up build artifacts and cache files"
@echo " lint - Run linting tools"
@echo " test - Run tests"
@echo " run - Run the service"
@echo " proto - Generate Python code from proto files"
@echo " help - Show this help message"
# Setup development environment
setup:
poetry install
# Install the package in development mode
install:
poetry install
# Clean up build artifacts and cache files
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache
rm -rf .coverage
rm -rf htmlcov
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Run linting tools
lint:
poetry run black executor tests
poetry run isort executor tests
poetry run pylint executor tests
poetry run mypy executor
# Run tests
test:
poetry run pytest --cov=executor tests/
# Run the service with default config
run:
poetry run python -m executor.main
# Run the service with custom config file
run-with-config:
poetry run python -m executor.main --config ./config.yaml
# Generate Python code from proto files
proto:
poetry run python -m grpc_tools.protoc -I./proto --python_out=./proto --grpc_python_out=./proto ./proto/executor.proto
# Create a new test directory
test-setup:
mkdir -p tests/unit
mkdir -p tests/integration
touch tests/__init__.py
touch tests/unit/__init__.py
touch tests/integration/__init__.py