Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
| 1 | name: Docs - Python Snippets |
| 2 | |
| 3 | # Checks maintained Python fences for syntax and current SDK-attributed errors |
| 4 | # against local SDK/provider source. See docs/agent-guidance/context/code-examples.md. |
| 5 | on: |
| 6 | pull_request: |
| 7 | paths: |
| 8 | # Includes rendered/component-backed sources, package manifests/lockfiles, |
| 9 | # parser, checker, fixtures, and Python-free static tests. |
| 10 | - 'docs/**' |
| 11 | # Includes SDK/provider source, setup.py, and dependency-group metadata. |
| 12 | - 'python/**' |
| 13 | - 'pyproject.toml' |
| 14 | - 'uv.lock' |
| 15 | - '.github/actions/setup-node-pnpm-bun/action.yml' |
| 16 | - '.github/actions/setup-python-uv/action.yml' |
| 17 | - '.github/workflows/docs-python-snippets.yml' |
| 18 | - 'mise.toml' |
| 19 | - 'mise.lock' |
| 20 | |
| 21 | concurrency: |
| 22 | group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.run_id }} |
| 23 | cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 24 | |
| 25 | permissions: |
| 26 | contents: read |
| 27 | |
| 28 | jobs: |
| 29 | python-snippets: |
| 30 | runs-on: ubuntu-latest |
| 31 | defaults: |
| 32 | run: |
| 33 | working-directory: ./docs |
| 34 | |
| 35 | steps: |
| 36 | - name: Checkout repository |
| 37 | uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 38 | |
| 39 | - name: Setup Node.js, pnpm, Bun |
| 40 | uses: ./.github/actions/setup-node-pnpm-bun |
| 41 | |
| 42 | - name: Setup Python and uv |
| 43 | uses: ./.github/actions/setup-python-uv |
| 44 | |
| 45 | - name: Cache bun dependencies |
| 46 | uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 |
| 47 | with: |
| 48 | path: ~/.bun/install/cache |
| 49 | key: ${{ runner.os }}-bun-${{ hashFiles('docs/bun.lock') }} |
| 50 | restore-keys: | |
| 51 | ${{ runner.os }}-bun- |
| 52 | |
| 53 | # The checker needs no generated files or native install hooks. |
| 54 | - name: Install dependencies |
| 55 | run: bun install --frozen-lockfile --ignore-scripts |
| 56 | |
| 57 | - name: Check real Python helper regressions |
| 58 | run: bun scripts/python-snippets/test-helper.ts |
| 59 | |
| 60 | - name: Check Python snippets against the SDK |
| 61 | run: bun run check:python-snippets |