Add Python SDK CI workflow#4
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a GitHub Actions CI workflow for the Python SDK to validate code quality and packaging on PRs and pushes to main.
Changes:
- Introduces a CI workflow triggered on
pull_requestandpushtomain. - Runs linting (ruff), formatting check (ruff format), type checking (pyright), tests (pytest), and package build (uv build).
- Executes the pipeline across a Python version matrix (3.11, 3.12, 3.13).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Add pytest-cov to dev dependencies and run pytest with --cov flags to generate coverage reports in CI.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - uses: astral-sh/setup-uv@v8.0.0 | ||
| - run: uv python install ${{ matrix.python-version }} | ||
| - run: uv sync | ||
| - run: uv run ruff check . |
There was a problem hiding this comment.
The job installs a matrix Python version, but uv sync/uv run may still end up using the project’s pinned interpreter (there’s a .python-version file set to 3.11) unless the interpreter is explicitly selected. To ensure the matrix is actually exercised, set UV_PYTHON=${{ matrix.python-version }} for the job/steps or run uv run --python ... / uv python pin before syncing/running tools.
| - uses: actions/checkout@v6 | ||
| - uses: astral-sh/setup-uv@v8.0.0 | ||
| - run: uv python install ${{ matrix.python-version }} | ||
| - run: uv sync |
There was a problem hiding this comment.
For CI reproducibility, consider running uv sync in a mode that fails if the lockfile is out of date (e.g., --frozen / --locked, depending on your intended behavior). Without this, CI can silently resolve to different dependency versions than what’s committed in uv.lock.
| - run: uv sync | |
| - run: uv sync --frozen |
- Set UV_PYTHON to ensure the matrix Python version is used instead of the .python-version pin - Use --frozen to fail CI if the lockfile is out of date
Summary
Test plan