-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
98 lines (73 loc) · 3.2 KB
/
Makefile
File metadata and controls
98 lines (73 loc) · 3.2 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
.PHONY: help install install-dev lint format test clean build release check-release ci-lint ci-format ci-check version-bump validate-version
help: ## Show this help message
@echo 'Usage: make [target]'
@echo ''
@echo 'Available targets:'
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf " %-20s %s\n", $$1, $$2}' $(MAKEFILE_LIST)
install: ## Install the package
pip install -e .
install-dev: ## Install the package with development dependencies
pip install -e ".[dev]"
setup-dev: ## Set up minimal development environment (ruff for linting)
python3 scripts/setup-dev.py
lint: ## Run ruff linter (check only)
ruff check src/ tests/ examples/
format: ## Format code with ruff
ruff check --fix src/ tests/ examples/
ruff format src/ tests/ examples/
format-check: ## Check code formatting without making changes
ruff format --check src/ tests/ examples/
# CI Sync Commands - Mirror exact CI environment locally
ci-lint: ## Run linting exactly as CI does (via tox lint)
python3 scripts/lint.py
ci-format: ## Run formatting exactly as CI does (via tox format)
python3 scripts/format.py
ci-check: ci-lint ## Run the same checks as CI (ensures local/CI consistency)
@echo "🎉 All CI checks passed locally!"
test: ## Run tests with pytest
pytest
test-cov: ## Run tests with coverage report
pytest --cov=nwp500 --cov-report=html --cov-report=term-missing
clean: ## Remove build artifacts and cache files
rm -rf build dist *.egg-info .eggs
rm -rf .pytest_cache .ruff_cache .coverage htmlcov
find . -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true
find . -type f -name "*.pyc" -delete
build: clean ## Build distribution packages
python -m build
check-release: lint format-check test validate-version ## Run all checks before release (lint, format check, tests, version validation)
@echo "✓ All checks passed! Ready for release."
release: check-release build ## Prepare and build a release (run checks, then build)
@echo "✓ Release build complete!"
@echo "To publish to TestPyPI: make publish-test"
@echo "To publish to PyPI: make publish"
publish-test: ## Publish to TestPyPI
python -m twine check dist/*
python -m twine upload --repository testpypi dist/*
publish: ## Publish to PyPI
python -m twine check dist/*
python -m twine upload dist/*
tox: ## Run all tox environments
tox
tox-lint: ## Run tox lint environment
tox -e lint
tox-format: ## Run tox format environment
tox -e format
docs: ## Build documentation
tox -e docs
docs-clean: ## Clean documentation build
rm -rf docs/_build
version-bump: ## Bump version (usage: make version-bump BUMP=patch|minor|major|X.Y.Z)
@if [ -z "$(BUMP)" ]; then \
echo "Error: BUMP parameter required"; \
echo "Usage: make version-bump BUMP=patch|minor|major|X.Y.Z"; \
echo "Examples:"; \
echo " make version-bump BUMP=patch # Bump patch version"; \
echo " make version-bump BUMP=minor # Bump minor version"; \
echo " make version-bump BUMP=major # Bump major version"; \
echo " make version-bump BUMP=3.1.5 # Set explicit version"; \
exit 1; \
fi
python3 scripts/bump_version.py $(BUMP)
validate-version: ## Validate version configuration (checks for common mistakes)
python3 scripts/validate_version.py