-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
118 lines (98 loc) · 3.65 KB
/
Makefile
File metadata and controls
118 lines (98 loc) · 3.65 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
# IntelliTag - Makefile
# Common development commands
.PHONY: help install install-dev test lint format clean run train
# Default target
help:
@echo "IntelliTag - Available Commands"
@echo "================================"
@echo ""
@echo "Setup:"
@echo " make install Install production dependencies"
@echo " make install-dev Install development dependencies"
@echo ""
@echo "Development:"
@echo " make test Run test suite"
@echo " make test-cov Run tests with coverage"
@echo " make lint Run linters (flake8, mypy)"
@echo " make format Format code (black, isort)"
@echo " make check Run all checks (lint + test)"
@echo ""
@echo "Application:"
@echo " make run Start API server"
@echo " make train Train models"
@echo ""
@echo "Maintenance:"
@echo " make clean Remove build artifacts"
@echo " make clean-all Remove all generated files"
# =============================================================================
# Setup
# =============================================================================
install:
pip install -r requirements.txt
pip install -e .
install-dev:
pip install -r requirements-dev.txt
pip install -e .
pre-commit install
# =============================================================================
# Testing
# =============================================================================
test:
pytest tests/ -v
test-cov:
pytest tests/ -v --cov=src/intellitag --cov-report=html --cov-report=term-missing
test-unit:
pytest tests/unit/ -v
test-integration:
pytest tests/integration/ -v -m integration
# =============================================================================
# Code Quality
# =============================================================================
lint:
flake8 src/intellitag tests
mypy src/intellitag
format:
black src/intellitag tests
isort src/intellitag tests
check: lint test
# =============================================================================
# Application
# =============================================================================
run:
uvicorn intellitag.api.app:app --reload --host 0.0.0.0 --port 8000
run-prod:
uvicorn intellitag.api.app:app --host 0.0.0.0 --port 8000 --workers 4
# =============================================================================
# Training
# =============================================================================
train:
python scripts/train.py
evaluate:
python scripts/evaluate.py
# =============================================================================
# Notebooks
# =============================================================================
notebook:
jupyter notebook notebooks/
# =============================================================================
# Cleanup
# =============================================================================
clean:
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type d -name ".pytest_cache" -exec rm -rf {} +
find . -type d -name ".mypy_cache" -exec rm -rf {} +
find . -type d -name "*.egg-info" -exec rm -rf {} +
rm -rf build/ dist/ htmlcov/ .coverage
clean-all: clean
rm -rf .venv venv
rm -rf data/processed/*
rm -rf models/*
# =============================================================================
# Docker (optional)
# =============================================================================
docker-build:
docker build -t intellitag:latest .
docker-run:
docker run -p 8000:8000 intellitag:latest