-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
99 lines (86 loc) · 2.89 KB
/
Makefile
File metadata and controls
99 lines (86 loc) · 2.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
96
97
98
99
# Makefile for sumd
# Provides convenient commands for development, testing, and deployment
.PHONY: help install install-dev test clean publish publish-confirm publish-test version
# Default target
help:
@echo "🚀 SUMD Development Commands"
@echo "============================"
@echo ""
@echo "Setup:"
@echo " install Install sumd in development mode"
@echo " install-dev Install sumd with dev dependencies"
@echo ""
@echo "Development:"
@echo " test Run tests"
@echo " lint Run linting"
@echo " format Format code"
@echo " clean Clean temporary files"
@echo ""
@echo "Release:"
@echo " publish Build package for PyPI (dry-run)"
@echo " publish-confirm Upload to PyPI"
@echo " publish-test Upload to TestPyPI"
@echo " version Show current version"
@echo ""
# Installation
install:
@echo "📦 Installing sumd..."
@if command -v uv > /dev/null 2>&1; then \
uv pip install -e .; \
else \
pip install -e .; \
fi
@echo "✅ Installation completed!"
install-dev:
@echo "📦 Installing sumd with dev dependencies..."
@if command -v uv > /dev/null 2>&1; then \
uv pip install -e ".[dev]"; \
else \
pip install -e ".[dev]"; \
fi
@echo "✅ Dev installation completed!"
# Testing
test:
@echo "🧪 Running tests..."
.venv/bin/python -m pytest tests/ -v --tb=short
test-cov:
@echo "🧪 Running tests with coverage..."
.venv/bin/python -m pytest tests/ -v --cov=sumd --cov-report=term-missing --cov-report=json
# Code quality
lint:
@echo "🔍 Running linting with ruff..."
.venv/bin/python -m ruff check sumd/
.venv/bin/python -m ruff check tests/
format:
@echo "📝 Formatting code with ruff..."
.venv/bin/python -m ruff format sumd/
.venv/bin/python -m ruff format tests/
# Utilities
clean:
@echo "🧹 Cleaning temporary files..."
find . -type f -name "*.pyc" -delete
find . -type d -name "__pycache__" -delete
find . -type d -name "*.egg-info" -exec rm -rf {} + 2>/dev/null || true
rm -rf build/ dist/ .coverage htmlcov/ coverage.json
@echo "✅ Clean completed!"
# Release helpers
publish:
@echo "📦 Publishing to PyPI..."
@command -v .venv/bin/twine > /dev/null 2>&1 || (.venv/bin/pip install --upgrade twine build)
rm -rf dist/ build/ *.egg-info/
.venv/bin/python -m build
.venv/bin/twine check dist/*
@echo "⚡ Ready to upload. Run: make publish-confirm to upload to PyPI"
publish-confirm:
@echo "🚀 Uploading to PyPI..."
.venv/bin/twine upload dist/*
publish-test:
@echo "📦 Publishing to TestPyPI..."
@command -v .venv/bin/twine > /dev/null 2>&1 || (.venv/bin/pip install --upgrade twine build)
rm -rf dist/ build/ *.egg-info/
.venv/bin/python -m build
.venv/bin/twine upload --repository testpypi dist/*
version:
@echo "📦 Version information..."
@cat VERSION
@.venv/bin/python -c "from importlib.metadata import version; print(f'Installed version: {version(\"sumd\")}')"