Skip to content

Commit b6b291f

Browse files
authored
chore: drop Python 3.9 support across metadata, CI, and docs (#2474)
1 parent c473b0c commit b6b291f

15 files changed

Lines changed: 54 additions & 581 deletions

File tree

.github/workflows/tests.yml

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -122,28 +122,3 @@ jobs:
122122
- name: Skip docs build
123123
if: steps.changes.outputs.run != 'true'
124124
run: echo "Skipping docs build for non-docs changes."
125-
126-
old_version_tests:
127-
runs-on: ubuntu-latest
128-
env:
129-
OPENAI_API_KEY: fake-for-tests
130-
steps:
131-
- name: Checkout repository
132-
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
133-
- name: Detect code changes
134-
id: changes
135-
run: ./.github/scripts/detect-changes.sh code "${{ github.event.pull_request.base.sha || github.event.before }}" "${{ github.sha }}"
136-
- name: Setup uv
137-
if: steps.changes.outputs.run == 'true'
138-
uses: astral-sh/setup-uv@803947b9bd8e9f986429fa0c5a41c367cd732b41
139-
with:
140-
enable-cache: true
141-
- name: Install dependencies
142-
if: steps.changes.outputs.run == 'true'
143-
run: make sync
144-
- name: Run tests
145-
if: steps.changes.outputs.run == 'true'
146-
run: make old_version_tests
147-
- name: Skip old version tests
148-
if: steps.changes.outputs.run != 'true'
149-
run: echo "Skipping old version tests for non-code changes."

AGENTS.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ The OpenAI Agents Python repository provides the Python Agents SDK, examples, an
8686

8787
### Prerequisites
8888

89-
- Python 3.9+.
89+
- Python 3.10+.
9090
- `uv` installed for dependency management (`uv sync`) and `uv run` for Python commands.
9191
- `make` available to run repository tasks.
9292

@@ -172,9 +172,10 @@ make tests
172172
```bash
173173
make sync
174174
```
175-
- Run tests against Python 3.9 in an isolated environment:
175+
- Run tests against the oldest supported version (Python 3.10) in an isolated environment:
176176
```bash
177-
make old_version_tests
177+
UV_PROJECT_ENVIRONMENT=.venv_310 uv sync --python 3.10 --all-extras --all-packages --group dev
178+
UV_PROJECT_ENVIRONMENT=.venv_310 uv run --python 3.10 -m pytest
178179
```
179180
- Documentation workflows:
180181
```bash

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,6 @@ snapshots-fix:
3838
snapshots-create:
3939
uv run pytest --inline-snapshot=create
4040

41-
.PHONY: old_version_tests
42-
old_version_tests:
43-
UV_PROJECT_ENVIRONMENT=.venv_39 uv sync --python 3.9 --all-extras --all-packages --group dev
44-
UV_PROJECT_ENVIRONMENT=.venv_39 uv run --python 3.9 -m pytest
45-
4641
.PHONY: build-docs
4742
build-docs:
4843
uv run docs/scripts/generate_ref_files.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ Explore the [examples](examples) directory to see the SDK in action, and read ou
1919

2020
## Get started
2121

22-
To get started, set up your Python environment (Python 3.9 or newer required), and then install OpenAI Agents SDK package.
22+
To get started, set up your Python environment (Python 3.10 or newer required), and then install OpenAI Agents SDK package.
2323

2424
### venv
2525

docs/realtime/quickstart.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Realtime agents are in beta. Expect some breaking changes as we improve the impl
77

88
## Prerequisites
99

10-
- Python 3.9 or higher
10+
- Python 3.10 or higher
1111
- OpenAI API key
1212
- Basic familiarity with the OpenAI Agents SDK
1313

examples/realtime/twilio/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example demonstrates how to connect the OpenAI Realtime API to a phone call
44

55
## Prerequisites
66

7-
- Python 3.9+
7+
- Python 3.10+
88
- OpenAI API key with [Realtime API](https://platform.openai.com/docs/guides/realtime) access
99
- [Twilio](https://www.twilio.com/docs/voice) account with a phone number
1010
- A tunneling service like [ngrok](https://ngrok.com/) to expose your local server

examples/realtime/twilio_sip/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This example shows how to handle OpenAI Realtime SIP calls with the Agents SDK.
44

55
## Prerequisites
66

7-
- Python 3.9+
7+
- Python 3.10+
88
- An OpenAI API key with Realtime API access
99
- A configured webhook secret for your OpenAI project
1010
- A Twilio account with a phone number and Elastic SIP Trunking enabled

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "openai-agents"
33
version = "0.8.4"
44
description = "OpenAI Agents SDK"
55
readme = "README.md"
6-
requires-python = ">=3.9"
6+
requires-python = ">=3.10"
77
license = "MIT"
88
authors = [{ name = "OpenAI", email = "support@openai.com" }]
99
dependencies = [
@@ -19,7 +19,6 @@ classifiers = [
1919
"Typing :: Typed",
2020
"Intended Audience :: Developers",
2121
"Programming Language :: Python :: 3",
22-
"Programming Language :: Python :: 3.9",
2322
"Programming Language :: Python :: 3.10",
2423
"Programming Language :: Python :: 3.11",
2524
"Programming Language :: Python :: 3.12",

src/agents/realtime/openai_realtime.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -247,11 +247,6 @@ async def _build_model_settings_from_agent(
247247
return updated_settings
248248

249249

250-
# Note: Avoid a module-level union alias for Python 3.9 compatibility.
251-
# Using a union at runtime (e.g., A | B) in a type alias triggers evaluation
252-
# during import on 3.9. We instead inline the union in annotations below.
253-
254-
255250
class TransportConfig(TypedDict):
256251
"""Low-level network transport configuration."""
257252

src/agents/realtime/session.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,7 @@ async def on_event(self, event: RealtimeModelEvent) -> None:
320320
for idx, entry in enumerate(incoming_item.content):
321321
# Only attempt to preserve for audio-like content
322322
if entry.type in ("audio", "input_audio"):
323-
# Use tuple form for Python 3.9 compatibility
323+
# Use tuple form when checking against multiple classes.
324324
assert isinstance(entry, (InputAudio, AssistantAudio))
325325
# Determine if transcript is missing/empty on the incoming entry
326326
entry_transcript = entry.transcript

0 commit comments

Comments
 (0)