From 6169e233ed5ba6e0420e6f71a8a2554bef5ab753 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 10:10:50 +0200 Subject: [PATCH 01/10] ci: Remove httpcore from requirements-testing.txt --- requirements-testing.txt | 1 - scripts/populate_tox/tox.jinja | 2 +- tox.ini | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/requirements-testing.txt b/requirements-testing.txt index a6041972cd..acb3d4d700 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -12,7 +12,6 @@ asttokens responses pysocks socksio -httpcore[http2] setuptools Brotli docker diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index 40426d30fb..75528f0712 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -80,7 +80,7 @@ deps = # === Common === py3.8-common: hypothesis common: pytest-asyncio - common: httpcore[asyncio] + common: httpcore[asyncio,http2] # See https://github.com/pytest-dev/pytest/issues/9621 # and https://github.com/pytest-dev/pytest-forked/issues/67 # for justification of the upper bound on pytest diff --git a/tox.ini b/tox.ini index e91115d32e..d1b3cfd059 100644 --- a/tox.ini +++ b/tox.ini @@ -403,7 +403,7 @@ deps = # === Common === py3.8-common: hypothesis common: pytest-asyncio - common: httpcore[asyncio] + common: httpcore[asyncio,http2] # See https://github.com/pytest-dev/pytest/issues/9621 # and https://github.com/pytest-dev/pytest-forked/issues/67 # for justification of the upper bound on pytest From c039b85387b07c2ec18d4bcdf409b226f0241e5a Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 11:25:45 +0200 Subject: [PATCH 02/10] . --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index df838ab0f2..deb9aaefbb 100644 --- a/setup.py +++ b/setup.py @@ -42,6 +42,7 @@ def get_file_text(file_name): install_requires=[ "urllib3>=1.26.11", "certifi", + "aiocontextvars; python_version < '3.7'", ], extras_require={ "aiohttp": ["aiohttp>=3.5"], From 8a42b79c5b08c41570a8f24084d9e735fb62df98 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 11:42:44 +0200 Subject: [PATCH 03/10] . --- scripts/populate_tox/tox.jinja | 1 + tox.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index 75528f0712..aa2ba4b2e9 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -97,6 +97,7 @@ deps = # for justification of the upper bound on pytest {py3.6,py3.7}-gevent: pytest<7.0.0 {py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest + gevent: httpcore[http2] gevent: pytest-asyncio gevent: setuptools<82 {py3.10,py3.11}-gevent: zope.event<5.0.0 diff --git a/tox.ini b/tox.ini index d1b3cfd059..dcafbafa29 100644 --- a/tox.ini +++ b/tox.ini @@ -420,6 +420,7 @@ deps = # for justification of the upper bound on pytest {py3.6,py3.7}-gevent: pytest<7.0.0 {py3.8,py3.9,py3.10,py3.11,py3.12}-gevent: pytest + gevent: httpcore[http2] gevent: pytest-asyncio gevent: setuptools<82 {py3.10,py3.11}-gevent: zope.event<5.0.0 From f5e293cdd2a9a37ccafbb6a49649de09ef0d91c4 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 13:22:00 +0200 Subject: [PATCH 04/10] . --- scripts/populate_tox/config.py | 1 + scripts/populate_tox/tox.jinja | 2 ++ tox.ini | 3 +++ 3 files changed, 6 insertions(+) diff --git a/scripts/populate_tox/config.py b/scripts/populate_tox/config.py index 317afa53ca..eba5c32bde 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -117,6 +117,7 @@ "Werkzeug<2.1.0", ], "<3.1": ["pytest-django<4.0"], + "py3.6": ["dataclasses"], "py3.14,py3.14t": ["coverage==7.11.0"], }, }, diff --git a/scripts/populate_tox/tox.jinja b/scripts/populate_tox/tox.jinja index aa2ba4b2e9..d3d88dbb48 100644 --- a/scripts/populate_tox/tox.jinja +++ b/scripts/populate_tox/tox.jinja @@ -78,6 +78,7 @@ deps = -r requirements-testing.txt # === Common === + py3.6-common: dataclasses py3.8-common: hypothesis common: pytest-asyncio common: httpcore[asyncio,http2] @@ -90,6 +91,7 @@ deps = {py3.14,py3.14t}-common: coverage==7.11.0 # === Gevent === + py3.6-gevent: dataclasses {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0 {py3.12}-gevent: gevent # See https://github.com/pytest-dev/pytest/issues/9621 diff --git a/tox.ini b/tox.ini index dcafbafa29..56d39d84de 100644 --- a/tox.ini +++ b/tox.ini @@ -401,6 +401,7 @@ deps = -r requirements-testing.txt # === Common === + py3.6-common: dataclasses py3.8-common: hypothesis common: pytest-asyncio common: httpcore[asyncio,http2] @@ -413,6 +414,7 @@ deps = {py3.14,py3.14t}-common: coverage==7.11.0 # === Gevent === + py3.6-gevent: dataclasses {py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0 {py3.12}-gevent: gevent # See https://github.com/pytest-dev/pytest/issues/9621 @@ -12219,6 +12221,7 @@ deps = django-v3.2.25: Werkzeug<2.1.0 django-v1.11.29: pytest-django<4.0 django-v2.2.28: pytest-django<4.0 + {py3.6}-django: dataclasses {py3.14,py3.14t}-django: coverage==7.11.0 django-latest: channels[daphne] django-latest: pytest-asyncio From 9d76794fda194b0a316858a435b80b75e4e3ad34 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 13:25:22 +0200 Subject: [PATCH 05/10] . --- scripts/populate_tox/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/populate_tox/config.py b/scripts/populate_tox/config.py index eba5c32bde..1aa3783b29 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -513,6 +513,7 @@ "deps": { "*": ["werkzeug"], "<=5.0": ["werkzeug<1.0"], + "py3.6": ["dataclasses"], }, }, "typer": { From 7916689507373af00e3fcc46b994939f64756aaa Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 13:28:35 +0200 Subject: [PATCH 06/10] . --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 56d39d84de..7bf1b99649 100644 --- a/tox.ini +++ b/tox.ini @@ -14136,6 +14136,7 @@ deps = trytond: werkzeug trytond-v4.6.22: werkzeug<1.0 trytond-v4.8.18: werkzeug<1.0 + {py3.6}-trytond: dataclasses typer-v0.15.4: typer==0.15.4 From 6f32ae3429a6afc2e78033ee6eee42240670833b Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 14:19:57 +0200 Subject: [PATCH 07/10] . --- scripts/populate_tox/config.py | 2 +- tox.ini | 9 +-------- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/scripts/populate_tox/config.py b/scripts/populate_tox/config.py index 1aa3783b29..e77454a8ce 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -108,8 +108,8 @@ "djangorestframework", "pytest-django", "Werkzeug", + "channels[daphne]", ], - ">=2.0": ["channels[daphne]"], ">=2.2,<3.1": ["six"], ">=3.0": ["pytest-asyncio"], "<3.3": [ diff --git a/tox.ini b/tox.ini index 7bf1b99649..69fe313e84 100644 --- a/tox.ini +++ b/tox.ini @@ -12182,7 +12182,6 @@ deps = django-latest: django==6.0.6 - django-latest: channels[daphne] django-latest: pytest-asyncio py3.12-django-latest: asgiref==3.11.1 @@ -12201,12 +12200,7 @@ deps = django: djangorestframework django: pytest-django django: Werkzeug - django-v2.2.28: channels[daphne] - django-v3.2.25: channels[daphne] - django-v4.2.30: channels[daphne] - django-v5.2.15: channels[daphne] - django-v6.0.6: channels[daphne] - django-v6.1a1: channels[daphne] + django: channels[daphne] django-v2.2.28: six django-v3.2.25: pytest-asyncio django-v4.2.30: pytest-asyncio @@ -12223,7 +12217,6 @@ deps = django-v2.2.28: pytest-django<4.0 {py3.6}-django: dataclasses {py3.14,py3.14t}-django: coverage==7.11.0 - django-latest: channels[daphne] django-latest: pytest-asyncio flask-v1.1.4: flask==1.1.4 From 45fbf9017508a5e40bef7564bf43b09fe0c444b6 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 14:32:11 +0200 Subject: [PATCH 08/10] . --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index deb9aaefbb..df838ab0f2 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,6 @@ def get_file_text(file_name): install_requires=[ "urllib3>=1.26.11", "certifi", - "aiocontextvars; python_version < '3.7'", ], extras_require={ "aiohttp": ["aiohttp>=3.5"], From fdb2bb3b6ce34440441265be2e48d10979adcacb Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 14:42:56 +0200 Subject: [PATCH 09/10] . --- sentry_sdk/utils.py | 43 ++++++++++++++++++++----------------------- 1 file changed, 20 insertions(+), 23 deletions(-) diff --git a/sentry_sdk/utils.py b/sentry_sdk/utils.py index 875d28c0d0..f6d9b66b9c 100644 --- a/sentry_sdk/utils.py +++ b/sentry_sdk/utils.py @@ -1,5 +1,4 @@ import base64 -import contextvars import copy import json import linecache @@ -84,28 +83,6 @@ _installed_modules = None -_is_sentry_internal_task = contextvars.ContextVar( - "is_sentry_internal_task", default=False -) - -# These exceptions won't set the span status to error if they occur. Use -# register_control_flow_exception to add to this list -_control_flow_exception_classes: "set[type]" = set() - - -def is_internal_task() -> bool: - return _is_sentry_internal_task.get() - - -@contextmanager -def mark_sentry_task_internal() -> "Generator[None, None, None]": - """Context manager to mark a task as Sentry internal.""" - token = _is_sentry_internal_task.set(True) - try: - yield - finally: - _is_sentry_internal_task.reset(token) - BASE64_ALPHABET = re.compile(r"^[a-zA-Z0-9/+=]*$") @@ -1468,6 +1445,26 @@ def _get_contextvars() -> "Tuple[bool, type]": Please refer to https://docs.sentry.io/platforms/python/contextvars/ for more information. """ +_is_sentry_internal_task = ContextVar("is_sentry_internal_task", default=False) + +# These exceptions won't set the span status to error if they occur. Use +# register_control_flow_exception to add to this list +_control_flow_exception_classes: "set[type]" = set() + + +def is_internal_task() -> bool: + return _is_sentry_internal_task.get() + + +@contextmanager +def mark_sentry_task_internal() -> "Generator[None, None, None]": + """Context manager to mark a task as Sentry internal.""" + token = _is_sentry_internal_task.set(True) + try: + yield + finally: + _is_sentry_internal_task.reset(token) + def qualname_from_function(func: "Callable[..., Any]") -> "Optional[str]": """Return the qualified name of func. Works with regular function, lambda, partial and partialmethod.""" From fe935993c3ac0ea4ff458e1cb7613189e5fca316 Mon Sep 17 00:00:00 2001 From: Alexander Alderman Webb Date: Mon, 22 Jun 2026 15:02:05 +0200 Subject: [PATCH 10/10] . --- scripts/populate_tox/config.py | 1 + tox.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/scripts/populate_tox/config.py b/scripts/populate_tox/config.py index e77454a8ce..a8b9174b24 100644 --- a/scripts/populate_tox/config.py +++ b/scripts/populate_tox/config.py @@ -163,6 +163,7 @@ "itsdangerous>=0.24,<2.0", "jinja2<3.1.1", ], + "py3.6": ["dataclasses"], }, }, "gql": { diff --git a/tox.ini b/tox.ini index 69fe313e84..30d608ff56 100644 --- a/tox.ini +++ b/tox.ini @@ -12330,6 +12330,7 @@ deps = flask-v1.1.4: markupsafe<2.0.0 flask-v1.1.4: itsdangerous>=0.24,<2.0 flask-v1.1.4: jinja2<3.1.1 + {py3.6}-flask: dataclasses starlette-v0.16.0: starlette==0.16.0