-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
123 lines (84 loc) · 3.7 KB
/
Copy pathMakefile
File metadata and controls
123 lines (84 loc) · 3.7 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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.DEFAULT_GOAL := help
SHELL := /bin/bash
# ---------------------------------------------------------------------------
# Setup
# ---------------------------------------------------------------------------
.PHONY: lock-install install install-dev update
lock-install: ## Lock and install project dependencies
poetry lock
poetry install
install: ## Install project with all dependencies
poetry install
install-dev: ## Install with dev dependencies
poetry install --with dev
update: ## Update dependencies
poetry update
# ---------------------------------------------------------------------------
# Code Quality
# ---------------------------------------------------------------------------
.PHONY: lint lint-fix format format-check fix
lint: ## Run ruff linter
poetry run ruff check pluginforge/ tests/
lint-fix: ## Run ruff linter with auto-fix
poetry run ruff check pluginforge/ tests/ --fix --unsafe-fixes
format: ## Format code with ruff
poetry run ruff format pluginforge/ tests/
format-check: ## Check formatting without changes
poetry run ruff format --check pluginforge/ tests/
fix: ## Run all auto-fixes (lint + format)
poetry run ruff check pluginforge/ tests/ --fix --unsafe-fixes
poetry run ruff format pluginforge/ tests/
# ---------------------------------------------------------------------------
# Tests
# ---------------------------------------------------------------------------
.PHONY: test test-v test-fast test-cov test-xml
test: ## Run all tests
poetry run pytest
test-v: ## Run all tests (verbose)
poetry run pytest -v
test-fast: ## Run tests without coverage (faster)
poetry run pytest -q --maxfail=1 --disable-warnings --no-cov
test-cov: ## Run tests with coverage report
poetry run pytest --cov=pluginforge --cov-report=term-missing
test-xml: ## Run tests with XML coverage (for CI)
poetry run pytest -q --maxfail=1 --disable-warnings --cov=pluginforge --cov-report=xml
# ---------------------------------------------------------------------------
# CI
# ---------------------------------------------------------------------------
.PHONY: ci
ci: lint format-check test ## Full CI pipeline (lint + format-check + test)
# ---------------------------------------------------------------------------
# Version Management
# ---------------------------------------------------------------------------
.PHONY: bump-patch bump-minor bump-major
bump-patch: ## Bump patch version (0.1.0 -> 0.1.1)
poetry version patch
bump-minor: ## Bump minor version (0.1.0 -> 0.2.0)
poetry version minor
bump-major: ## Bump major version (0.1.0 -> 1.0.0)
poetry version major
# ---------------------------------------------------------------------------
# Build & Publish
# ---------------------------------------------------------------------------
.PHONY: build publish
build: ## Build distribution package
poetry build
publish: ci build ## Run CI, build and publish to PyPI
poetry publish
# ---------------------------------------------------------------------------
# Cleanup
# ---------------------------------------------------------------------------
.PHONY: clean clean-venv
clean: ## Remove build artifacts and caches
rm -rf dist/ build/ .pytest_cache/ .ruff_cache/ .mypy_cache/ .coverage coverage.xml
find pluginforge/ tests/ -type d -name __pycache__ -exec rm -rf {} +
find . -name '*.pyc' -delete
clean-venv: ## Remove Poetry virtualenv
poetry env remove --all || true
# ---------------------------------------------------------------------------
# Help
# ---------------------------------------------------------------------------
.PHONY: help
help: ## Show this help
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'