-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
111 lines (76 loc) · 2.93 KB
/
Copy pathMakefile
File metadata and controls
111 lines (76 loc) · 2.93 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
.PHONY: *
.DEFAULT_GOAL := help
SHELL := /bin/bash
IMAGE_NAME := ghcr.io/eddmann/garmin-connect-mcp
VERSION := $(shell grep '^version' pyproject.toml | cut -d '"' -f 2)
##@ Setup
deps: ## Install dependencies
@uv sync
deps/prod: ## Install production dependencies only
@uv sync --no-dev
update: ## Update all dependencies to latest versions
@uv lock --upgrade
@uv sync
lock: ## Regenerate lock file from scratch
@rm -f uv.lock
@uv lock
clean: ## Clean up cache files and build artifacts
@rm -rf .pytest_cache/ .ruff_cache/ .mypy_cache/ .pyright/
@find . -type d -name __pycache__ -exec rm -rf {} +
@find . -type f -name "*.pyc" -delete
@rm -rf dist/ build/ *.egg-info/
##@ Testing/Linting
can-release: lint test ## Run all the same checks as CI to ensure code can be released
test: ## Run the test suite
@uv run python -m pytest
test/%: ## Run tests with a filter (e.g., make test/activity)
@uv run python -m pytest -k $*
test/verbose: ## Run tests with verbose output
@uv run python -m pytest -v
test/coverage: ## Run tests with coverage report
@uv run python -m pytest --cov=src/garmin_connect_mcp --cov-report=term-missing
lint: lint/ruff lint/pyright ## Run all linting tools
lint/ruff: ## Run ruff linter
@uv run ruff check
@uv run ruff format --check
lint/pyright: ## Run pyright type checker
@uv run python -m pyright
fmt: format
format: ## Fix style violations and format code
@uv run ruff check --fix
@uv run ruff format
##@ Packaging
build: clean ## Build source and wheel distributions
@uv build
package/check: build ## Validate built distributions
@uvx twine check dist/*
##@ Development
auth: ## Run the Garmin authentication setup
@uv run garmin-connect-mcp auth
run: ## Run the MCP server locally
@uv run garmin-connect-mcp
shell: ## Open a Python shell with the project context
@uv run python
##@ Docker
docker/build: ## Build Docker image locally
@docker build -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(VERSION) .
docker/build/multiplatform: ## Build multi-platform Docker image
@docker buildx build --platform linux/amd64,linux/arm64 -t $(IMAGE_NAME):latest -t $(IMAGE_NAME):$(VERSION) .
docker/push: ## Push Docker image to registry (requires authentication)
@docker push $(IMAGE_NAME):latest
@docker push $(IMAGE_NAME):$(VERSION)
docker/login: ## Login to GitHub Container Registry
@echo $(GITHUB_TOKEN) | docker login ghcr.io -u $(GITHUB_USER) --password-stdin
##@ Info
version: ## Show current version
@echo $(VERSION)
deps/list: ## Show installed dependencies
@uv pip list
info: ## Show project information
@echo "Project: garmin-connect-mcp"
@echo "Version: $(VERSION)"
@echo "Python: $$(python --version)"
@echo "Image: $(IMAGE_NAME)"
help: ## Show this help message
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_\-\/]+:.*?##/ { printf " \033[36m%-25s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
t: test