-
Notifications
You must be signed in to change notification settings - Fork 127
Expand file tree
/
Copy pathMakefile
More file actions
144 lines (114 loc) · 3.45 KB
/
Makefile
File metadata and controls
144 lines (114 loc) · 3.45 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
137
138
139
140
141
142
143
144
# Makefile for Promptise development and deployment
.PHONY: help install install-dev test lint format clean build publish docker-build docker-run docs serve-docs
# Default target
help:
@echo "Promptise - Development Commands"
@echo ""
@echo "Setup:"
@echo " make install Install Promptise"
@echo " make install-dev Install with development dependencies"
@echo ""
@echo "Development:"
@echo " make test Run tests"
@echo " make test-cov Run tests with coverage"
@echo " make lint Run linters (ruff)"
@echo " make format Format code (ruff)"
@echo " make type-check Run type checking (mypy)"
@echo " make pre-commit Run pre-commit hooks"
@echo ""
@echo "Build & Publish:"
@echo " make clean Clean build artifacts"
@echo " make build Build distribution packages"
@echo " make publish Publish to PyPI"
@echo " make publish-test Publish to TestPyPI"
@echo ""
@echo "Docker:"
@echo " make docker-build Build Docker image"
@echo " make docker-run Run Docker container"
@echo " make docker-compose Start all services with docker-compose"
@echo ""
@echo "Documentation:"
@echo " make docs Build documentation"
@echo " make serve-docs Serve documentation locally"
@echo ""
@echo "Examples:"
@echo " make run-example Run basic example"
@echo " make run-orchestration Run orchestration example"
# Installation
install:
pip install -e .
install-dev:
pip install -e ".[dev,orchestration,sandbox]"
pre-commit install
# Testing
test:
pytest tests/ -v
test-cov:
pytest tests/ -v --cov=src/promptise --cov-report=html --cov-report=term
test-integration:
pytest tests/ -v -m integration
# Linting and formatting
lint:
ruff check src/ tests/ examples/
format:
ruff format src/ tests/ examples/
ruff check --fix src/ tests/ examples/
type-check:
mypy src/
pre-commit:
pre-commit run --all-files
# Build and publish
clean:
rm -rf build/ dist/ *.egg-info site/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .pytest_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .ruff_cache -exec rm -rf {} + 2>/dev/null || true
find . -type d -name .mypy_cache -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
build: clean
python -m build
publish: build
twine upload dist/*
publish-test: build
twine upload --repository testpypi dist/*
# Docker
docker-build:
docker build -t promptise:latest .
docker-run:
docker run -it --rm \
-e OPENAI_API_KEY=${OPENAI_API_KEY} \
-p 8000:8000 \
promptise:latest
docker-compose:
docker-compose up -d
docker-compose-down:
docker-compose down -v
# Documentation
docs:
mkdocs build --strict
serve-docs:
mkdocs serve
deploy-docs:
mkdocs gh-deploy --force
# Examples
run-example:
python examples/agents/use_agent.py
run-orchestration:
python examples/orchestration/01-basic-pool/basic_pool.py
run-swarm:
python examples/orchestration/03-autonomous-swarm/simple_broadcast.py
# CI/CD helpers
ci-install:
pip install -e ".[dev,orchestration,sandbox]"
ci-test:
pytest tests/ -v --cov=src/promptise --cov-report=xml --cov-report=term
ci-lint:
ruff check src/ tests/
mypy src/
# Development shortcuts
dev-setup: install-dev
@echo "Development environment ready!"
@echo "Run 'make test' to run tests"
@echo "Run 'make serve-docs' to preview documentation"
check: lint type-check test
@echo "All checks passed!"