-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
62 lines (48 loc) · 1.68 KB
/
Makefile
File metadata and controls
62 lines (48 loc) · 1.68 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
.PHONY: clean test coverage lint format install build publish help
# Variables
PYTHON = poetry run python
PYTEST = poetry run pytest
COVERAGE_THRESHOLD = 97
PACKAGE_NAME = spot_optimizer
# Default target
.DEFAULT_GOAL := help
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install: ## Install dependencies using poetry
poetry install
clean: ## Remove all build, test, and coverage artifacts
rm -rf .venv-*/
rm -rf .pytest_cache
rm -rf .ruff_cache
rm -rf .mypy_cache
rm -rf dist/
rm -rf build/
rm -rf *.egg-info
rm -rf .coverage
rm -rf htmlcov/
find . -type d -name "__pycache__" -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf coverage.xml
test-unit: ## Run unit tests only
$(PYTEST) tests/ -m "not integration" -v
test: test-unit test-integration ## Run all tests (unit + integration)
coverage: ## Run tests with coverage report
$(PYTEST) tests/ -m "not integration" \
--cov=$(PACKAGE_NAME) \
--cov-fail-under=$(COVERAGE_THRESHOLD)
test-integration: ## Run integration tests
$(PYTHON) tests/test_integration.py
test-integration-verbose: ## Run integration tests with verbose output
CI=true $(PYTHON) tests/test_integration.py
test-performance: ## Run performance-focused integration tests
$(PYTEST) tests/test_integration.py -m performance -v
test-quick: ## Run quick test suite (unit tests only)
$(PYTEST) tests/ -m "not integration" -x --tb=short
build: clean coverage ## Build package
poetry build
publish: build ## Publish package to PyPI
python scripts/generate_instance_metadata.py
poetry publish