-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
88 lines (67 loc) · 2.36 KB
/
Makefile
File metadata and controls
88 lines (67 loc) · 2.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.PHONY: help install test lint format clean build docs serve-docs capture-stubs
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}'
install: ## Install dependencies
uv sync --all-extras
test: ## Run all tests (unit + BDD)
uv run pytest tests/ -v
uv run behave --tags @replay
test-unit: ## Run unit tests only
uv run pytest tests/ -v
test-bdd: ## Run BDD tests only
uv run behave --tags @replay
test-coverage: ## Run tests with coverage
uv run pytest tests/ --cov=pymlb_statsapi --cov-report=html --cov-report=term
@echo "Coverage report: htmlcov/index.html"
lint: ## Run linting checks
uv run ruff check .
lint-fix: ## Fix linting issues
uv run ruff check --fix .
format: ## Format code
uv run ruff format .
security: ## Run security checks
uv run bandit -r pymlb_statsapi/ -ll
pre-commit: ## Run all pre-commit hooks
uv run pre-commit run --all-files
clean: ## Clean build artifacts
rm -rf dist/
rm -rf build/
rm -rf *.egg-info
rm -rf htmlcov/
rm -rf .pytest_cache/
rm -rf .ruff_cache/
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
build: ## Build package
uv build
docs: ## Build documentation
uv run sphinx-build -b html docs docs/_build/html
@echo "Documentation: docs/_build/html/index.html"
serve-docs: ## Serve documentation locally
python -m http.server 8000 --directory docs/_build/html
capture-stubs: ## Capture API stubs (respects rate limits)
STUB_MODE=capture uv run python scripts/capture_all_stubs.py --delay 2
capture-stubs-behave: ## Capture API stubs using behave
STUB_MODE=capture uv run behave
publish-test: ## Publish to TestPyPI
uv run twine upload --repository testpypi dist/*
publish: ## Publish to PyPI
uv run twine upload dist/*
dev: ## Set up development environment
uv sync --all-extras
uv run pre-commit install
@echo "Development environment ready!"
check: ## Run all checks (lint, format, test)
@echo "Running linting..."
uv run ruff check .
@echo "Running format check..."
uv run ruff format --check .
@echo "Running security scan..."
uv run bandit -r pymlb_statsapi/ -ll
@echo "Running tests..."
uv run pytest tests/ -v
STUB_MODE=replay uv run behave
@echo "All checks passed!"