Skip to content

feat: require Python 3.10 and automate version reviews#3537

Merged
jbeckwith-oai merged 12 commits into
mainfrom
codex/python-3-10-version-policy
Jul 24, 2026
Merged

feat: require Python 3.10 and automate version reviews#3537
jbeckwith-oai merged 12 commits into
mainfrom
codex/python-3-10-version-policy

Conversation

@jbeckwith-oai

Copy link
Copy Markdown
Contributor

Summary

  • raise the minimum supported runtime from Python 3.9 to Python 3.10
  • codify the SDK's Python-version and SemVer policy
  • test the minimum/current runtimes on normal CI and the full supported matrix on a schedule
  • add a monthly, least-privilege Codex assessment that opens or refreshes an advisory issue when lifecycle, usage, or repository drift needs maintainer action
  • validate built metadata and prove that pip on Python 3.9 rejects the new wheel

Why

Python 3.9 reached upstream end of life, while Python 3.10 remains supported through October 2026. Internal usage analysis estimates Python 3.9 at 2.09% of identifiable SDK downloads over 30 days and 2.44% over 90 days. The support policy, decision rationale, and rollout analysis are documented in the Python SDK version support PRD.

The automation follows the existing openai-go design: lifecycle and public usage inputs are snapshotted before Codex runs; the pinned agent runs as an unprivileged user with no command network access or repository writes; and a separate job without the OpenAI credential may publish an advisory issue. It never changes Requires-Python automatically.

User impact

Python 3.9 users remain on openai==2.48.0, the final compatible release. Installing the next minor release on Python 3.9 is rejected by standard package metadata rather than producing an import-time failure. Python 3.10 through 3.14 remain supported, with Python 3.15 tested as allowed-failure prerelease coverage.

A runtime-floor increase is treated as an SDK minor release rather than a patch or major release when documented APIs remain compatible on supported runtimes and Requires-Python protects unsupported installers.

Validation

  • rye build
  • ./scripts/lint
  • ./scripts/test: 7,079 passed, 29 skipped
  • Pydantic v1 session: 7,065 passed, 43 skipped
  • wheel and sdist Requires-Python validation
  • pip rejection using an actual Python 3.9 interpreter
  • Bedrock and HTTPX2 dependency/resolver validation
  • deterministic policy, lockfile, workflow YAML, and diff checks

Release note

The OpenAI Python SDK now requires Python 3.10 or later. openai==2.48.0 is the final release installable on Python 3.9. Previously published versions remain available, but unsupported runtimes and older SDK releases do not receive guaranteed fixes or security backports.

Copilot AI review requested due to automatic review settings July 23, 2026 21:39

Copilot AI left a comment

Copy link
Copy Markdown

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 SDK’s minimum supported Python runtime to 3.10 and adds policy + automation to keep Python-version support, metadata, documentation, and CI coverage synchronized over time.

Changes:

  • Bump Requires-Python/classifiers/tooling targets to Python 3.10+ and remove now-redundant Python-version dependency markers.
  • Add deterministic policy checks and wheel/SDist metadata validation (including verifying Python 3.9 rejects the new wheel).
  • Expand CI to test min/current runtimes per PR, run a scheduled full-matrix smoke suite, and add a monthly least-privilege Codex-based version review workflow.

Reviewed changes

Copilot reviewed 17 out of 20 changed files in this pull request and generated no comments.

Show a summary per file
File Description
uv.lock Updates lock resolution and markers for the new minimum Python (3.10+).
tests/lib/test_bedrock_auth_conformance.py Uses zip(..., strict=True) now that Python 3.10+ is required.
scripts/utils/validate-python-version-wheel.py New script to validate Requires-Python in built artifacts and prove Python 3.9 rejects the wheel.
scripts/utils/validate-httpx2-wheel.py Updates metadata assertions and runtime behaviors now that Python 3.10+ is the floor.
scripts/utils/validate-bedrock-wheel.py Updates Bedrock extra validation for the unified supported Botocore requirement.
scripts/check-python-version-policy.py New deterministic check ensuring docs/metadata/CI/tooling agree on Python support policy.
requirements.lock Regenerated Rye lock output for the updated dependency surface.
requirements-dev.lock Regenerated dev lock output for the updated dependency surface.
README.md Updates stated minimum Python version and documents SemVer treatment for floor raises.
PYTHON_VERSION_POLICY.md New policy doc describing support windows, testing expectations, and release treatment.
pyproject.toml Raises requires-python, removes 3.9 classifier, and removes redundant Python markers on extras.
examples/realtime/push_to_talk_app.py Updates inline script metadata to require Python 3.10+.
CONTRIBUTING.md Links to the new Python version policy and documents floor-change requirements.
AGENTS.md Adds repository guidance and a consolidated checklist for Python floor changes.
.python-version Pins the contributor toolchain to Python 3.10.x.
.github/workflows/python-version-review.yml New monthly workflow that snapshots lifecycle/usage data and runs a least-privilege Codex assessment.
.github/workflows/ci.yml Adds per-PR min/current testing, scheduled compatibility smoke matrix, and metadata/rejection validations.
.github/codex/python-version-review-config.toml New least-privilege Codex permission profile for the scheduled review.
.github/codex/prompts/python-version-review.md New Codex prompt defining policy criteria and required output format.
.github/CODEOWNERS Requires SDK team review for Python floor/policy and related automation files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 23, 2026 21:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/ci.yml
Copilot AI review requested due to automatic review settings July 23, 2026 21:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 3 comments.

