.PHONY: dev install test build clean help lint-py fmt-py fmt-py-check check-py
dev:
maturin develop
install:
maturin develop --release
test:
pytest tests/
test-verbose:
pytest tests/ -v
test-coverage:
pytest tests/ --cov=pdf_library --cov-report=html
build:
maturin build --release
build-all:
maturin build --release --interpreter python3.8 python3.9 python3.10 python3.11 python3.12
clean:
cargo clean
rm -rf target/
rm -rf python/pdf_library/*.so
rm -rf python/pdf_library/*.pyd
rm -rf python/pdf_library/__pycache__
rm -rf tests/__pycache__
rm -rf .pytest_cache
rm -rf htmlcov/
rm -rf .coverage
test-rust:
cargo test --features python
lint:
cargo clippy --features python -- -D warnings
lint-py:
ruff check .
lint-py-fix:
ruff check --fix .
fmt:
cargo fmt
fmt-py:
ruff format .
fmt-check:
cargo fmt -- --check
fmt-py-check:
ruff format --check .
check: fmt-check lint test-rust
check-py: fmt-py-check lint-py
check-all: check check-py
help:
@echo "PDF Library Python Bindings - Makefile Commands"
@echo ""
@echo "Development:"
@echo " make dev - Install in development mode (fast rebuilds)"
@echo " make install - Install in release mode (optimized)"
@echo ""
@echo "Testing:"
@echo " make test - Run Python tests"
@echo " make test-verbose - Run Python tests with verbose output"
@echo " make test-coverage - Run Python tests with coverage report"
@echo " make test-rust - Run Rust tests with Python feature"
@echo ""
@echo "Building:"
@echo " make build - Build release wheel"
@echo " make build-all - Build wheels for all Python versions"
@echo ""
@echo "Code Quality (Rust):"
@echo " make lint - Run Clippy linter on Rust code"
@echo " make fmt - Format Rust code"
@echo " make fmt-check - Check Rust formatting without modifying"
@echo " make check - Run all Rust checks (format, lint, test)"
@echo ""
@echo "Code Quality (Python):"
@echo " make lint-py - Run Ruff linter on Python code"
@echo " make lint-py-fix - Auto-fix Python linting issues"
@echo " make fmt-py - Format Python code with Ruff"
@echo " make fmt-py-check - Check Python formatting without modifying"
@echo " make check-py - Run all Python checks (format, lint)"
@echo ""
@echo "Code Quality (All):"
@echo " make check-all - Run all checks for both Rust and Python"
@echo ""
@echo "Cleanup:"
@echo " make clean - Remove all build artifacts"
@echo ""
@echo "Help:"
@echo " make help - Display this help message"