-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
104 lines (85 loc) · 2.84 KB
/
Makefile
File metadata and controls
104 lines (85 loc) · 2.84 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
.PHONY: help install dev-install test test-verbose test-coverage clean format lint type-check build publish benchmark pre-commit-install pre-commit-run pre-commit-update all
# Default target
help:
@echo "Available commands:"
@echo " make install - Install package in development mode"
@echo " make dev-install - Install package with development dependencies"
@echo " make test - Run tests"
@echo " make test-verbose - Run tests with verbose output"
@echo " make test-coverage - Run tests with coverage report"
@echo " make format - Format code with ruff"
@echo " make lint - Lint code with ruff"
@echo " make type-check - Run type checking with mypy"
@echo " make check - Run all checks (format, lint, type-check, test)"
@echo " make pre-commit-install - Install pre-commit hooks"
@echo " make pre-commit-run - Run pre-commit on all files"
@echo " make pre-commit-update - Update pre-commit hooks"
@echo " make build - Build distribution packages"
@echo " make publish - Publish package to PyPI"
@echo " make benchmark - Run performance benchmarks"
@echo " make clean - Remove build artifacts and cache files"
@echo " make all - Run format, lint, type-check, and test"
# Install package in development mode
install:
uv pip install -e .
# Install with development dependencies
dev-install:
uv pip install -e . --all-groups
# Run tests
test:
pytest tests/
# Run tests with verbose output
test-verbose:
pytest tests/ -v
# Run tests with coverage
test-coverage:
pytest tests/ --cov=pyperly --cov-report=html --cov-report=term
# Format code with ruff
format:
ruff format src/ tests/
ruff check --fix src/ tests/
# Lint code with ruff
lint:
ruff check src/ tests/
# Type checking with mypy
type-check:
mypy src/pyperly
# Run all checks
check: format lint type-check test
# Build distribution packages
build: clean
uv build
# Publish to PyPI (requires credentials)
publish: build
uv publish
publish-test: build
uv publish --publish-url https://test.pypi.org/legacy/
# Run benchmarks
benchmark:
python benchmark.py
# Install pre-commit hooks
pre-commit-install:
pre-commit install
# Run pre-commit on all files
pre-commit-run:
pre-commit run --all-files
# Update pre-commit hooks to latest versions
pre-commit-update:
pre-commit autoupdate
# Clean build artifacts and cache
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache/
rm -rf .coverage
rm -rf htmlcov/
rm -rf .mypy_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
find . -type f -name "*~" -delete
# Run everything
all: format lint type-check test
@echo "✅ All checks passed!"