81 lines
1.9 KiB
Makefile
Raw Normal View History

2025-11-04 05:17:27 +01:00
.PHONY: help install install-dev test test-cov lint format clean build publish
help:
@echo "PR Assistant - Development Commands"
@echo ""
@echo "Available commands:"
@echo " make install - Install package"
@echo " make install-dev - Install with development dependencies"
@echo " make test - Run tests"
@echo " make test-cov - Run tests with coverage report"
@echo " make lint - Run linters (flake8, mypy)"
@echo " make format - Format code with black and isort"
@echo " make clean - Remove build artifacts"
@echo " make build - Build distribution packages"
@echo " make publish - Publish to PyPI (use with caution)"
@echo " make pre-commit - Run pre-commit hooks on all files"
@echo " make docs - Generate documentation"
install:
pip install -e .
install-dev:
pip install -e ".[dev]"
pre-commit install
test:
pytest tests/ -v --tb=long --full-trace -l --maxfail=10
2025-11-04 05:17:27 +01:00
test-cov:
pytest --cov=pr --cov-report=html --cov-report=term-missing
@echo "Coverage report generated in htmlcov/index.html"
lint:
flake8 pr tests --max-line-length=100 --ignore=E203,W503
mypy pr --ignore-missing-imports
format:
black pr tests
isort pr tests --profile black
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
rm -rf .pytest_cache/
rm -rf .mypy_cache/
rm -rf htmlcov/
rm -rf .coverage
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
build: clean
2025-11-04 08:15:03 +01:00
black .
autoflake --in-place --remove-all-unused-imports --remove-unused-variables --recursive .
2025-11-04 05:17:27 +01:00
python -m build
publish: build
python -m twine upload dist/*
pre-commit:
pre-commit run --all-files
check: lint test
@echo "All checks passed!"
backup:
zip -r rp.zip *
mv rp.zip ../
serve:
rpserver
implode: build
if [ -d /home/retoor/bin ]; then \
cp rp.py /home/retoor/bin/rp; \
chmod +x /home/retoor/bin/rp; \
fi
2025-11-04 05:17:27 +01:00
.DEFAULT_GOAL := help