Skip to content

Commit

Permalink
chore: Fix CI failures (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
untitaker authored Apr 29, 2021
1 parent 927903e commit d7cf16c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 2 additions & 1 deletion sentry_sdk/integrations/django/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,9 @@ def _before_get_response(request):
# Rely on WSGI middleware to start a trace
try:
if integration.transaction_style == "function_name":
fn = resolve(request.path).func
scope.transaction = transaction_from_function(
resolve(request.path).func
getattr(fn, "view_class", fn)
)
elif integration.transaction_style == "url":
scope.transaction = LEGACY_RESOLVER.resolve(request.path_info)
Expand Down
12 changes: 8 additions & 4 deletions sentry_sdk/integrations/flask.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,17 @@ def __init__(self, transaction_style="endpoint"):
@staticmethod
def setup_once():
# type: () -> None

# This version parsing is absolutely naive but the alternative is to
# import pkg_resources which slows down the SDK a lot.
try:
version = tuple(map(int, FLASK_VERSION.split(".")[:3]))
except (ValueError, TypeError):
raise DidNotEnable("Unparsable Flask version: {}".format(FLASK_VERSION))

if version < (0, 10):
raise DidNotEnable("Flask 0.10 or newer is required.")
# It's probably a release candidate, we assume it's fine.
pass
else:
if version < (0, 10):
raise DidNotEnable("Flask 0.10 or newer is required.")

request_started.connect(_request_started)
got_request_exception.connect(_capture_exception)
Expand Down
4 changes: 0 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ envlist =

{py2.7,py3.7,py3.8,py3.9}-sqlalchemy-{1.2,1.3}

py3.7-spark

{py3.5,py3.6,py3.7,py3.8,py3.9}-pure_eval

Expand Down Expand Up @@ -215,8 +214,6 @@ deps =
sqlalchemy-1.2: sqlalchemy>=1.2,<1.3
sqlalchemy-1.3: sqlalchemy>=1.3,<1.4

spark: pyspark==2.4.4

linters: -r linter-requirements.txt

py3.8: hypothesis
Expand Down Expand Up @@ -260,7 +257,6 @@ setenv =
rediscluster: TESTPATH=tests/integrations/rediscluster
asgi: TESTPATH=tests/integrations/asgi
sqlalchemy: TESTPATH=tests/integrations/sqlalchemy
spark: TESTPATH=tests/integrations/spark
pure_eval: TESTPATH=tests/integrations/pure_eval
chalice: TESTPATH=tests/integrations/chalice
boto3: TESTPATH=tests/integrations/boto3
Expand Down

0 comments on commit d7cf16c

Please sign in to comment.