fix(sdk/python): resolve ResultCache cross-loop deadlock (#623) #793
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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'] | |
| 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: 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: 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" |