forked from maziyarpanahi/openmed
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
119 lines (90 loc) · 4.53 KB
/
Copy pathMakefile
File metadata and controls
119 lines (90 loc) · 4.53 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
# Makefile for openmed package management
.PHONY: help build publish release clean install lint type-check format format-check lint-swift format-swift quality test sbom grpc-proto grpc-proto-check brand-check docs-serve docs-build docs-stage docs-browser-test docs-deploy
help: ## Show this help message
@echo "Available commands:"
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " %-15s %s\n", $$1, $$2}'
build: ## Build the package
@echo "🔨 Building package..."
python3 -m build
publish: ## Publish to PyPI using Hatch
@echo "📤 Publishing to PyPI..."
hatch publish
release: clean build publish ## Full release cycle: clean, build, publish
clean: ## Clean build artifacts
@echo "🧹 Cleaning build artifacts..."
rm -rf dist/ build/ *.egg-info/
install: ## Install the package locally
@echo "📦 Installing package locally..."
pip install -e .
lint: ## Run Ruff lint checks
@echo "🔎 Running Ruff lint checks..."
ruff check .
type-check: ## Type-check the annotated public-module scope
@echo "🔎 Running scoped mypy checks..."
mypy
format: ## Apply Ruff import fixes and formatting
@echo "🎨 Formatting Python code with Ruff..."
ruff check --fix .
ruff format .
format-check: ## Check Ruff formatting without modifying files
@echo "🔎 Checking Ruff formatting..."
ruff format --check .
lint-swift: ## Run Swift format lint checks for OpenMedKit
@echo "🔎 Running Swift format lint checks..."
scripts/lint_swift.sh
format-swift: ## Apply Swift formatting for OpenMedKit
@echo "🎨 Formatting Swift code with swift-format..."
scripts/format_swift.sh
quality: lint type-check format-check test ## Run the local quality gate
test: ## Run the test suite
@echo "🧪 Running tests..."
pytest
sbom: ## Generate a CycloneDX 1.6 SBOM (sbom.cdx.json) for the runtime dependencies
@echo "📦 Generating CycloneDX SBOM..."
uv sync --frozen
uv run --no-project --with 'cyclonedx-bom>=4.6,<7' python scripts/security/generate_sbom.py
grpc-proto: ## Regenerate committed gRPC protobuf stubs
@echo "🔁 Generating gRPC protobuf stubs..."
uv run --extra dev python scripts/generate_grpc_stubs.py
grpc-proto-check: ## Verify committed gRPC protobuf stubs are current
@echo "🔎 Checking gRPC protobuf stubs..."
uv run --extra dev python scripts/generate_grpc_stubs.py --check
docs-serve: ## Run the MkDocs dev server with live reload
@echo "📚 Serving docs at http://127.0.0.1:8008 ..."
uv run mkdocs serve -a 127.0.0.1:8008
brand-check: ## Validate brand sources, claims, consumers, and generated art
@echo "🧭 Validating the repository-owned brand system..."
uv run --extra dev --extra docs --frozen python scripts/brand/validate_system.py
uv run --extra dev --extra docs --frozen python scripts/brand/update_claims.py --check
uv run --extra dev --extra docs --frozen python scripts/brand/sync_consumers.py --check
uv run --extra dev --extra docs --frozen python scripts/brand/render_social_assets.py --check
docs-build: docs-stage ## Build and verify the exact Pages artifact
docs-stage: brand-check ## Build docs, generated surfaces, and marketing into site/
@echo "📦 Staging the verified GitHub Pages artifact..."
uv run --extra dev --extra docs --frozen python scripts/docs/stage_pages.py
docs-browser-test: docs-stage ## Run the pinned Chromium, Firefox, and WebKit brand matrix
@echo "🌐 Installing pinned browser-test dependencies..."
npm ci --prefix tests/browser/brand
npm exec --prefix tests/browser/brand -- playwright install chromium firefox webkit
@echo "🧭 Running the cross-browser Pages matrix..."
npm --prefix tests/browser/brand test
docs-deploy: docs-stage ## Publish marketing site + docs bundle to GitHub Pages (gh-pages branch)
@echo "🚀 Deploying documentation to GitHub Pages..."
ghp-import site -f -p
test-build: ## Test build without publishing
@echo "🧪 Testing build..."
python3 -m build
@echo "✅ Build successful! Check dist/ directory"
bump-patch: ## Bump patch version (0.1.1 -> 0.1.2)
@echo "📈 Bumping patch version..."
python3 scripts/release/release.py patch
bump-minor: ## Bump minor version (0.1.1 -> 0.2.0)
@echo "📈 Bumping minor version..."
python3 scripts/release/release.py minor
bump-major: ## Bump major version (0.1.1 -> 1.0.0)
@echo "📈 Bumping major version..."
python3 scripts/release/release.py major
# Quick commands for common workflows
patch: bump-patch release ## Bump patch version and release
minor: bump-minor release ## Bump minor version and release
major: bump-major release ## Bump major version and release