-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
136 lines (112 loc) · 3.27 KB
/
Makefile
File metadata and controls
136 lines (112 loc) · 3.27 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
# RAPiD Makefile
# Provides convenient commands for development and building
.PHONY: help install install-dev install-all clean build test test-cov lint format check docs examples
# Default target
help:
@echo "RAPiD Development Commands"
@echo "=========================="
@echo ""
@echo "Installation:"
@echo " install - Install RAPiD in development mode"
@echo " install-dev - Install with development dependencies"
@echo " install-all - Install with all optional dependencies"
@echo ""
@echo "Development:"
@echo " test - Run tests"
@echo " test-cov - Run tests with coverage"
@echo " lint - Run linting checks"
@echo " format - Format code with black and isort"
@echo " check - Run all checks (lint + test)"
@echo ""
@echo "Building:"
@echo " build - Build package distribution"
@echo " clean - Clean build artifacts"
@echo ""
@echo "Documentation:"
@echo " docs - Build documentation"
@echo " examples - Run example scripts"
@echo ""
@echo "Utilities:"
@echo " help - Show this help message"
# Installation targets
install:
pip install -e .
install-dev:
pip install -e ".[dev]"
install-all:
pip install -e ".[dev,all]"
# Development targets
test:
python -m pytest rapid_seg/tests/ -v
test-cov:
python -m pytest rapid_seg/tests/ --cov=rapid_seg --cov-report=html --cov-report=term
lint:
black --check rapid_seg/ examples/ scripts/
isort --check-only rapid_seg/ examples/ scripts/
mypy rapid_seg/
format:
black rapid_seg/ examples/ scripts/
isort rapid_seg/ examples/ scripts/
check: lint test
# Building targets
build:
python -m build
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf __pycache__/
rm -rf .pytest_cache/
rm -rf htmlcov/
rm -f .coverage
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
# Documentation targets
docs:
cd docs && make html
examples:
@echo "Running basic example..."
@python examples/basic_usage.py
@echo ""
@echo "Running comprehensive example..."
@python examples/example_usage.py
@echo ""
@echo "Running advanced features example..."
@python examples/advanced_features.py
# Quick development workflow
dev: install-dev format lint test
# Full development setup
setup: install-all format lint test-cov
# Release preparation
release: clean format lint test build
# Docker support (if needed)
docker-build:
docker build -t rapid-seg .
docker-run:
docker run -it rapid-seg
# Environment management
venv:
python -m venv .venv
@echo "Virtual environment created. Activate with:"
@echo " source .venv/bin/activate # Linux/Mac"
@echo " .venv\\Scripts\\activate # Windows"
venv-clean:
rm -rf .venv/
# Performance testing
benchmark:
@echo "Running performance benchmarks..."
@python examples/advanced_features.py
# Code quality
quality: format lint test-cov
@echo "Code quality checks completed!"
# Quick start for new developers
quickstart: venv
@echo "Activating virtual environment..."
@source .venv/bin/activate && make install-dev
@echo "Running tests..."
@source .venv/bin/activate && make test
@echo "Running examples..."
@source .venv/bin/activate && make examples
@echo ""
@echo "Quick start completed! 🚀"
@echo "Activate your environment with: source .venv/bin/activate"