-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
63 lines (50 loc) · 1.85 KB
/
Copy pathMakefile
File metadata and controls
63 lines (50 loc) · 1.85 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
.PHONY: install frontend-install frontend-build test lint typecheck build clean dev wheel release-check
# Python setup (using uv if available, fallback to pip)
install:
uv pip install -e ".[dev]" 2>/dev/null || pip install -e ".[dev]"
# Frontend setup
frontend-install:
cd frontend && npm install
# Frontend build and copy assets to renderer
frontend-build:
cd frontend && npm run build
rm -rf src/holysheet/renderer/assets
mkdir -p src/holysheet/renderer/assets
cp frontend/dist/index.html src/holysheet/renderer/index.html
cp frontend/dist/assets/*.js src/holysheet/renderer/assets/app.js
cp frontend/dist/assets/*.css src/holysheet/renderer/assets/app.css 2>/dev/null || touch src/holysheet/renderer/assets/app.css
# Run tests
test:
pytest tests/ -v --tb=short
# Run tests with coverage
test-cov:
pytest tests/ -v --tb=short --cov=holysheet --cov-report=html --cov-report=term
# Lint
lint:
ruff check src/ tests/ examples/
ruff format --check src/ tests/ examples/
# Format
format:
ruff check --fix src/ tests/ examples/
ruff format src/ tests/ examples/
# Type check
typecheck:
mypy src/holysheet/ --ignore-missing-imports
# Build wheel and sdist
build: frontend-build
python -m build
# Build and verify wheel contents
wheel: build
@echo "Verifying wheel contents..."
pip install dist/*.whl --force-reinstall
python -c "import holysheet; from pathlib import Path; p=Path(holysheet.__file__).parent; assert (p/'renderer'/'assets'/'app.js').exists(); print('✓ Wheel verified')"
# Semantic release dry-run
release-check:
semantic-release version --no-commit --no-tag --no-push --no-vcs-release
# Clean
clean:
rm -rf dist/ build/ *.egg-info
rm -rf .pytest_cache .mypy_cache .ruff_cache htmlcov
find . -type d -name __pycache__ -exec rm -rf {} +
# Development: build frontend and install package in editable mode
dev: frontend-install frontend-build install