Repository navigation
120 lines (103 loc) · 3.41 KB
/
Copy pathsdk-python.yml
File metadata and controls
120 lines (103 loc) · 3.41 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
120
name: Python SDK CI
on:
pull_request:
paths:
- 'sdk/python/**'
- '.github/workflows/sdk-python.yml'
push:
branches: [main]
paths:
- 'sdk/python/**'
- '.github/workflows/sdk-python.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
lint-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v6
# Advisory until the release workflow regenerates uv.lock when it bumps
# pyproject.toml: every "chore(release)" commit changes the project
# version without touching the lock, so a blocking check fails on every
# open PR after each release candidate.
- name: Check dependency lock (advisory)
working-directory: sdk/python
continue-on-error: true
run: uv lock --check
- name: Install dependencies
working-directory: sdk/python
run: |
python -m pip install --upgrade pip
pip install .[dev]
# Pinned: ruff 0.16.0 flags ~2700 pre-existing violations (I001,
# BLE001, C408, ...) repo-wide; bump deliberately alongside the fixes.
pip install "ruff==0.15.22"
- name: Lint
working-directory: sdk/python
run: |
ruff check .
- name: Type check (mypy)
working-directory: sdk/python
run: |
mypy --config-file mypy.ini agentfield/
- name: Format (auto-fix)
working-directory: sdk/python
run: |
ruff format .
continue-on-error: true
- name: Run tests
working-directory: sdk/python
run: ./scripts/run_pytest.sh
# Verify websockets version compatibility (v14 renamed extra_headers → additional_headers)
websockets-compat:
runs-on: ubuntu-latest
strategy:
matrix:
websockets-version: ['12.0', '15.0.1']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install dependencies
working-directory: sdk/python
run: |
python -m pip install --upgrade pip
pip install .[dev]
pip install websockets==${{ matrix.websockets-version }}
- name: Verify websockets version
run: python -c "import websockets; print(f'websockets {websockets.__version__}')"
- name: Run memory events tests
working-directory: sdk/python
run: ./scripts/run_pytest.sh tests/test_memory_events.py -v --no-cov
# Summary job that depends on all critical checks
required-checks:
name: All Required Checks Passed
runs-on: ubuntu-latest
needs: [lint-and-test, websockets-compat]
if: always()
steps:
- name: Check all jobs
run: |
if [ "${{ needs.lint-and-test.result }}" != "success" ]; then
echo "lint-and-test failed"
exit 1
fi
if [ "${{ needs.websockets-compat.result }}" != "success" ]; then
echo "websockets-compat failed"
exit 1
fi
echo "All required checks passed successfully"