File size: 1,802 Bytes
832348e
 
 
 
 
 
 
 
 
10d71ba
 
832348e
 
 
10d71ba
832348e
 
 
 
 
 
 
 
 
 
 
 
 
 
10d71ba
 
 
832348e
 
 
 
 
 
 
10d71ba
 
 
 
 
832348e
 
10d71ba
 
 
 
832348e
 
10d71ba
832348e
 
10d71ba
832348e
 
 
 
10d71ba
 
 
 
 
 
 
 
 
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
.PHONY: help install test lint format clean build run deploy

help: ## Show this help message
	@echo 'Usage: make [target]'
	@echo ''
	@echo 'Targets:'
	@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "  %-15s %s\n", $$1, $$2}' $(MAKEFILE_LIST)

install: ## Install dependencies
	pip install -e .
	pip install -e ".[dev]"
	pre-commit install

test: ## Run tests
	pytest tests/ -v --cov=src --cov-report=html --cov-report=xml

lint: ## Run linting
	flake8 src/ tests/
	mypy src/

format: ## Format code
	black src/ tests/
	isort src/ tests/

clean: ## Clean build artifacts
	find . -type f -name "*.pyc" -delete
	find . -type d -name "__pycache__" -delete
	rm -rf .pytest_cache/
	rm -rf htmlcov/
	rm -rf build/
	rm -rf dist/
	rm -rf *.egg-info/

build: ## Build Docker image
	docker build -t fred-ml .

run: ## Run application locally
	uvicorn src.main:app --reload --host 0.0.0.0 --port 8000

run-docker: ## Run with Docker Compose (development)
	docker-compose -f deploy/docker/docker-compose.dev.yml up --build

run-prod: ## Run with Docker Compose (production)
	docker-compose -f deploy/docker/docker-compose.prod.yml up --build

deploy: ## Deploy to Kubernetes
	kubectl apply -f deploy/kubernetes/

deploy-helm: ## Deploy with Helm
	helm install fred-ml deploy/helm/

logs: ## View application logs
	docker-compose -f deploy/docker/docker-compose.dev.yml logs -f fred-ml

shell: ## Open shell in container
	docker-compose -f deploy/docker/docker-compose.dev.yml exec fred-ml bash

migrate: ## Run database migrations
	alembic upgrade head

setup-dev: install format lint test ## Setup development environment

ci: test lint format ## Run CI checks locally

package: clean build ## Build package for distribution
	python -m build

publish: package ## Publish to PyPI
	twine upload dist/*