forked from rayhunter/omd
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
116 lines (100 loc) · 3.42 KB
/
Copy pathMakefile
File metadata and controls
116 lines (100 loc) · 3.42 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Project configuration
PROJECTS = OpenManus enhanced_agent
VENV = .venv
PYTHON = $(VENV)/bin/python
UV = uv
# Default target
all: install
# Create virtual environment
venv:
@echo "Creating virtual environment..."
@$(UV) venv
@echo "Installing uv tools..."
@$(UV) pip install --upgrade pip uv
# Install all packages in development mode
install: venv
@echo "Installing all packages in development mode..."
@for project in $(PROJECTS); do \
echo "Installing $$project..."; \
(cd $$project && $(UV) pip install -e .); \
done
# Install production dependencies
install-prod: venv
@echo "Installing production dependencies..."
@for project in $(PROJECTS); do \
echo "Installing $$project..."; \
(cd $$project && $(UV) pip install .); \
done
# Generate lock files
lock:
@echo "Generating lock files..."
@for project in $(PROJECTS); do \
echo "Generating lock file for $$project..."; \
(cd $$project && $(UV) pip compile -o requirements.lock pyproject.toml); \
done
# Run tests using virtual environment
test:
@echo "Running consolidated tests..."
@./virtual/bin/python -m pytest tests/ -v
# Run unit tests only
test-unit:
@echo "Running unit tests..."
@./virtual/bin/python -m pytest tests/unit/ -v -m unit
# Run integration tests only
test-integration:
@echo "Running integration tests..."
@./virtual/bin/python -m pytest tests/integration/ -v -m integration
# Run tests with coverage
test-coverage:
@echo "Running tests with coverage..."
@./virtual/bin/python -m pytest tests/ --cov=enhanced_agent --cov=OpenManus --cov-report=html --cov-report=term
# Run fast tests (exclude slow ones)
test-fast:
@echo "Running fast tests..."
@./virtual/bin/python -m pytest tests/ -v -m "not slow"
# Run individual project tests (legacy)
test-projects: install
@echo "Running individual project tests..."
@for project in $(PROJECTS); do \
echo "Testing $$project..."; \
(cd $$project && $(PYTHON) -m pytest -v || exit 1); \
done
# Run linting
lint: install
@echo "Running linting..."
@$(UV) pip install black flake8 isort
@for project in $(PROJECTS); do \
echo "Linting $$project..."; \
(cd $$project && black --check . && flake8 . && isort --check-only .) || exit 1; \
done
# Format code
format:
@echo "Formatting code..."
@$(UV) pip install black isort
@for project in $(PROJECTS); do \
echo "Formatting $$project..."; \
(cd $$project && black . && isort .); \
done
# Clean up
clean:
@echo "Cleaning up..."
@rm -rf $(VENV)
@find . -type d -name "__pycache__" -exec rm -r {} +
@find . -type d -name ".pytest_cache" -exec rm -r {} +
@find . -type d -name ".mypy_cache" -exec rm -r {} +
# Help message
help:
@echo "Available commands:"
@echo " make install Install all packages in development mode"
@echo " make install-prod Install production dependencies"
@echo " make lock Generate lock files"
@echo " make test Run all tests"
@echo " make test-unit Run unit tests only"
@echo " make test-integration Run integration tests only"
@echo " make test-coverage Run tests with coverage"
@echo " make test-fast Run fast tests (exclude slow)"
@echo " make test-projects Run individual project tests (legacy)"
@echo " make lint Run linting"
@echo " make format Format code"
@echo " make clean Clean up"
.PHONY: all venv install install-prod lock test test-unit test-integration test-coverage test-fast test-projects lint format clean help