-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (68 loc) · 2.28 KB
/
Copy pathsdk-python.yml
File metadata and controls
78 lines (68 loc) · 2.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
name: SDK (Python)
on:
push:
branches: [main]
paths:
- "clients/sdk-python/**"
- ".github/workflows/sdk-python.yml"
pull_request:
paths:
- "clients/sdk-python/**"
- ".github/workflows/sdk-python.yml"
defaults:
run:
working-directory: clients/sdk-python
jobs:
ci:
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: pip
cache-dependency-path: clients/sdk-python/pyproject.toml
- name: Install package + dev extras
run: |
python -m pip install --upgrade pip
pip install -e '.[dev]' build
- name: Lint (ruff)
run: ruff check src
- name: Typecheck (mypy)
# Strict mode is on for `src/`; skip the IDL JSON and the dist tree.
run: mypy src/agent_fuel
- name: Build sdist + wheel
run: python -m build
- name: Import smoke-test from built wheel
# Install the just-built wheel into a fresh path and check the public
# surface imports cleanly — catches packaging mistakes that an
# editable install hides (missing files in MANIFEST, broken entry
# points, etc.).
run: |
python -m venv /tmp/wheel-check
/tmp/wheel-check/bin/pip install dist/*.whl
/tmp/wheel-check/bin/python -c "
import agent_fuel
assert agent_fuel.__version__, 'version missing'
# Touch every slice's public entry-point so a missing module
# import fails the build.
from agent_fuel import (
AgentFuel, pay, spend, request_spend, register_service,
subscribe, payment_required, PaymentRequirement,
LiveEventFrame, Subscription,
)
print('wheel smoke ok:', agent_fuel.__version__)
"
- name: Upload dist artifacts
if: matrix.python-version == '3.12'
uses: actions/upload-artifact@v4
with:
name: agent-fuel-sdk-dist
path: clients/sdk-python/dist/
if-no-files-found: error
retention-days: 7