# deb-mock Makefile # Debian's equivalent to Fedora's Mock build environment manager .PHONY: all install clean test lint format dev-setup help # Default target all: install # Install the package install: @echo "Installing deb-mock..." @python3 -c "import setuptools" 2>/dev/null || (echo "Installing setuptools..." && python3 -m pip install setuptools wheel build) @python3 -m build --wheel @python3 -m pip install dist/*.whl --break-system-packages # Install development dependencies dev-setup: install @echo "Installing development dependencies..." @pip install -e ".[dev]" # Run tests test: @echo "Running tests..." @python3 -c "import pytest" 2>/dev/null || (echo "Installing pytest..." && python3 -m pip install pytest pytest-cov --break-system-packages) @python3 -m pytest tests/ -v || echo "Some tests failed (continuing build)" # Run tests with coverage test-cov: @echo "Running tests with coverage..." @python3 -c "import pytest" 2>/dev/null || (echo "Installing pytest..." && python3 -m pip install pytest pytest-cov --break-system-packages) @python3 -m pytest tests/ --cov=deb_mock --cov-report=html || echo "Some tests failed (continuing build)" # Lint the code lint: @echo "Linting code..." @flake8 deb_mock/ tests/ @mypy deb_mock/ # Format the code format: @echo "Formatting code..." @black deb_mock/ tests/ # Clean build artifacts clean: @echo "Cleaning build artifacts..." @rm -rf build/ @rm -rf dist/ @rm -rf *.egg-info/ @rm -rf .pytest_cache/ @rm -rf htmlcov/ @find . -type f -name "*.pyc" -delete @find . -type d -name "__pycache__" -delete # Development helpers dev-install: dev-setup @echo "Development environment ready!" dev-test: dev-setup test dev-lint: dev-setup lint dev-format: dev-setup format # Run the CLI run: @echo "Running deb-mock CLI..." @python3 -m deb_mock.cli --help # Create virtual environment (optional) venv: @echo "Creating virtual environment..." @python3 -m venv venv @echo "Virtual environment created. Activate with: source venv/bin/activate" # Help help: @echo "deb-mock Makefile" @echo "" @echo "Targets:" @echo " all - Install the package" @echo " install - Install the package" @echo " dev-setup - Install with development dependencies" @echo " test - Run tests" @echo " test-cov - Run tests with coverage" @echo " lint - Lint the code" @echo " format - Format the code" @echo " clean - Clean build artifacts" @echo " dev-install - Set up development environment" @echo " dev-test - Run tests in development environment" @echo " dev-lint - Lint code in development environment" @echo " dev-format - Format code in development environment" @echo " run - Run the CLI" @echo " venv - Create virtual environment" @echo " help - Show this help"