-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
168 lines (130 loc) · 4.01 KB
/
Makefile
File metadata and controls
168 lines (130 loc) · 4.01 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
.PHONY: help install install-dev test test-watch lint lint-fix format type-check security clean clean-py docs docs-serve docs-live build publish
# Default target
help:
@echo "Available commands:"
@echo " install Install package"
@echo " install-dev Install package with development dependencies"
@echo " test Run tests"
@echo " test-watch Run tests in watch mode"
@echo " test-cov Run tests with coverage"
@echo " lint Run linting"
@echo " lint-fix Auto-fix linting issues"
@echo " format Format code"
@echo " type-check Run type checking"
@echo " security Run security checks"
@echo " clean Clean build artifacts"
@echo " clean-py Clean Python cache files"
@echo " docs Build documentation"
@echo " docs-serve Serve documentation locally"
@echo " docs-live Live documentation preview with auto-reload"
@echo " build Build package"
@echo " publish Publish package to PyPI"
# Installation
install:
uv sync
install-dev:
uv sync --dev
install-all:
uv sync --all-extras
# Testing
test:
uv run pytest -v
test-cov:
uv run pytest --cov=src --cov-report=html --cov-report=term-missing -v
test-fast:
uv run pytest -v -m "not slow"
test-integration:
uv run pytest -v -m integration
test-watch:
uv run ptw -- -n auto --cov=src
# Code quality
lint:
uv run ruff check src/ tests/
uv run ruff format --check src/ tests/
lint-fix:
uv run ruff check src/ tests/ --fix
format:
uv run ruff check src/ tests/ --fix
uv run ruff format src/ tests/
type-check:
uv run mypy src/ --ignore-missing-imports
security:
uv run bandit -r src/ -f json -o bandit-report.json
uv run safety check
# Combined quality checks
check: lint type-check security test
quality: format check
# Documentation
docs:
cd docs && uv run sphinx-build -b html . _build/html
docs-serve:
cd docs && uv run sphinx-autobuild . _build/html --host 0.0.0.0 --port 8000
docs-live:
cd docs && uv run sphinx-autobuild . _build/html --host 0.0.0.0 --port 8000 --open-browser
docs-linkcheck:
cd docs && uv run sphinx-build -b linkcheck . _build/linkcheck
# Build and distribution
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf htmlcov/
rm -rf .coverage
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -delete
find . -type f -name "*.pyc" -delete
clean-py:
rm -rf htmlcov/
rm -rf .coverage
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ ! -path "*/.venv/*" -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" ! -path "*/.venv/*" -delete
find . -type f -name "*.pyo" ! -path "*/.venv/*" -delete
find . -type f -name ".coverage.*" ! -path "*/.venv/*" -delete
build: clean
uv build
# Local installation for testing
install-local: build
pip install dist/*.whl --force-reinstall
# Publishing (requires proper authentication)
publish-test: build
uv run twine upload --repository testpypi dist/*
publish: build
uv run twine upload dist/*
# Development workflow
dev-setup: install-dev
uv run pre-commit install
# Quick development cycle
dev: format test
# Full CI simulation
ci: lint type-check security test-cov docs
# Performance profiling
profile:
uv run python -m cProfile -o profile.stats src/cli_simple.py analyze -i test_data/test_futures.csv -o output/
# Memory profiling
memory-profile:
uv run python -m memory_profiler src/cli_simple.py analyze -i test_data/test_futures.csv -o output/
# Benchmarking
benchmark:
uv run pytest tests/benchmarks/ -v
# Docker (if applicable)
docker-build:
docker build -t hmm-futures-analysis .
docker-run:
docker run --rm -v $(PWD)/data:/app/data hmm-futures-analyze
# Release workflow
version-patch:
@echo "Bumping patch version..."
@uv run hatch version patch
version-minor:
@echo "Bumping minor version..."
@uv run hatch version minor
version-major:
@echo "Bumping major version..."
@uv run hatch version major
release: clean check docs build
@echo "Ready to release! Run 'make publish' to upload to PyPI."