From 9acc6f556f5309a1306cdd2cac612bcaa33e8ab1 Mon Sep 17 00:00:00 2001 From: Bradley Reynolds Date: Mon, 13 Mar 2023 12:56:02 -0500 Subject: [PATCH] Update Sentry SDK to support Falcon 3 Signed-off-by: Bradley Reynolds --- pyproject.toml | 3 +-- requirements/coverage.pip | 6 +++--- requirements/lint.pip | 16 +++++++--------- requirements/pip-tools.pip | 22 ++++++++-------------- requirements/requirements.pip | 20 ++++++++++---------- snekbox/utils/logging.py | 16 +++++----------- 6 files changed, 34 insertions(+), 49 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index a1d1ea14..a0ccf8ae 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -25,7 +25,6 @@ dynamic = ["version"] requires-python = ">=3.11" dependencies = [ - # Sentry's Falcon integration relies on api_helpers (falconry/falcon#1902). "falcon>=3.0.1", "jsonschema>=4.0", "protobuf>=3.19", @@ -33,7 +32,7 @@ dependencies = [ [project.optional-dependencies] gunicorn = ["gunicorn>=20.1"] # Lowest which supports wsgi_app in config. -sentry = ["sentry-sdk[falcon]>=1.5.4"] +sentry = ["sentry-sdk[falcon]>=1.16.0"] # Minimum of 1.16.0 required for Falcon 3.0 support (getsentry/sentry-python#1733) [project.urls] source = "https://github.com/python-discord/snekbox" diff --git a/requirements/coverage.pip b/requirements/coverage.pip index e28a87ed..5deedc33 100644 --- a/requirements/coverage.pip +++ b/requirements/coverage.pip @@ -1,8 +1,8 @@ # -# This file is autogenerated by pip-compile with python 3.11 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile --output-file=requirements/coverage.pip requirements/coverage.in # -coverage[toml]==6.5.0 +coverage[toml]==7.2.1 # via -r requirements/coverage.in diff --git a/requirements/lint.pip b/requirements/lint.pip index e477369c..7790d452 100644 --- a/requirements/lint.pip +++ b/requirements/lint.pip @@ -1,6 +1,6 @@ # -# This file is autogenerated by pip-compile with python 3.11 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile --output-file=requirements/lint.pip requirements/lint.in # @@ -8,21 +8,19 @@ cfgv==3.3.1 # via pre-commit distlib==0.3.6 # via virtualenv -filelock==3.8.0 +filelock==3.9.0 # via virtualenv -identify==2.5.8 +identify==2.5.20 # via pre-commit nodeenv==1.7.0 # via pre-commit -platformdirs==2.5.2 +platformdirs==3.1.1 # via virtualenv -pre-commit==2.20.0 +pre-commit==3.1.1 # via -r requirements/lint.in pyyaml==6.0 # via pre-commit -toml==0.10.2 - # via pre-commit -virtualenv==20.16.6 +virtualenv==20.21.0 # via pre-commit # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip-tools.pip b/requirements/pip-tools.pip index 55bc0df6..d87f3d6b 100644 --- a/requirements/pip-tools.pip +++ b/requirements/pip-tools.pip @@ -1,26 +1,20 @@ # -# This file is autogenerated by pip-compile with python 3.11 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile --output-file=requirements/pip-tools.pip requirements/pip-tools.in # -build==0.9.0 +build==0.10.0 # via pip-tools click==8.1.3 # via pip-tools -colorama==0.4.6 - # via - # build - # click -packaging==21.3 +packaging==23.0 # via build -pep517==0.13.0 - # via build -pip-tools==6.9.0 +pip-tools==6.12.3 # via -r requirements/pip-tools.in -pyparsing==3.0.9 - # via packaging -wheel==0.37.1 +pyproject-hooks==1.0.0 + # via build +wheel==0.38.4 # via pip-tools # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/requirements.pip b/requirements/requirements.pip index afa77469..310685ed 100644 --- a/requirements/requirements.pip +++ b/requirements/requirements.pip @@ -1,28 +1,28 @@ # -# This file is autogenerated by pip-compile with python 3.11 -# To update, run: +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: # # pip-compile --extra=gunicorn --extra=sentry --output-file=requirements/requirements.pip pyproject.toml # -attrs==22.1.0 +attrs==22.2.0 # via jsonschema -certifi==2022.9.24 +certifi==2022.12.7 # via sentry-sdk -falcon==3.1.0 +falcon==3.1.1 # via # sentry-sdk # snekbox (pyproject.toml) gunicorn==20.1.0 # via snekbox (pyproject.toml) -jsonschema==4.16.0 +jsonschema==4.17.3 # via snekbox (pyproject.toml) -protobuf==4.21.9 +protobuf==4.22.1 # via snekbox (pyproject.toml) -pyrsistent==0.19.1 +pyrsistent==0.19.3 # via jsonschema -sentry-sdk[falcon]==1.10.1 +sentry-sdk[falcon]==1.16.0 # via snekbox (pyproject.toml) -urllib3==1.26.12 +urllib3==1.26.15 # via sentry-sdk # The following packages are considered to be unsafe in a requirements file: diff --git a/snekbox/utils/logging.py b/snekbox/utils/logging.py index 0bbc5e3c..00820133 100644 --- a/snekbox/utils/logging.py +++ b/snekbox/utils/logging.py @@ -1,9 +1,6 @@ import logging import os import sys -import warnings - -from falcon.util.deprecation import DeprecatedWarning __all__ = ("FORMAT", "init_logger", "init_sentry") @@ -24,14 +21,11 @@ def init_logger(debug: bool) -> None: def init_sentry(version: str) -> None: """Initialise the Sentry SDK if it's installed.""" - with warnings.catch_warnings(): - warnings.filterwarnings("ignore", message=r".*\bapi_helpers\b", category=DeprecatedWarning) - - try: - import sentry_sdk - from sentry_sdk.integrations.falcon import FalconIntegration - except ImportError: - return + try: + import sentry_sdk + from sentry_sdk.integrations.falcon import FalconIntegration + except ImportError: + return sentry_sdk.init( dsn=os.environ.get("SNEKBOX_SENTRY_DSN", ""),