name: Python # The Python SDK: lint, types, and the hermetic suites, one job per folder of tests: # host (the bindings and the host adapters), plugins (each provider against a local peer) and # smoke (the installed package end to end). e2e.yml runs tests/e2e. on: push: branches: [main, v2.0] paths-ignore: ['**/*.md'] pull_request: paths-ignore: ['**/*.md'] workflow_dispatch: permissions: contents: read jobs: lint: runs-on: nscloud-ubuntu-24.04-amd64-16x32-with-cache steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - uses: ./.github/actions/setup with: rust: 'false' - run: uv sync --locked --only-group lint - run: uv run --no-sync ruff check --output-format=github . - run: uv run --no-sync ruff format --check . # On 3.12: some extras (AWS realtime) install only there. Pyright still checks the code as # 3.11 (pythonVersion in pyproject.toml). types: runs-on: nscloud-ubuntu-24.04-amd64-16x32-with-cache steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - uses: ./.github/actions/setup with: cache-key: python - run: uv sync --all-extras --dev - uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 with: path: .mypy_cache key: mypy-${{ hashFiles('uv.lock') }}-${{ github.run_id }} restore-keys: mypy-${{ hashFiles('uv.lock') }}- - run: make type-check tests: runs-on: nscloud-ubuntu-24.04-amd64-16x32-with-cache strategy: fail-fast: false matrix: suite: [host, plugins, smoke] steps: - uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7 - uses: ./.github/actions/setup with: cache-key: python - run: uv sync --all-extras --dev - run: uv run --no-sync pytest tests/${{ matrix.suite }}