Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14","3.14t"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-misc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14","3.14t"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-integrations-web-2.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14","3.14t"]
# python3.6 reached EOL and is no longer being supported on
# new versions of hosted runners on Github Actions
# ubuntu-20.04 is the last version that supported python3.6
Expand Down
12 changes: 8 additions & 4 deletions scripts/populate_tox/tox.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ requires =
virtualenv<20.26.3
envlist =
# === Common ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common

# === Gevent ===
{py3.6,py3.8,py3.10,py3.11,py3.12}-gevent

# === Integrations ===

# Asgi
{py3.7,py3.12,py3.13,py3.14}-asgi
{py3.7,py3.12,py3.13,py3.14,py3.14t}-asgi

# AWS Lambda
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
Expand All @@ -38,7 +38,7 @@ envlist =
{py3.7}-gcp

# OpenTelemetry (OTel)
{py3.7,py3.9,py3.12,py3.13,py3.14}-opentelemetry
{py3.7,py3.9,py3.12,py3.13,py3.14,py3.14t}-opentelemetry

# OpenTelemetry Experimental (POTel)
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
Expand Down Expand Up @@ -74,7 +74,7 @@ deps =
# and https://github.com/pytest-dev/pytest-forked/issues/67
# for justification of the upper bound on pytest
{py3.6,py3.7}-common: pytest<7.0.0
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common: pytest
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common: pytest

# === Gevent ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
Expand Down Expand Up @@ -134,6 +134,9 @@ setenv =
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
COVERAGE_FILE=.coverage-sentry-{envname}
py3.6: COVERAGE_RCFILE=.coveragerc36
# Lowest version to support free-threading
# https://discuss.python.org/t/announcement-pip-24-1-release/56281
py3.14t: VIRTUALENV_PIP=24.1

django: DJANGO_SETTINGS_MODULE=tests.integrations.django.myapp.settings
spark-v{3.0.3,3.5.6}: JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-amd64
Expand Down Expand Up @@ -178,6 +181,7 @@ basepython =
py3.12: python3.12
py3.13: python3.13
py3.14: python3.14
py3.14t: python3.14t

# Python version is pinned here for consistency across environments.
# Tools like ruff and mypy have options that pin the target Python
Expand Down
12 changes: 10 additions & 2 deletions scripts/split_tox_gh_actions/split_tox_gh_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

TOXENV_REGEX = re.compile(
r"""
{?(?P<py_versions>(py\d+\.\d+,?)+)}?
{?(?P<py_versions>(py\d+\.\d+t?,?)+)}?
-(?P<framework>[a-z](?:[a-z_]|-(?!v{?\d))*[a-z0-9])
(?:-(
(v{?(?P<framework_versions>[0-9.]+[0-9a-z,.]*}?))
Expand Down Expand Up @@ -250,11 +250,19 @@ def find_frameworks_missing_from_groups(py_versions):
return all_frameworks - frameworks_in_a_group


def _version_key(v):
major_version, minor_version_and_suffix = v.split(".")
if minor_version_and_suffix.endswith("t"):
return int(major_version), int(minor_version_and_suffix.rstrip("t")), 1

return int(major_version), int(minor_version_and_suffix), 0


def _normalize_py_versions(py_versions):
def replace_and_sort(versions):
return sorted(
[py.replace("py", "") for py in versions],
key=lambda v: tuple(map(int, v.split("."))),
key=_version_key,
)

if isinstance(py_versions, dict):
Expand Down
14 changes: 10 additions & 4 deletions tests/integrations/threading/test_threading.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import gc
import sys
from concurrent import futures
from textwrap import dedent
from threading import Thread
Expand Down Expand Up @@ -68,7 +69,8 @@ def stage2():
assert exception["mechanism"]["type"] == "threading"
assert not exception["mechanism"]["handled"]

if propagate_hub:
# Free-threaded builds set thread_inherit_context to True, otherwise thread_inherit_context is False
if propagate_hub or getattr(sys.flags, "thread_inherit_context", None):
assert event["tags"]["stage1"] == "true"
else:
assert "stage1" not in event.get("tags", {})
Expand All @@ -94,7 +96,8 @@ def double(number):

sentry_sdk.flush()

if propagate_hub:
# Free-threaded builds set thread_inherit_context to True, otherwise thread_inherit_context is False
if propagate_hub or getattr(sys.flags, "thread_inherit_context", None):
assert len(events) == 1
(event,) = events
assert event["spans"][0]["trace_id"] == event["spans"][1]["trace_id"]
Expand Down Expand Up @@ -248,7 +251,9 @@ def do_some_work(number):
t.join()

(event,) = events
if propagate_scope:

# Free-threaded builds set thread_inherit_context to True, otherwise thread_inherit_context is False
if propagate_scope or getattr(sys.flags, "thread_inherit_context", None):
assert render_span_tree(event) == dedent(
"""\
- op="outer-trx": description=null
Expand Down Expand Up @@ -309,7 +314,8 @@ def do_some_work(number):

(event,) = events

if propagate_scope:
# Free-threaded builds set thread_inherit_context to True, otherwise thread_inherit_context is False
if propagate_scope or getattr(sys.flags, "thread_inherit_context", None):
assert render_span_tree(event) == dedent(
"""\
- op="outer-trx": description=null
Expand Down
12 changes: 8 additions & 4 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ requires =
virtualenv<20.26.3
envlist =
# === Common ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common

# === Gevent ===
{py3.6,py3.8,py3.10,py3.11,py3.12}-gevent

# === Integrations ===

# Asgi
{py3.7,py3.12,py3.13,py3.14}-asgi
{py3.7,py3.12,py3.13,py3.14,py3.14t}-asgi

# AWS Lambda
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
Expand All @@ -38,7 +38,7 @@ envlist =
{py3.7}-gcp

# OpenTelemetry (OTel)
{py3.7,py3.9,py3.12,py3.13,py3.14}-opentelemetry
{py3.7,py3.9,py3.12,py3.13,py3.14,py3.14t}-opentelemetry

# OpenTelemetry Experimental (POTel)
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
Expand Down Expand Up @@ -303,7 +303,7 @@ deps =
# and https://github.com/pytest-dev/pytest-forked/issues/67
# for justification of the upper bound on pytest
{py3.6,py3.7}-common: pytest<7.0.0
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common: pytest
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14,py3.14t}-common: pytest

# === Gevent ===
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
Expand Down Expand Up @@ -728,6 +728,9 @@ setenv =
OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
COVERAGE_FILE=.coverage-sentry-{envname}
py3.6: COVERAGE_RCFILE=.coveragerc36
# Lowest version to support free-threading
# https://discuss.python.org/t/announcement-pip-24-1-release/56281
py3.14t: VIRTUALENV_PIP=24.1

django: DJANGO_SETTINGS_MODULE=tests.integrations.django.myapp.settings
spark-v{3.0.3,3.5.6}: JAVA_HOME=/usr/lib/jvm/temurin-11-jdk-amd64
Expand Down Expand Up @@ -824,6 +827,7 @@ basepython =
py3.12: python3.12
py3.13: python3.13
py3.14: python3.14
py3.14t: python3.14t

# Python version is pinned here for consistency across environments.
# Tools like ruff and mypy have options that pin the target Python
Expand Down