-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
76 lines (61 loc) · 2.28 KB
/
Makefile
File metadata and controls
76 lines (61 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
.PHONY: help install install-dev lint lint-fix format check test clean build upload upload-test
# Default target
help:
@echo "Available commands:"
@echo " install - Install the package in editable mode"
@echo " install-dev - Install the package with development dependencies"
@echo " lint - Run ruff linter (check only)"
@echo " lint-fix - Run ruff linter and fix errors automatically"
@echo " format - Format code with ruff"
@echo " check - Run all checks (lint + format check + tests)"
@echo " test - Run tests with pytest"
@echo " clean - Clean build artifacts and cache files"
@echo " build - Build the package for distribution"
@echo " upload-test - Upload package to TestPyPI"
@echo " upload - Upload package to PyPI"
@echo " info - Show package information"
# Install the package in editable mode
install:
uv pip install -e .
# Install the package with development dependencies
install-dev:
uv pip install -e ".[dev]"
# Run ruff linter (check only)
lint:
uv run ruff check .
# Run ruff linter and fix errors automatically
lint-fix:
uv run ruff check --fix .
# Format code with ruff
format:
uv run ruff format .
# Check if code is properly formatted (without making changes)
format-check:
uv run ruff format --check .
# Run all checks (lint + format check + tests)
check: lint format-check test
# Run tests with pytest
test:
uv run pytest
# Clean build artifacts and cache files
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
find . -type f -name "*.pyo" -delete
# Build the package for distribution
build: clean
uv build
# Upload package to TestPyPI (requires TWINE_USERNAME and TWINE_PASSWORD env vars)
upload-test: build
uv run twine upload --repository testpypi dist/*
# Upload package to PyPI (requires TWINE_USERNAME and TWINE_PASSWORD env vars)
upload: build
uv run twine upload dist/*
# Install twine for package uploading (run this once before upload commands)
install-twine:
uv add --dev twine
profile:
uv run py-spy record -o profile-transformer.svg -- python profiler/basic.py