move to uv pyproject, drop setup.py/requirements/pytest.ini
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
# Fjerkroa Bot Development Makefile
|
||||
# Fjerkroa Bot Development Makefile (uv-managed)
|
||||
|
||||
.PHONY: help install install-dev clean test test-cov lint format type-check security-check all-checks pre-commit run build
|
||||
.PHONY: help install install-dev clean test test-cov test-fast lint format format-check type-check security-check audit trace check all-checks pre-commit run run-dev build ci
|
||||
|
||||
# Default target
|
||||
help: ## Show this help message
|
||||
@@ -9,12 +9,12 @@ help: ## Show this help message
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}'
|
||||
|
||||
# Installation targets
|
||||
install: ## Install production dependencies
|
||||
pip3.11 install -r requirements.txt
|
||||
install: ## Sync production dependencies
|
||||
uv sync --no-dev
|
||||
|
||||
install-dev: install ## Install development dependencies and pre-commit hooks
|
||||
pip3.11 install -e .
|
||||
pre-commit install
|
||||
install-dev: ## Sync all dependencies and install pre-commit hooks
|
||||
uv sync
|
||||
uv run pre-commit install
|
||||
|
||||
# Cleaning targets
|
||||
clean: ## Clean up temporary files and caches
|
||||
@@ -28,72 +28,54 @@ clean: ## Clean up temporary files and caches
|
||||
|
||||
# Testing targets
|
||||
test: ## Run tests
|
||||
python3.11 -m pytest -v
|
||||
uv run pytest -v
|
||||
|
||||
test-cov: ## Run tests with coverage report
|
||||
python3.11 -m pytest --cov=fjerkroa_bot --cov-report=html --cov-report=term-missing
|
||||
uv run pytest --cov=fjerkroa_bot --cov-report=html --cov-report=term-missing
|
||||
|
||||
test-fast: ## Run tests without slow tests
|
||||
python3.11 -m pytest -v -m "not slow"
|
||||
uv run pytest -v -m "not slow"
|
||||
|
||||
# Code quality targets
|
||||
lint: ## Run linter (flake8)
|
||||
python3.11 -m flake8 fjerkroa_bot tests
|
||||
uv run flake8 fjerkroa_bot tests
|
||||
|
||||
format: ## Format code with black and isort
|
||||
python3.11 -m black fjerkroa_bot tests
|
||||
python3.11 -m isort fjerkroa_bot tests
|
||||
uv run black fjerkroa_bot tests
|
||||
uv run isort fjerkroa_bot tests
|
||||
|
||||
format-check: ## Check if code is properly formatted
|
||||
python3.11 -m black --check fjerkroa_bot tests
|
||||
python3.11 -m isort --check-only fjerkroa_bot tests
|
||||
uv run black --check fjerkroa_bot tests
|
||||
uv run isort --check-only fjerkroa_bot tests
|
||||
|
||||
type-check: ## Run type checker (mypy)
|
||||
python3.11 -m mypy fjerkroa_bot tests
|
||||
uv run mypy fjerkroa_bot tests
|
||||
|
||||
security-check: ## Run security scanner (bandit)
|
||||
python3.11 -m bandit -r fjerkroa_bot --configfile pyproject.toml
|
||||
uv run bandit -r fjerkroa_bot --configfile pyproject.toml
|
||||
|
||||
audit: ## Audit locked dependencies for known CVEs
|
||||
uv export --no-dev --no-emit-project --format requirements-txt | uv run pip-audit -r /dev/stdin --disable-pip
|
||||
|
||||
trace: ## Verify spec requirement coverage (SDD/BDD/TDD)
|
||||
uv run python tools/trace.py
|
||||
|
||||
# Combined targets
|
||||
all-checks: lint format-check type-check security-check test ## Run all code quality checks and tests
|
||||
check: lint format-check type-check security-check trace test ## The gate: all quality checks + spec trace + tests
|
||||
all-checks: check audit ## check + dependency audit
|
||||
|
||||
pre-commit: format lint type-check security-check test ## Run all pre-commit checks (format, then check)
|
||||
|
||||
# Development targets
|
||||
run: ## Run the bot (requires config.toml)
|
||||
python3.11 -m fjerkroa_bot
|
||||
uv run python -m fjerkroa_bot
|
||||
|
||||
run-dev: ## Run the bot in development mode with auto-reload
|
||||
python3.11 -m watchdog.watchmedo auto-restart --patterns="*.py" --recursive -- python3.11 -m fjerkroa_bot
|
||||
uv run watchmedo auto-restart --patterns="*.py" --recursive -- python -m fjerkroa_bot
|
||||
|
||||
# Build targets
|
||||
build: clean ## Build distribution packages
|
||||
python3.11 setup.py sdist bdist_wheel
|
||||
uv build
|
||||
|
||||
# CI targets
|
||||
ci: install-dev all-checks ## Full CI pipeline (install deps and run all checks)
|
||||
|
||||
# Docker targets (if needed in future)
|
||||
docker-build: ## Build Docker image
|
||||
docker build -t fjerkroa-bot .
|
||||
|
||||
docker-run: ## Run bot in Docker container
|
||||
docker run -d --name fjerkroa-bot fjerkroa-bot
|
||||
|
||||
# Utility targets
|
||||
deps-update: ## Update dependencies (requires pip-tools)
|
||||
python3.11 -m piptools compile requirements.in --upgrade
|
||||
|
||||
requirements-lock: ## Generate locked requirements
|
||||
pip3.11 freeze > requirements-lock.txt
|
||||
|
||||
check-deps: ## Check for outdated dependencies
|
||||
pip3.11 list --outdated
|
||||
|
||||
# Documentation targets (if needed)
|
||||
docs: ## Generate documentation (placeholder)
|
||||
@echo "Documentation generation not implemented yet"
|
||||
|
||||
# Database/migration targets (if needed)
|
||||
migrate: ## Run database migrations (placeholder)
|
||||
@echo "No migrations needed for this project"
|
||||
|
||||
Reference in New Issue
Block a user