Skip to content

Add Python 3.14 to the supported versions#1961

Merged
seratch merged 3 commits into
mainfrom
python-3.14
Oct 29, 2025
Merged

Add Python 3.14 to the supported versions#1961
seratch merged 3 commits into
mainfrom
python-3.14

Conversation

@seratch
Copy link
Copy Markdown
Member

@seratch seratch commented Oct 21, 2025

Update the package metadata and CI builds

Copy link
Copy Markdown
Member Author

@seratch seratch left a comment

Choose a reason for hiding this comment

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

While the installation now passes, some of tests are still failing

Comment thread pyproject.toml Outdated
@seratch seratch marked this pull request as draft October 21, 2025 09:48
@seratch
Copy link
Copy Markdown
Member Author

seratch commented Oct 21, 2025

=================================== FAILURES ===================================
________________________ test_sync_agent_hook_with_llm _________________________

    def test_sync_agent_hook_with_llm():
        hooks = AgentHooksForTests()
        model = FakeModel()
        agent = Agent(
            name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[], hooks=hooks
        )
        # Simulate a single LLM call producing an output:
        model.set_next_output([get_text_message("hello")])
>       Runner.run_sync(agent, input="hello")

tests/test_agent_llm_hooks.py:97: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/agents/run.py:416: in run_sync
    return runner.run_sync(
src/agents/run.py:723: in run_sync
    return asyncio.get_event_loop().run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <asyncio.unix_events._UnixDefaultEventLoopPolicy object at 0x7fb9d9b4cd70>

    def get_event_loop(self):
        """Get the event loop for the current context.
    
        Returns an instance of EventLoop or raises an exception.
        """
        if self._local._loop is None:
>           raise RuntimeError('There is no current event loop in thread %r.'
                               % threading.current_thread().name)
E           RuntimeError: There is no current event loop in thread 'MainThread'.

../../../.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/asyncio/events.py:715: RuntimeError
_________________________ test_sync_run_hook_with_llm __________________________

    def test_sync_run_hook_with_llm():
        hooks = RunHooksForTests()
        model = FakeModel()
        agent = Agent(name="A", model=model, tools=[get_function_tool("f", "res")], handoffs=[])
        # Simulate a single LLM call producing an output:
        model.set_next_output([get_text_message("hello")])
>       Runner.run_sync(agent, input="hello", hooks=hooks)

tests/test_run_hooks.py:105: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
src/agents/run.py:416: in run_sync
    return runner.run_sync(
src/agents/run.py:723: in run_sync
    return asyncio.get_event_loop().run_until_complete(
           ^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <asyncio.unix_events._UnixDefaultEventLoopPolicy object at 0x7fb9d9b4cd70>

    def get_event_loop(self):
        """Get the event loop for the current context.
    
        Returns an instance of EventLoop or raises an exception.
        """
        if self._local._loop is None:
>           raise RuntimeError('There is no current event loop in thread %r.'
                               % threading.current_thread().name)
E           RuntimeError: There is no current event loop in thread 'MainThread'.

../../../.local/share/uv/python/cpython-3.14.0-linux-x86_64-gnu/lib/python3.14/asyncio/events.py:715: RuntimeError
=============================== warnings summary ===============================
.venv/lib/python3.14/site-packages/fastapi/routing.py:234
  /home/runner/work/openai-agents-python/openai-agents-python/.venv/lib/python3.14/site-packages/fastapi/routing.py:234: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    is_coroutine = asyncio.iscoroutinefunction(dependant.call)

.venv/lib/python3.14/site-packages/litellm/litellm_core_utils/logging_utils.py:160: 17 warnings
  /home/runner/work/openai-agents-python/openai-agents-python/.venv/lib/python3.14/site-packages/litellm/litellm_core_utils/logging_utils.py:160: DeprecationWarning: 'asyncio.iscoroutinefunction' is deprecated and slated for removal in Python 3.16; use inspect.iscoroutinefunction() instead
    if asyncio.iscoroutinefunction(func):

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/test_agent_llm_hooks.py::test_sync_agent_hook_with_llm - RuntimeError: There is no current event loop in thread 'MainThread'.
FAILED tests/test_run_hooks.py::test_sync_run_hook_with_llm - RuntimeError: There is no current event loop in thread 'MainThread'.
============ 2 failed, 918 passed, 3 skipped, 18 warnings in 30.69s ============
make: *** [Makefile:29: coverage] Error 1

https://github.com/openai/openai-agents-python/actions/runs/18679862649/job/53258264262?pr=1961

Comment thread pyproject.toml Outdated
@ProCityHub

This comment was marked as off-topic.

@Xahid88

This comment was marked as off-topic.

@seratch seratch marked this pull request as ready for review October 29, 2025 02:04
@seratch
Copy link
Copy Markdown
Member Author

seratch commented Oct 29, 2025

I've removed tiktoken as it's no longer necessary to explicitly have

@seratch seratch merged commit 1466ddb into main Oct 29, 2025
9 checks passed
@seratch seratch deleted the python-3.14 branch October 29, 2025 02:09
Copy link
Copy Markdown

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

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.

ℹ️ 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 src/agents/run.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants