Skip to content

chore(python): Bump the oldest supported Python version to 3.11#561

Merged
patniko merged 11 commits intogithub:mainfrom
brettcannon:python-3.11
Feb 27, 2026
Merged

chore(python): Bump the oldest supported Python version to 3.11#561
patniko merged 11 commits intogithub:mainfrom
brettcannon:python-3.11

Conversation

@brettcannon
Copy link
Contributor

@brettcannon brettcannon commented Feb 24, 2026

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.

@brettcannon brettcannon requested a review from a team as a code owner February 24, 2026 23:14
Copilot AI review requested due to automatic review settings February 24, 2026 23:14
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.11 and update Ruff target version accordingly.
  • Modernize type hints across Python sources/tests to use X | None, built-in generics (list[...], dict[...]), and stdlib typing.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.

@brettcannon
Copy link
Contributor Author

I don't think those test failures are because of my PR.

@brettcannon brettcannon changed the title Bump the oldest supported Python version to 3.11 chore(python): Bump the oldest supported Python version to 3.11 Feb 25, 2026
# Conflicts:
#	python/copilot/generated/session_events.py
brettcannon and others added 6 commits February 25, 2026 10:08
# 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 patniko added this pull request to the merge queue Feb 27, 2026
Merged via the queue into github:main with commit 35534c4 Feb 27, 2026
17 checks passed
@brettcannon brettcannon deleted the python-3.11 branch February 27, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants