8000 Incompatible with OpenAI 1.78.0 · Issue #234 · PostHog/posthog-python · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Incompatible with OpenAI 1.78.0 #234

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
8000
drupol opened this issue May 8, 2025 · 1 comment · Fixed by #236
Closed

Incompatible with OpenAI 1.78.0 #234

drupol opened this issue May 8, 2025 · 1 comment · Fixed by #236

Comments

@drupol
Copy link
drupol commented May 8, 2025

Hello,

There is an incompatibility with OpenAI Python package 1.78.0:

============================= test session starts ==============================
platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0
rootdir: /build/source
configfile: setup.cfg
plugins: anyio-4.9.0
collected 226 items / 1 error / 30 deselected / 2 skipped / 196 selected       

==================================== ERRORS ====================================
____________ ERROR collecting posthog/test/ai/openai/test_openai.py ____________
posthog/test/ai/openai/test_openai.py:19: in <module>
    from posthog.ai.openai import OpenAI
posthog/ai/openai/__init__.py:1: in <module>
    from .openai import OpenAI
posthog/ai/openai/openai.py:38: in <module>
    class WrappedResponses(openai.resources.responses.Responses):
E   AttributeError: module 'openai.resources' has no attribute 'responses'
=============================== warnings summary ===============================
../../nix/store/094gpcj7d1z8wdvymhxvi2rns757vb2p-python3.12-pytest-8.3.5/lib/python3.12/site-packages/_pytest/config/__init__.py:1441
  /nix/store/094gpcj7d1z8wdvymhxvi2rns757vb2p-python3.12-pytest-8.3.5/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode
  
    self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
ERROR posthog/test/ai/openai/test_openai.py - AttributeError: module 'openai.resources' has no attribute 'responses'
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
============ 2 skipped, 30 deselected, 1 warning, 1 error in 0.96s =============
error: builder for '/nix/store/6l9j1q9010kxx4wwqy5wdkfhy4fyygik-python3.12-posthog-4.0.1.drv' failed with exit code 2;
       last 50 log lines:
       > Running phase: pythonOutputDistPhase
       > Executing pythonOutputDistPhase
       > Finished executing pythonOutputDistPhase
       > Running phase: fixupPhase
       > shrinking RPATHs of ELF executables and libraries in /nix/store/la3gyifb7y83pjc26xng1rasvvhv7k63-python3.12-posthog-4.0.1
       > checking for references to /build/ in /nix/store/la3gyifb7y83pjc26xng1rasvvhv7k63-python3.12-posthog-4.0.1...
       > patching script interpreter paths in /nix/store/la3gyifb7y83pjc26xng1rasvvhv7k63-python3.12-posthog-4.0.1
       > stripping (with command strip and flags -S -p) in  /nix/store/la3gyifb7y83pjc26xng1rasvvhv7k63-python3.12-posthog-4.0.1/lib
       > shrinking RPATHs of ELF executables and libraries in /nix/store/ynali8yz4xi32b8v1ahndxyawjvs363g-python3.12-posthog-4.0.1-dist
       > checking for references to /build/ in /nix/store/ynali8yz4xi32b8v1ahndxyawjvs363g-python3.12-posthog-4.0.1-dist...
       > patching script interpreter paths in /nix/store/ynali8yz4xi32b8v1ahndxyawjvs363g-python3.12-posthog-4.0.1-dist
       > Executing pythonRemoveTestsDir
       > Finished executing pythonRemoveTestsDir
       > Running phase: installCheckPhase
       > no Makefile or custom installCheckPhase, doing nothing
       > Running phase: pythonCatchConflictsPhase
       > Running phase: pythonRemoveBinBytecodePhase
       > Running phase: pythonImportsCheckPhase
       > Executing pythonImportsCheckPhase
       > Check whether the following modules can be imported: posthog
       > Running phase: pytestCheckPhase
       > Executing pytestCheckPhase
       > pytest flags: -m pytest -k not\ \(test_load_feature_flags_wrong_key\)\ and\ not\ \(test_excepthook\)\ and\ not\ \(test_request\)\ and\ not\ \(test_trying_to_use_django_integration\)\ and\ not\ \(test_upload\)\ and\ not\ \(test_flush_interval\)
       > ============================= test session starts ==============================
       > platform linux -- Python 3.12.10, pytest-8.3.5, pluggy-1.5.0
       > rootdir: /build/source
       > configfile: setup.cfg
       > plugins: anyio-4.9.0
       > collected 226 items / 1 error / 30 deselected / 2 skipped / 196 selected       
       >
       > ==================================== ERRORS ====================================
       > ____________ ERROR collecting posthog/test/ai/openai/test_openai.py ____________
       > posthog/test/ai/openai/test_openai.py:19: in <module>
       >     from posthog.ai.openai import OpenAI
       > posthog/ai/openai/__init__.py:1: in <module>
       >     from .openai import OpenAI
       > posthog/ai/openai/openai.py:38: in <module>
       >     class WrappedResponses(openai.resources.responses.Responses):
       > E   AttributeError: module 'openai.resources' has no attribute 'responses'
       > =============================== warnings summary ===============================
       > ../../nix/store/094gpcj7d1z8wdvymhxvi2rns757vb2p-python3.12-pytest-8.3.5/lib/python3.12/site-packages/_pytest/config/__init__.py:1441
       >   /nix/store/094gpcj7d1z8wdvymhxvi2rns757vb2p-python3.12-pytest-8.3.5/lib/python3.12/site-packages/_pytest/config/__init__.py:1441: PytestConfigWarning: Unknown config option: asyncio_mode
       >
       >     self._warn_or_fail_if_strict(f"Unknown config option: {key}\n")
       >
       > -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
       > =========================== short test summary info ============================
       > ERROR posthog/test/ai/openai/test_openai.py - AttributeError: module 'openai.resources' has no attribute 'responses'
       > !!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
       > ============ 2 skipped, 30 deselected, 1 warning, 1 error in 0.96s =============
       For full logs, run:
         nix log /nix/store/6l9j1q9010kxx4wwqy5wdkfhy4fyygik-python3.12-posthog-4.0.1.drv

The failing test has been removed from the Nix package at NixOS/nixpkgs#405374

@Twixes
Copy link
Member
Twixes commented May 14, 2025

Adding context from digging in a bit: the bug stems from this change in the OpenAI SDK

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 a pull request may close this issue.

2 participants
0