-
Notifications
You must be signed in to change notification settings - Fork 8
101 lines (86 loc) · 3.14 KB
/
Copy pathci.yml
File metadata and controls
101 lines (86 loc) · 3.14 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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
python-checks:
name: Python Lint & Import Check
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install ruff
- name: Lint unrealmcp/ (pip package)
run: |
ruff check unrealmcp/ --select=E,F,W --ignore=E501,F401
- name: Install unrealmcp package
run: |
pip install -e .
- name: Verify unrealmcp imports and version
run: |
python -c "
import unrealmcp
print(f'unrealmcp v{unrealmcp.__version__}')
assert unrealmcp.__version__ == '1.0.0', f'Unexpected version: {unrealmcp.__version__}'
"
- name: Verify all tool modules import via package
run: |
python -c "
import importlib, os
# Import the bridge
from unrealmcp._bridge import mcp
print(f' Bridge OK — server name: {mcp.name}')
# Import each tool module
tools_dir = os.path.join(os.path.dirname(os.path.abspath(os.path.dirname(__import__('unrealmcp').__file__))), 'unrealmcp', 'tools')
count = 0
for f in sorted(os.listdir(tools_dir)):
if f.endswith('.py') and f != '__init__.py':
mod_name = f'unrealmcp.tools.{f[:-3]}'
print(f' Importing {mod_name}...', end=' ')
importlib.import_module(mod_name)
print('OK')
count += 1
print(f'\nAll {count} tool modules imported successfully.')
"
- name: Verify unrealmcp entry point exists
run: |
which unrealmcp
unrealmcp --help || true
- name: Verify plugin descriptor is valid JSON
run: |
python -c "
import json
with open('UnrealMCP.uplugin') as f:
data = json.load(f)
assert 'Modules' in data, 'Missing Modules key'
assert 'FriendlyName' in data, 'Missing FriendlyName key'
print('Plugin descriptor is valid.')
"
- name: Verify pyproject.toml metadata
run: |
python -c "
import sys
if sys.version_info >= (3, 11):
import tomllib
else:
import pip._vendor.tomli as tomllib
with open('pyproject.toml', 'rb') as f:
data = tomllib.load(f)
project = data['project']
assert project['name'] == 'unrealmcp', f'Wrong name: {project[\"name\"]}'
assert 'fastmcp' in str(project['dependencies']), 'Missing fastmcp dependency'
scripts = project.get('scripts', {})
assert 'unrealmcp' in scripts, 'Missing unrealmcp entry point'
print(f'pyproject.toml valid: {project[\"name\"]} v{project[\"version\"]}')
"