-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
78 lines (64 loc) · 2.14 KB
/
makefile
File metadata and controls
78 lines (64 loc) · 2.14 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
# ====== config ======
DIST_DIR := dist
PYTHON := uv run python
# Paths
PKG_SVY_RS := packages/svy-rs
# ====== helpers ======
.PHONY: help
help:
@echo "Global Targets:"
@echo " deps - install dev dependencies (uv, maturin)"
@echo " clean - remove build artifacts (global)"
@echo " test-all - run tests for all packages"
@echo ""
@echo "svy-rs Targets:"
@echo " build-svy-rs - build wheel for svy-rs (maturin)"
@echo " develop-svy-rs - install svy-rs in editable mode (recompiles on import)"
@echo " test-svy-rs - run tests specifically for svy-rs"
@echo " release-svy-rs - build optimized release wheel"
.PHONY: clean
clean:
rm -rf "$(DIST_DIR)" build *.egg-info
find . -name "__pycache__" -type d -prune -exec rm -rf {} +
find . -name "target" -type d -prune -exec rm -rf {} +
# Clean inside packages
rm -rf $(PKG_SVY_RS)/target $(PKG_SVY_RS)/dist
.PHONY: deps
deps:
# Install global tools needed for rust builds
uv tool install maturin
uv sync
@echo "Deps installed."
# ====== Testing ======
.PHONY: test-all
test-all: test-svy-rs
@echo "All tests passed."
.PHONY: test-svy-rs
test-svy-rs:
@echo "▶ Testing svy-rs..."
# We run pytest inside the package directory so it picks up the local pyproject config
cd $(PKG_SVY_RS) && uv run pytest
# ====== svy-rs (Rust/Maturin) ======
# Build the wheel into the local dist/ folder
.PHONY: build-svy-rs
build-svy-rs:
@echo "▶ Building svy-rs (Maturin)..."
cd $(PKG_SVY_RS) && uv run maturin build
# Build optimized release wheel
.PHONY: release-svy-rs
release-svy-rs:
@echo "▶ Building RELEASE wheel for svy-rs..."
cd $(PKG_SVY_RS) && uv run maturin develop --uv --release
# Install in editable mode (changes to Rust code take effect on next import)
.PHONY: develop-svy-rs
develop-svy-rs:
@echo "▶ Installing svy-rs in development mode..."
cd $(PKG_SVY_RS) && uv run maturin develop
# ====== Publishing ======
.PHONY: check
check:
uv run twine check "$(PKG_SVY_RS)/target/wheels/"*
.PHONY: upload-svy-rs
upload-svy-rs:
# Uploads whatever is in the target/wheels directory of the package
uv run twine upload "$(PKG_SVY_RS)/target/wheels/"*