-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
76 lines (63 loc) · 1.87 KB
/
Makefile
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
include .env
# Variables
PACKAGE_NAME := mcp-pinecone
# Colors for better visibility
CYAN := \033[36m
GREEN := \033[32m
RED := \033[31m
RESET := \033[0m
# Default make command
all: help
## reinstall-deps: Reinstall dependencies with uv
reinstall-deps:
uv sync --reinstall
## lint: Lint the code
lint:
uv run ruff check .
## build: Build the package
build:
uv build
## lock-upgrade: Lock dependencies to the latest version
lock-upgrade:
uv lock --upgrade
## publish: Publish the package to PyPI
publish:
@if [ -z "$(PYPI_TOKEN)" ]; then \
echo "$(RED)Error: PYPI_TOKEN is not set$(RESET)"; \
exit 1; \
fi
uv publish --username __token__ --password ${PYPI_TOKEN}
## release: Create and push a new release tag
release:
@if [ -z "$(VERSION)" ]; then \
echo "$(RED)Error: VERSION is required. Use 'make release VERSION=x.x.x'$(RESET)"; \
exit 1; \
fi
@echo "$(GREEN)Creating release v$(VERSION)...$(RESET)"
git tag -a v$(VERSION) -m "Release v$(VERSION)"
git push origin v$(VERSION)
@echo "\nRelease v$(VERSION) created!"
@echo "Users can install with:"
@echo " uvx install github:sirmews/$(PACKAGE_NAME)@v$(VERSION)"
@echo " uv pip install git+https://github.com/sirmews/$(PACKAGE_NAME).git@v$(VERSION)"
## inspect-local-server: Inspect the local MCP server
inspect-local-server:
npx @modelcontextprotocol/inspector uv --directory . run $(PACKAGE_NAME)
## help: Show a list of commands
help : Makefile
@echo "Usage:"
@echo " make $(CYAN)<target>$(RESET)"
@echo ""
@echo "Targets:"
@awk '/^[a-zA-Z\-_0-9%:\\]+/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = $$1; \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
gsub("\\\\", "", helpCommand); \
gsub(":+$$", "", helpCommand); \
printf " $(CYAN)%-20s$(RESET) %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
.PHONY: all help