-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (60 loc) · 1.88 KB
/
Makefile
File metadata and controls
73 lines (60 loc) · 1.88 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
.PHONY: help version test build clean install sync stubs check-stubs lint format
# Default target - show help
help:
@echo "pyz3 - Development Makefile (uv-based)"
@echo ""
@echo "Setup:"
@echo " make install Install package in development mode"
@echo " make sync Sync dependencies with uv"
@echo ""
@echo "Testing:"
@echo " make test Run Python tests with pytest"
@echo " make test-zig Run Zig tests"
@echo " make test-all Run all tests"
@echo ""
@echo "Building:"
@echo " make build Build package"
@echo " make clean Clean build artifacts"
@echo " make stubs Generate Python stub files (.pyi)"
@echo " make check-stubs Verify stub files are up to date"
@echo ""
@echo "Code Quality:"
@echo " make lint Run ruff linter"
@echo " make format Format code with ruff"
@echo ""
# Version commands
version:
@python -c "import pyz3; print(pyz3.__version__)"
# Testing
test:
@uv run pytest test/
test-zig:
@uv run python -m ziglang build test
test-all: test test-zig
@echo "All tests passed!"
# Building
build:
@uv build
clean:
@rm -rf dist/ build/ .eggs/ *.egg-info
@rm -rf .zig-cache zig-out
@rm -rf .pytest_cache .ruff_cache
@find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
@echo "Clean complete"
install:
@uv pip install -e ".[dev,numpy]"
sync:
@uv sync
stubs:
@echo "Generating Python stub files..."
@uv run python -m ziglang build --build-file ./pytest.build.zig generate-stubs
@echo "Stub files generated successfully"
check-stubs:
@echo "Checking stub files are up to date..."
@uv run python -m ziglang build --build-file ./pytest.build.zig generate-stubs -Dcheck-stubs=true
@echo "All stub files are up to date"
# Code quality
lint:
@uv run ruff check .
format:
@uv run ruff format .