chore(python): Bump the oldest supported Python version to 3.11#561
Merged
patniko merged 11 commits intogithub:mainfrom Feb 27, 2026
Merged
chore(python): Bump the oldest supported Python version to 3.11#561patniko merged 11 commits intogithub:mainfrom
patniko merged 11 commits intogithub:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR raises the minimum supported Python version for the Python SDK to 3.11 and modernizes type annotations across the Python package and test harness to use Python 3.10+ syntax, aligning linting and CI with the new baseline.
Changes:
- Bump Python package minimum version to
>=3.11and update Ruff target version accordingly. - Modernize type hints across Python sources/tests to use
X | None, built-in generics (list[...],dict[...]), and stdlibtyping.NotRequired. - Expand GitHub Actions Python SDK test workflow to run across a Python-version matrix.
Reviewed changes
Copilot reviewed 10 out of 12 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
python/pyproject.toml |
Raises minimum Python version, updates trove classifiers, and switches Ruff target-version to py311. |
python/e2e/testharness/proxy.py |
Updates type hints to ` |
python/e2e/testharness/context.py |
Updates internal optional fields to ` |
python/e2e/test_session.py |
Switches timeout exception handling to TimeoutError. |
python/copilot/types.py |
Adopts Python 3.10+ union syntax and moves NotRequired to stdlib typing. |
python/copilot/tools.py |
Uses collections.abc.Callable for annotations. |
python/copilot/session.py |
Updates optional annotations and changes timeout exception handling. |
python/copilot/jsonrpc.py |
Updates type hints to ` |
python/copilot/generated/session_events.py |
Generated typing modernizations (built-in generics/unions). |
python/copilot/generated/rpc.py |
Generated typing modernizations (built-in generics/unions). |
python/copilot/client.py |
Updates optional annotations and timeout exception handling. |
.github/workflows/python-sdk-tests.yml |
Adds a Python-version matrix to run SDK tests across multiple interpreters. |
Contributor
Author
|
I don't think those test failures are because of my PR. |
# Conflicts: # python/copilot/generated/session_events.py
# Conflicts: # python/copilot/jsonrpc.py # python/copilot/session.py
Update generated files for Python and Go SDKs to include new agent API types, compaction result types, and new session event types (assistant.streaming_delta, session.task_complete). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Run gofmt on go/rpc/generated_rpc.go and go/generated_session_events.go to fix spaces→tabs formatting that caused the Codegen Check to fail. - Fix test_resume_session_forwards_client_name to return a mock response for session.resume instead of forwarding to the real CLI, which requires the COPILOT_HMAC_KEY secret unavailable to fork PRs. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
patniko
approved these changes
Feb 27, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python 3.10 gives us nicer type hint syntax and 3.11 gives us exception groups which will be used in the future. Along the way, expand the test matrix for Python versions in CI.