-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (57 loc) · 1.98 KB
/
Copy pathMakefile
File metadata and controls
73 lines (57 loc) · 1.98 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
# Makefile for pysof wheel building and development
.PHONY: help build test clean install dev-install lint format typecheck
# Default target
help:
@echo "Available targets:"
@echo " build - Build wheel in release mode"
@echo " build-debug - Build wheel in debug mode"
@echo " test - Run tests"
@echo " test-wheel - Build wheel and test it"
@echo " clean - Clean build artifacts"
@echo " install - Install wheel in current environment"
@echo " dev-install - Install in development mode"
@echo " lint - Run linting checks"
@echo " format - Format code"
@echo " typecheck - Run type checking"
# Build wheel in release mode
build:
maturin build --release --out dist
# Build wheel in debug mode
build-debug:
maturin build --out dist
# Run tests
test:
python -m pytest tests/ -v
# Build wheel and test it
test-wheel: build
pip install dist/*.whl --force-reinstall
python -c "import pysof; print(f'pysof version: {pysof.__version__}')"
python -m pytest tests/test_import.py tests/test_package_metadata.py -v
# Clean build artifacts
clean:
rm -rf dist/ target/ build/ .pytest_cache/ .mypy_cache/ .ruff_cache/
# Install wheel in current environment
install: build
pip install dist/*.whl --force-reinstall
# Install in development mode
dev-install:
maturin develop
# Run linting checks
lint:
ruff check src tests
ruff format --check src tests
# Format code
format:
ruff format src tests
# Run type checking
typecheck:
mypy src
# Cross-compilation targets (requires appropriate Rust targets)
build-linux:
maturin build --release --target x86_64-unknown-linux-gnu --out dist
build-windows:
maturin build --release --target x86_64-pc-windows-msvc --out dist
build-macos:
maturin build --release --target x86_64-apple-darwin --out dist
# Build all platforms (if you have cross-compilation set up)
build-all: build-linux build-windows build-macos