-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (60 loc) · 2.28 KB
/
Copy pathMakefile
File metadata and controls
76 lines (60 loc) · 2.28 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
# Makefile for asr2clip pip package
# Variables
PACKAGE_NAME := asr2clip
DIST_DIR := dist
BUILD_DIR := build
SRC_DIR := asr2clip
# Default target
all: build
# ── Code quality ──────────────────────────────────────────────────
# Run all checks (mirrors CI)
check: lint format-check typecheck complexity
# Lint with ruff
lint:
ruff check $(SRC_DIR)/
# Auto-format with ruff
format:
ruff check --fix $(SRC_DIR)/
ruff format $(SRC_DIR)/
# Check formatting without modifying files
format-check:
ruff format --check $(SRC_DIR)/
# Type check with ty
typecheck:
ty check
# Cyclomatic complexity check
complexity:
complexipy $(SRC_DIR)/ -e "_vendor"
# ── Packaging ─────────────────────────────────────────────────────
# Build the package
build:
@echo "Building $(PACKAGE_NAME)..."
python -m build
@echo "Build complete. Distribution files are in $(DIST_DIR)/"
# Push the package to PyPI
push:
@echo "Pushing $(PACKAGE_NAME) to PyPI..."
twine upload $(DIST_DIR)/*
@echo "Package pushed to PyPI."
# Clean up build and distribution files
clean:
@echo "Cleaning up build and distribution files..."
rm -rf $(BUILD_DIR) $(DIST_DIR) *.egg-info
@echo "Cleanup complete."
# ── Help ──────────────────────────────────────────────────────────
help:
@echo "Available targets:"
@echo ""
@echo " Code quality:"
@echo " check - Run all checks (lint + format-check + typecheck + complexity)"
@echo " lint - Lint with ruff"
@echo " format - Auto-fix lint issues and format code"
@echo " format-check - Check formatting without modifying files"
@echo " typecheck - Type check with ty"
@echo " complexity - Cyclomatic complexity check with complexipy"
@echo ""
@echo " Packaging:"
@echo " build - Build the pip package"
@echo " push - Push the package to PyPI"
@echo " clean - Clean up build and distribution files"
.PHONY: all check lint format format-check typecheck complexity build push clean help