-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
75 lines (54 loc) · 1.89 KB
/
Makefile
File metadata and controls
75 lines (54 loc) · 1.89 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
.PHONY: help install dev test lint format build publish image-build image-run image-push image-up image-down image-logs binary clean
DOCKER_IMAGE ?= ghcr.io/smartql/smartql
DOCKER_TAG ?= latest
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
# Development
install: ## Install dependencies
uv sync
dev: ## Install with dev dependencies
uv sync --extra dev
test: ## Run tests
uv run pytest tests/ -v
lint: ## Run linter
uv run ruff check src/ tests/
fix: ## Fix lint issues automatically
uv run ruff check src/ tests/ --fix
uv run ruff format src/ tests/
format: ## Format code
uv run ruff format src/ tests/
check: lint test ## Run lint and tests
# Python packaging
build: ## Build Python package
python -m build
publish: build ## Publish to PyPI
twine upload dist/*
# Docker
image-build: ## Build Docker image
docker build -t $(DOCKER_IMAGE):$(DOCKER_TAG) .
image-run: ## Run Docker container standalone
docker run -p 5000:8000 \
-v ./config.yml:/app/config.yml:ro \
-e GROQ_API_KEY=$(GROQ_API_KEY) \
$(DOCKER_IMAGE):$(DOCKER_TAG)
image-push: ## Push Docker image to GitHub Container Registry
docker push $(DOCKER_IMAGE):$(DOCKER_TAG)
image-up: ## Start with docker-compose
docker compose up -d
image-down: ## Stop docker-compose
docker compose down
image-logs: ## View docker-compose logs
docker compose logs -f
# Binary
binary: ## Build standalone binary with PyInstaller
pyinstaller smartql.spec
@echo "Binary created at dist/smartql"
# CLI shortcuts
shell: ## Start interactive shell
smartql shell -c config.yml
serve: ## Start HTTP server on port 5000
smartql serve -c config.yml --port 5000
# Cleanup
clean: ## Clean build artifacts
rm -rf build/ dist/ *.egg-info .pytest_cache .coverage htmlcov/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true