| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
…re modules Introduce _compat.py, which resolves the installed pydantic-ai version and every version-dependent decision once at import time: the hooks-vs-graph-nodes model backend, the ToolManager tool-call method name, and the message part classes (now resolved individually so one upstream rename degrades only the paths needing that class). The using_request_hooks class flag and the circular-import workarounds are gone; setup_once is three composed calls with deferred imports, and importing the package loads nothing but __init__. Restructure to the target layout: _spans.py absorbs utils.py and the spans/ package, _wrap_agent.py and _wrap_model.py (both model backends behind one install_model_backend()) and _wrap_tools.py (the two duplicated tool wrappers unified into one) replace patches/. Review-driven fixes folded in: unknown ToolManager method names and a missing _agent_graph module now degrade gracefully instead of crashing sentry_sdk.init(), agent_run_scope removes exactly its own run from the stack so non-LIFO streaming exits cannot corrupt it, the streaming wrapper propagates exception suppression from the wrapped context manager, the after_model_request span close is guarded, and chat spans extract model info once instead of twice.
Codecov Results 📊✅ 112394 passed | ❌ 10 failed | ⏭️ 6755 skipped | Total: 119159 | Pass Rate: 94.32% | Execution Time: 405m 58s 📊 Comparison with Base Branch
➕ New Tests (10)View new tests
❌ Failed Teststest_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
/usr/lib/python3.10/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1050: in _gcd_import
???
<frozen importlib._bootstrap>:1027: in _find_and_load
???
<frozen importlib._bootstrap>:1006: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:688: in _load_unlocked
???
<frozen importlib._bootstrap_external>:883: in exec_module
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
E Failed: DID NOT RAISE DidNotEnable
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.11.15-linux-x86_64-gnu/lib/python3.11/importlib/__init__.py:126: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1204: in _gcd_import
???
<frozen importlib._bootstrap>:1176: in _find_and_load
???
<frozen importlib._bootstrap>:1147: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:690: in _load_unlocked
???
<frozen importlib._bootstrap_external>:940: in exec_module
???
<frozen importlib._bootstrap>:241: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
E Failed: DID NOT RAISE DidNotEnable
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.12.13-linux-x86_64-gnu/lib/python3.12/importlib/__init__.py:90: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1387: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
<frozen importlib._bootstrap_external>:999: in exec_module
???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE DidNotEnable
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.13.14-linux-x86_64-gnu/lib/python3.13/importlib/__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1395: in _gcd_import
???
<frozen importlib._bootstrap>:1360: in _find_and_load
???
<frozen importlib._bootstrap>:1331: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:935: in _load_unlocked
???
<frozen importlib._bootstrap_external>:1023: in exec_module
???
<frozen importlib._bootstrap>:488: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE DidNotEnable
test_span_streaming_quart_auth_user_id_data_collection[dc_user_info_true]File: tests.integrations.quart.test_quart tests/integrations/quart/test_quart.py:1223: in test_span_streaming_quart_auth_user_id_data_collection
assert segment["attributes"]["user.id"] == "42"
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E KeyError: 'user.id'
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.14.7-linux-x86_64-gnu/lib/python3.14/importlib/__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1406: in _gcd_import
???
<frozen importlib._bootstrap>:1371: in _find_and_load
???
<frozen importlib._bootstrap>:1342: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:938: in _load_unlocked
???
<frozen importlib._bootstrap_external>:759: in exec_module
???
<frozen importlib._bootstrap>:491: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE DidNotEnable
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
^^^^^^^^^^^^^^^^^^
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.14.6+freethreaded-linux-x86_64-gnu/lib/python3.14t/importlib/__init__.py:88: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
<frozen importlib._bootstrap>:1406: in _gcd_import
???
<frozen importlib._bootstrap>:1371: in _find_and_load
???
<frozen importlib._bootstrap>:1342: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:938: in _load_unlocked
???
<frozen importlib._bootstrap_external>:759: in exec_module
???
<frozen importlib._bootstrap>:491: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:103: in test_shadowed_modules_when_importing_integrations
with pytest.raises(integrations.DidNotEnable):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E Failed: DID NOT RAISE DidNotEnable
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
/usr/local/lib/python3.7/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1006: in _gcd_import
???
<frozen importlib._bootstrap>:983: in _find_and_load
???
<frozen importlib._bootstrap>:967: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:677: in _load_unlocked
???
<frozen importlib._bootstrap_external>:728: in exec_module
???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:104: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
E Failed: DID NOT RAISE <class 'sentry_sdk.integrations.DidNotEnable'>
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.8-linux-x86_64-gnu/lib/python3.8/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1014: in _gcd_import
???
<frozen importlib._bootstrap>:991: in _find_and_load
???
<frozen importlib._bootstrap>:975: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:671: in _load_unlocked
???
<frozen importlib._bootstrap_external>:843: in exec_module
???
<frozen importlib._bootstrap>:219: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:104: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
E Failed: DID NOT RAISE <class 'sentry_sdk.integrations.DidNotEnable'>
test_shadowed_modules_when_importing_integrations[pydantic_ai]File: tests.test_shadowed_module sentry_sdk/integrations/pydantic_ai/__init__.py:4: in <module>
import pydantic_ai # noqa: F401
E ModuleNotFoundError: No module named 'pydantic_ai'
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:86: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
../../_temp/uv-python-dir/cpython-3.9-linux-x86_64-gnu/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
<frozen importlib._bootstrap>:1030: in _gcd_import
???
<frozen importlib._bootstrap>:1007: in _find_and_load
???
<frozen importlib._bootstrap>:986: in _find_and_load_unlocked
???
<frozen importlib._bootstrap>:680: in _load_unlocked
???
<frozen importlib._bootstrap_external>:850: in exec_module
???
<frozen importlib._bootstrap>:228: in _call_with_frames_removed
???
sentry_sdk/integrations/pydantic_ai/__init__.py:6: in <module>
raise DidNotEnable("pydantic-ai not installed")
E sentry_sdk.integrations.DidNotEnable: pydantic-ai not installed
During handling of the above exception, another exception occurred:
tests/test_shadowed_module.py:104: in test_shadowed_modules_when_importing_integrations
importlib.import_module(module_path)
E Failed: DID NOT RAISE <class 'sentry_sdk.integrations.DidNotEnable'>
✅ Patch coverage is 92.37%. Project has 2462 uncovered lines.
@@ Coverage Diff @@
## main #PR +/-##
==========================================
+ Coverage 90.23% 90.28% +0.05%
==========================================
Files 193 190 -3
Lines 25361 25323 -38
Branches 9302 9280 -22
==========================================
+ Hits 22883 22861 -22
- Misses 2478 2462 -16
- Partials 1432 1425 -7Generated by Codecov Action |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Description
Issues
Reminders
Stack created with GitHub Stacks CLI • Give Feedback 💬