-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
95 lines (76 loc) · 1.89 KB
/
Makefile
File metadata and controls
95 lines (76 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Project Makefile for emllm (Large Language Model Email Message Language)
# Project name
PROJECT_NAME = emllm
# Poetry environment
POETRY := poetry
# Python paths
PYTHON := $(shell $(POETRY) env info --path)/bin/python
PYTHON_SRC := src/$(PROJECT_NAME)
.PHONY: install test lint clean build publish docs start-server test-message test-api test-cli
# Install dependencies and package
install:
$(POETRY) install
# Run all tests
.PHONY: test
test:
$(PYTHON) -m pytest tests/ --cov=$(PYTHON_SRC) --cov-report=term-missing
# Run API tests
.PHONY: test-api
test-api:
$(PYTHON) -m pytest tests/test_api.py
# Run CLI tests
.PHONY: test-cli
test-cli:
$(PYTHON) -m pytest tests/test_cli.py
# Run validator tests
.PHONY: test-validator
test-validator:
$(PYTHON) -m pytest tests/test_validator.py
# Run linters
.PHONY: lint
lint:
$(PYTHON) -m black .
$(PYTHON) -m isort .
$(PYTHON) -m flake8 .
# Run type checking
.PHONY: type-check
type-check:
$(PYTHON) -m mypy .
# Clean up
.PHONY: clean
clean:
rm -rf dist/
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .coverage
rm -rf htmlcov/
# Build package
.PHONY: build
build:
$(POETRY) version patch
$(POETRY) build
# Publish package to PyPI
.PHONY: publish
publish: build
$(POETRY) publish --no-interaction
# Generate documentation
.PHONY: docs
docs:
$(PYTHON) -m pdoc --html --output-dir docs .
# Clean up
.PHONY: clean
clean:
$(POETRY) env remove
rm -rf .mypy_cache/ .pytest_cache/ .coverage/ .coverage.* coverage.xml htmlcov/ .cache/ .tox/ .venv/ .eggs/ *.egg-info/ dist/ build/ docs/
# Start REST server
.PHONY: start-server
start-server:
$(PYTHON) -m emllm.cli rest --host 0.0.0.0 --port 8000
# Test message parsing
.PHONY: test-message
test-message:
$(PYTHON) -m emllm.cli parse "From: test@example.com\nTo: recipient@example.com\nSubject: Test\n\nHello World"
# Run full test suite
.PHONY: test-all
test-all: lint type-check test
echo "All tests passed!"