From ac1d35e26936bceb12d157e9bcc88589a7b38b7b Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Tue, 11 Apr 2023 15:41:31 +0200 Subject: [PATCH 1/2] Fixed support for Quart --- sentry_sdk/integrations/quart.py | 4 ++-- test-requirements.txt | 1 - tox.ini | 16 ++++++++++------ 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/sentry_sdk/integrations/quart.py b/sentry_sdk/integrations/quart.py index 2256ca4cc1..ea874ed37c 100644 --- a/sentry_sdk/integrations/quart.py +++ b/sentry_sdk/integrations/quart.py @@ -151,7 +151,7 @@ def _set_transaction_name_and_source(scope, transaction_style, request): pass -def _request_websocket_started(app, **kwargs): +async def _request_websocket_started(app, **kwargs): # type: (Quart, **Any) -> None hub = Hub.current integration = hub.get_integration(QuartIntegration) @@ -205,7 +205,7 @@ def inner(event, hint): return inner -def _capture_exception(sender, exception, **kwargs): +async def _capture_exception(sender, exception, **kwargs): # type: (Quart, Union[ValueError, BaseException], **Any) -> None hub = Hub.current if hub.get_integration(QuartIntegration) is None: diff --git a/test-requirements.txt b/test-requirements.txt index 5d449df716..a70bd769d1 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -6,7 +6,6 @@ pytest-forked<=1.4.0 pytest-localserver==0.5.0 pytest-watch==4.2.0 tox==3.7.0 -Werkzeug<2.1.0 jsonschema==3.2.0 pyrsistent==0.16.0 # TODO(py3): 0.17.0 requires python3, see https://github.com/tobgu/pyrsistent/issues/205 executing diff --git a/tox.ini b/tox.ini index bc522578f0..acbdecaff3 100644 --- a/tox.ini +++ b/tox.ini @@ -114,7 +114,7 @@ envlist = {py2.7,py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-pyramid-v{1.6,1.7,1.8,1.9,1.10} # Quart - {py3.7,py3.8,py3.9,py3.10,py3.11}-quart + {py3.7,py3.8,py3.9,py3.10,py3.11}-quart-v{0.16,0.17,0.18} # Redis {py2.7,py3.7,py3.8,py3.9}-redis @@ -336,10 +336,15 @@ deps = pyramid-v1.10: pyramid>=1.10,<1.11 # Quart - quart: blinker<1.6 - quart: quart>=0.16.1 quart: quart-auth quart: pytest-asyncio + quart-v0.16: blinker<1.6 + quart-v0.16: jinja2<3.1.0 + quart-v0.16: Werkzeug<2.1.0 + quart-v0.17: blinker<1.6 + quart-v0.16: quart>=0.16.1,<0.17.0 + quart-v0.17: quart>=0.17.0,<0.18.0 + quart-v0.18: quart>=0.18.0,<0.19.0 # Requests requests: requests>=2.0 @@ -474,7 +479,6 @@ extras = falcon: falcon flask: flask pymongo: pymongo - quart: quart basepython = py2.7: python2.7 @@ -510,8 +514,8 @@ commands = ; when loading tests in scenarios. In particular, django fails to ; load the settings from the test module. - {py2.7}: python -m pytest --ignore-glob='*py3.py' --durations=5 -vvv {env:TESTPATH} {posargs} - {py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}: python -m pytest -rsx --durations=5 -vvv {env:TESTPATH} {posargs} + {py2.7}: python -m pytest --ignore-glob='*py3.py' -rsx -s --durations=5 -vvv {env:TESTPATH} {posargs} + {py3.5,py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}: python -m pytest -rsx -s --durations=5 -vvv {env:TESTPATH} {posargs} [testenv:linters] commands = From 8cf07cce87ab563de98bedc70b9592f7b50af27b Mon Sep 17 00:00:00 2001 From: Anton Pirker Date: Tue, 11 Apr 2023 15:54:29 +0200 Subject: [PATCH 2/2] fixing dependencies --- tox.ini | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tox.ini b/tox.ini index acbdecaff3..8067558517 100644 --- a/tox.ini +++ b/tox.ini @@ -206,6 +206,7 @@ deps = boto3-v1.16: boto3>=1.16,<1.17 # Bottle + bottle: Werkzeug<2.1.0 bottle-v0.12: bottle>=0.12,<0.13 # Celery @@ -235,6 +236,7 @@ deps = chalice: pytest-chalice==0.0.5 # Django + django: Werkzeug<2.1.0 django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: djangorestframework>=3.0.0,<4.0.0 {py3.7,py3.8,py3.9,py3.10,py3.11}-django-v{1.11,2.0,2.1,2.2,3.0,3.1,3.2}: channels[daphne]>2 @@ -278,6 +280,7 @@ deps = # Flask flask: flask-login + flask: Werkzeug<2.1.0 flask-v0.11: Flask>=0.11,<0.12 flask-v0.12: Flask>=0.12,<0.13 flask-v1.0: Flask>=1.0,<1.1 @@ -329,6 +332,7 @@ deps = pymongo-v4.2: pymongo>=4.2,<4.3 # Pyramid + pyramid: Werkzeug<2.1.0 pyramid-v1.6: pyramid>=1.6,<1.7 pyramid-v1.7: pyramid>=1.7,<1.8 pyramid-v1.8: pyramid>=1.8,<1.9