Comment thread scripts/utils/validate-python-version-wheel.py
Comment thread scripts/utils/validate-python-version-wheel.py
Comment thread PYTHON_VERSION_POLICY.md Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 22:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Comment thread .github/workflows/python-version-review.yml Outdated
Copilot AI review requested due to automatic review settings July 23, 2026 22:11

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Comment thread scripts/utils/validate-httpx2-wheel.py
Copilot AI review requested due to automatic review settings July 23, 2026 22:26

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 17 out of 20 changed files in this pull request and generated 1 comment.

Comment thread pyproject.toml
@jbeckwith-oai
jbeckwith-oai marked this pull request as ready for review July 24, 2026 01:46
@jbeckwith-oai
jbeckwith-oai requested a review from a team as a code owner July 24, 2026 01:46
@openai-sdks

openai-sdks Bot commented Jul 24, 2026

Copy link
Copy Markdown

OkTest Summary

237/237 SDK tests passed in 9.435s for Python SDK PR #3537.

Test results — 42 files
Test Result Time
tests/chat-completions-complex-body.test.ts ✅ Passed 122ms
tests/chat-completions-create.test.ts ✅ Passed 226ms
tests/chat-completions-stream.test.ts ✅ Passed 100ms
tests/files-content-binary.test.ts ✅ Passed 123ms
tests/files-create-multipart.test.ts ✅ Passed 280ms
tests/files-list-pagination.test.ts ✅ Passed 114ms
tests/initialize-config.test.ts ✅ Passed 125ms
tests/instance-isolation.test.ts ✅ Passed 146ms
tests/models-list.test.ts ✅ Passed 264ms
tests/responses-background-lifecycle.test.ts ✅ Passed 229ms
tests/responses-body-method-errors.test.ts ✅ Passed 288ms
tests/responses-cancel-timeout.test.ts ✅ Passed 217ms
tests/responses-cancel.test.ts ✅ Passed 241ms
tests/responses-compact-retries.test.ts ✅ Passed 246ms
tests/responses-compact.test.ts ✅ Passed 192ms
tests/responses-create-advanced-stream.test.ts ✅ Passed 110ms
tests/responses-create-advanced.test.ts ✅ Passed 151ms
tests/responses-create-disconnect.test.ts ✅ Passed 1.3s
tests/responses-create-errors.test.ts ✅ Passed 247ms
tests/responses-create-malformed-api-responses.test.ts ✅ Passed 163ms
tests/responses-create-retries.test.ts ✅ Passed 313ms
tests/responses-create-stream-failures.test.ts ✅ Passed 114ms
tests/responses-create-stream-timeout.test.ts ✅ Passed 182ms
tests/responses-create-stream-wire.test.ts ✅ Passed 2.763s
tests/responses-create-stream.test.ts ✅ Passed 112ms
tests/responses-create-terminal-states.test.ts ✅ Passed 215ms
tests/responses-create-timeout.test.ts ✅ Passed 238ms
tests/responses-create.test.ts ✅ Passed 201ms
tests/responses-delete.test.ts ✅ Passed 187ms
tests/responses-input-items-errors.test.ts ✅ Passed 259ms
tests/responses-input-items-list.test.ts ✅ Passed 267ms
tests/responses-input-items-options.test.ts ✅ Passed 250ms
tests/responses-input-tokens-count-timeout.test.ts ✅ Passed 205ms
tests/responses-input-tokens-count.test.ts ✅ Passed 158ms
tests/responses-malformed-inputs.test.ts ✅ Passed 2.003s
tests/responses-not-found-errors.test.ts ✅ Passed 252ms
tests/responses-parse.test.ts ✅ Passed 322ms
tests/responses-retrieve-retries.test.ts ✅ Passed 244ms
tests/responses-retrieve.test.ts ✅ Passed 194ms
tests/responses-stored-method-errors.test.ts ✅ Passed 784ms
tests/retry-behavior.test.ts ✅ Passed 3.076s
tests/sdk-error-shape.test.ts ✅ Passed 300ms

View OkTest run #30125296618

SDK merge (b48e1304c403) · head (26090d3e4b3d) · base (8a6adcb3b88d) · OkTest (91635c6a2723)

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 59fe6ea218

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/workflows/python-version-review.yml Outdated
Comment thread scripts/check-python-version-policy.py Outdated
@apcha-oai

Copy link
Copy Markdown
Contributor

Can we remove workflow_dispatch from the Codex workflow and make it cron-only? Scheduled workflows already run exclusively on the default branch (main). Otherwise LGMT

Copy link
Copy Markdown
Contributor Author

@apcha-oai Fixed in 6922777: I removed workflow_dispatch from the monthly Codex workflow, so it is cron-only on the default branch, and updated the repository automation map to match. Thanks!

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 69227778fc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread .github/codex/prompts/python-version-review.md Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 06fe88d81d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-python-version-policy.py
Comment thread requirements.lock

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8406132629

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-python-version-policy.py

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 41ac9de0ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread scripts/check-python-version-policy.py

@HAYDEN-OAI HAYDEN-OAI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed 26090d3 with a thermonuclear maintainability pass. I inspected the complete diff, repository policy and packaging surfaces, monthly automation trust boundary, prior review threads, and current CI. The latest head closes the lockfile synchronization gap; I found no remaining substantive correctness, security, compatibility, or structural-maintainability issues. CI is green for lint, build plus wheel/sdist metadata and Python 3.9 rejection, Bedrock/HTTPX2 validators, Python 3.10/3.14 tests, HTTPX2, examples, CodeQL, breaking-change detection, and Agents SDK integration.

@jbeckwith-oai
jbeckwith-oai merged commit d4c151d into main Jul 24, 2026
20 checks passed
@jbeckwith-oai
jbeckwith-oai deleted the codex/python-3-10-version-policy branch July 24, 2026 21:02
@stainless-app stainless-app Bot mentioned this pull request Jul 24, 2026
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