-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
111 lines (91 loc) · 3.28 KB
/
Copy pathMakefile
File metadata and controls
111 lines (91 loc) · 3.28 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: test-coverage clean install dev format lint all server build upload-test upload release deptry mypy test-mcp test-mcp-extended test-integration
# Default target
all: clean install dev test-coverage format lint mypy deptry build test-mcp test-mcp-extended test-integration
# Install everything for development
dev:
uv sync --group dev
# Install production only
install:
uv sync
# Run tests with coverage
test-coverage:
uv run pytest --cov=ols_mcp --cov-report=html --cov-report=term tests/
# Clean up build artifacts
clean:
rm -rf build/
rm -rf dist/
rm -rf *.egg-info
find . -type d -name __pycache__ -exec rm -rf {} +
find . -type f -name "*.pyc" -delete
rm -rf src/*.egg-info
# Run server mode
server:
uv run python src/ols_mcp/main.py
# Format code with black
format:
uv run black src/ tests/
lint:
uv run ruff check --fix src/ tests/
# Check for unused dependencies
deptry:
uvx deptry .
# Type checking
mypy:
uv run mypy src/
# Build package with hatch
build:
uv run hatch build
# Upload to TestPyPI (using token-based auth)
upload-test:
uv run twine upload --repository testpypi dist/*
# Upload to PyPI (using token-based auth - set TWINE_PASSWORD environment variable first)
upload:
uv run twine upload dist/*
# Complete release workflow
release: clean test-coverage build upload
# Integration Testing
test-integration:
@echo "🔬 Testing OLS integration..."
uv run pytest tests/test_integration.py -v -m integration
# Run all unit tests (mocked)
test-unit:
@echo "🧪 Running unit tests..."
uv run pytest tests/test_api.py tests/test_tools.py -v
# Run integration tests that hit real API
test-real-api:
@echo "🌐 Testing against real OLS API..."
uv run pytest tests/test_integration.py -v -m integration
# MCP Server testing
test-mcp:
@echo "Testing MCP protocol with tools listing..."
@(echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2025-03-26", "capabilities": {"tools": {}}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}, "id": 1}'; \
sleep 0.1; \
echo '{"jsonrpc": "2.0", "method": "notifications/initialized", "params": {}}'; \
sleep 0.1; \
echo '{"jsonrpc": "2.0", "method": "tools/list", "id": 2}') | \
timeout 30 uv run python src/ols_mcp/main.py
test-mcp-extended:
@echo "Testing MCP protocol with tool execution..."
@(echo '{"jsonrpc": "2.0", "method": "initialize", "params": {"protocolVersion": "2025-03-26", "capabilities": {"tools": {}}, "clientInfo": {"name": "test-client", "version": "1.0.0"}}, "id": 1}'; \
sleep 0.1; \
echo '{"jsonrpc": "2.0", "method": "notifications/initialized", "params": {}}'; \
sleep 0.1; \
echo '{"jsonrpc": "2.0", "method": "tools/call", "params": {"name": "search_all_ontologies", "arguments": {"query": "cancer", "max_results": 3}}, "id": 2}') | \
timeout 30 uv run python src/ols_mcp/main.py
# OLS MCP - Claude Desktop config:
# Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
# {
# "mcpServers": {
# "ols-mcp": {
# "command": "uv",
# "args": ["run", "python", "src/ols_mcp/main.py"],
# "cwd": "/path/to/ols-mcp"
# }
# }
# }
#
# Claude Code MCP setup:
# claude mcp add -s project ols-mcp uv run python src/ols_mcp/main.py
#
# Goose setup:
# goose session --with-extension "uv run python src/ols_mcp/main.py"