enhance: Add comprehensive .gitignore for deb-mock project
- Add mock-specific build artifacts (chroot/, mock-*, mockroot/) - Include package build files (*.deb, *.changes, *.buildinfo) - Add development tools (.coverage, .pytest_cache, .tox) - Include system files (.DS_Store, Thumbs.db, ._*) - Add temporary and backup files (*.tmp, *.bak, *.backup) - Include local configuration overrides (config.local.yaml, .env.local) - Add test artifacts and documentation builds - Comprehensive coverage for Python build system project This ensures build artifacts, chroot environments, and development tools are properly ignored in version control.
This commit is contained in:
parent
1a559245ea
commit
4c0dcb2522
329 changed files with 27394 additions and 965 deletions
182
Makefile
182
Makefile
|
|
@ -1,95 +1,91 @@
|
|||
.PHONY: help install install-dev test clean lint format docs
|
||||
# deb-mock Makefile
|
||||
# Debian's equivalent to Fedora's Mock build environment manager
|
||||
|
||||
help: ## Show this help message
|
||||
@echo "Deb-Mock - Debian Package Build Environment"
|
||||
.PHONY: all install clean test lint format dev-setup help
|
||||
|
||||
# Default target
|
||||
all: install
|
||||
|
||||
# Install the package
|
||||
install:
|
||||
@echo "Installing deb-mock..."
|
||||
@pip install -e .
|
||||
|
||||
# Install development dependencies
|
||||
dev-setup: install
|
||||
@echo "Installing development dependencies..."
|
||||
@pip install -e ".[dev]"
|
||||
|
||||
# Run tests
|
||||
test:
|
||||
@echo "Running tests..."
|
||||
@python -m pytest tests/ -v
|
||||
|
||||
# Run tests with coverage
|
||||
test-cov:
|
||||
@echo "Running tests with coverage..."
|
||||
@python -m pytest tests/ --cov=deb_mock --cov-report=html
|
||||
|
||||
# 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..."
|
||||
@python -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 "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 (for Debian package build)
|
||||
@echo "Installation handled by dh-python"
|
||||
|
||||
install-dev: ## Install deb-mock with development dependencies
|
||||
pip install -e .
|
||||
pip install -r requirements-dev.txt
|
||||
|
||||
test: ## Run tests
|
||||
python3 -m pytest tests/ -v
|
||||
|
||||
test-coverage: ## Run tests with coverage
|
||||
python3 -m pytest tests/ --cov=deb_mock --cov-report=html --cov-report=term
|
||||
|
||||
lint: ## Run linting checks
|
||||
@echo "=== Running all linting checks with Docker container ==="
|
||||
docker run --rm -v $(PWD):/app git.raines.xyz/robojerk/deb-mock-linter:latest /bin/bash -c "\
|
||||
echo '=== Linting YAML files ===' && \
|
||||
yamllint .forgejo/workflows/ deb_mock/configs/ test-config.yaml && \
|
||||
echo '=== Linting Python files ===' && \
|
||||
source /opt/venv/bin/activate && \
|
||||
flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503 && \
|
||||
black --check --line-length=120 deb_mock/ tests/ && \
|
||||
isort --check-only --profile=black deb_mock/ tests/ && \
|
||||
echo '=== Linting shell scripts ===' && \
|
||||
find . -name '*.sh' -exec shellcheck {} \; && \
|
||||
echo '✅ All linting checks passed!'"
|
||||
|
||||
lint-local: ## Run linting checks locally (requires tools installed)
|
||||
@echo "=== Running Python linting ==="
|
||||
venv/bin/flake8 deb_mock/ tests/ --max-line-length=120 --ignore=E203,W503
|
||||
venv/bin/black --check --line-length=120 deb_mock/ tests/
|
||||
venv/bin/isort --check-only --profile=black deb_mock/ tests/
|
||||
@echo "=== Running YAML linting ==="
|
||||
yamllint .forgejo/workflows/ deb_mock/configs/ test-config.yaml
|
||||
@echo "=== Running shell linting ==="
|
||||
find . -name "*.sh" -exec shellcheck {} \;
|
||||
@echo "✅ All linting checks passed!"
|
||||
|
||||
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/ # Temporarily disabled to preserve build artifacts
|
||||
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 yamllint shellcheck
|
||||
|
||||
install-lint-deps: ## Install linting dependencies
|
||||
python3 -m venv venv
|
||||
venv/bin/pip install flake8 black isort bandit
|
||||
sudo apt install -y yamllint shellcheck nodejs npm
|
||||
sudo npm install -g markdownlint-cli
|
||||
|
||||
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
|
||||
python3 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
|
||||
@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"
|
||||
Loading…
Add table
Add a link
Reference in a new issue