deb-mock/Makefile
robojerk e181fd6f20
Some checks failed
Build and Publish Debian Package / build-deb (push) Failing after 1m31s
Build Deb-Mock Package / build (push) Successful in 53s
Test Deb-Mock Build / test (push) Successful in 56s
fix debian build: avoid pip install in externally managed environment
2025-08-04 00:19:32 +00:00

71 lines
No EOL
2 KiB
Makefile

.PHONY: help install install-dev test clean lint format docs
help: ## Show this help message
@echo "Deb-Mock - Debian Package Build Environment"
@echo ""
@echo "Available targets:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-15s\033[0m %s\n", $$1, $$2}'
install: ## Install deb-mock in development mode
pip install -e .
debian-install: ## Install for Debian package build (no pip)
@echo "Debian package build - installation handled by debian/rules"
install-dev: ## Install deb-mock with development dependencies
pip install -e .
pip install -r requirements-dev.txt
test: ## Run tests
python -m pytest tests/ -v
test-coverage: ## Run tests with coverage
python -m pytest tests/ --cov=deb_mock --cov-report=html --cov-report=term
lint: ## Run linting checks
flake8 deb_mock/ tests/
pylint deb_mock/
format: ## Format code with black
black deb_mock/ tests/
clean: ## Clean build artifacts
rm -rf build/
rm -rf dist/
rm -rf *.egg-info/
rm -rf output/
rm -rf metadata/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
docs: ## Build documentation
cd docs && make html
install-system-deps: ## Install system dependencies (requires sudo)
sudo apt update
sudo apt install -y sbuild schroot debhelper build-essential debootstrap
setup-chroot: ## Setup initial chroot environment (requires sudo)
sudo mkdir -p /var/lib/deb-mock/chroots
sudo mkdir -p /etc/schroot/chroot.d
sudo chown -R $$USER:$$USER /var/lib/deb-mock
build-example: ## Build an example package (requires setup)
deb-mock init-chroot bookworm-amd64
deb-mock build examples/hello_1.0.dsc
check: ## Run all checks (lint, test, format)
$(MAKE) lint
$(MAKE) test
$(MAKE) format
dist: ## Build distribution package
python setup.py sdist bdist_wheel
upload: ## Upload to PyPI (requires twine)
twine upload dist/*
dev-setup: ## Complete development setup
$(MAKE) install-system-deps
$(MAKE) setup-chroot
$(MAKE) install-dev