Skip to content

Commit a956be6

Browse files
ci: Run common test suite on Python 3.14 (#4896)
### Description Python 3.14 is out, test `common` on it. #### Issues Closes #4909 #### Reminders - Please add tests to validate your changes, and lint your code using `tox -e linters`. - Add GH Issue ID _&_ Linear ID (if applicable) - PR title should use [conventional commit](https://develop.sentry.dev/engineering-practices/commit-messages/#type) style (`feat:`, `fix:`, `ref:`, `meta:`) - For external contributors: [CONTRIBUTING.md](https://github.com/getsentry/sentry-python/blob/master/CONTRIBUTING.md), [Sentry SDK development docs](https://develop.sentry.dev/sdk/), [Discord community](https://discord.gg/Ww9hbqr) --------- Co-authored-by: Alex Alderman Webb <alexander.webb@sentry.io>
1 parent 6e92aa4 commit a956be6

File tree

7 files changed

+63
-59
lines changed

7 files changed

+63
-59
lines changed

.github/workflows/test-integrations-common.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13"]
32+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integrations-misc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13"]
32+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6

.github/workflows/test-integrations-web-2.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
strategy:
3030
fail-fast: false
3131
matrix:
32-
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13"]
32+
python-version: ["3.6","3.7","3.8","3.9","3.10","3.11","3.12","3.13","3.14"]
3333
# python3.6 reached EOL and is no longer being supported on
3434
# new versions of hosted runners on Github Actions
3535
# ubuntu-20.04 is the last version that supported python3.6

scripts/populate_tox/tox.jinja

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ requires =
1818
virtualenv<20.26.3
1919
envlist =
2020
# === Common ===
21-
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-common
21+
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common
2222

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

2626
# === Integrations ===
2727

2828
# Asgi
29-
{py3.7,py3.12,py3.13}-asgi
29+
{py3.7,py3.12,py3.13,py3.14}-asgi
3030

3131
# AWS Lambda
3232
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
@@ -38,7 +38,7 @@ envlist =
3838
{py3.7}-gcp
3939

4040
# OpenTelemetry (OTel)
41-
{py3.7,py3.9,py3.12,py3.13}-opentelemetry
41+
{py3.7,py3.9,py3.12,py3.13,py3.14}-opentelemetry
4242

4343
# OpenTelemetry Experimental (POTel)
4444
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
@@ -74,7 +74,7 @@ deps =
7474
# and https://github.com/pytest-dev/pytest-forked/issues/67
7575
# for justification of the upper bound on pytest
7676
{py3.6,py3.7}-common: pytest<7.0.0
77-
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-common: pytest
77+
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common: pytest
7878
7979
# === Gevent ===
8080
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
@@ -177,6 +177,7 @@ basepython =
177177
py3.11: python3.11
178178
py3.12: python3.12
179179
py3.13: python3.13
180+
py3.14: python3.14
180181
181182
# Python version is pinned here for consistency across environments.
182183
# Tools like ruff and mypy have options that pin the target Python

tests/conftest.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,6 @@
5757
with open(SENTRY_EVENT_SCHEMA) as f:
5858
SENTRY_EVENT_SCHEMA = json.load(f)
5959

60-
try:
61-
import pytest_benchmark
62-
except ImportError:
63-
64-
@pytest.fixture
65-
def benchmark():
66-
return lambda x: x()
67-
68-
else:
69-
del pytest_benchmark
70-
7160

7261
from sentry_sdk import scope
7362

tests/test_client.py

Lines changed: 50 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -751,66 +751,79 @@ def test_cyclic_data(sentry_init, capture_events):
751751
assert data == {"not_cyclic2": "", "not_cyclic": "", "is_cyclic": "<cyclic>"}
752752

753753

754-
def test_databag_depth_stripping(sentry_init, capture_events, benchmark):
754+
def test_databag_depth_stripping(sentry_init, capture_events):
755755
sentry_init()
756756
events = capture_events()
757757

758758
value = ["a"]
759759
for _ in range(100000):
760760
value = [value]
761761

762-
@benchmark
763-
def inner():
764-
del events[:]
765-
try:
766-
a = value # noqa
767-
1 / 0
768-
except Exception:
769-
capture_exception()
762+
del events[:]
763+
try:
764+
a = value # noqa
765+
1 / 0
766+
except Exception:
767+
capture_exception()
768+
769+
(event,) = events
770+
771+
stacktrace_frame = event["exception"]["values"][0]["stacktrace"]["frames"][0]
772+
a_var = stacktrace_frame["vars"]["a"]
773+
774+
assert type(a_var) == list
775+
assert len(a_var) == 1 and type(a_var[0]) == list
776+
777+
first_level_list = a_var[0]
778+
assert type(first_level_list) == list
779+
assert len(first_level_list) == 1
780+
781+
second_level_list = first_level_list[0]
782+
assert type(second_level_list) == list
783+
assert len(second_level_list) == 1
770784

771-
(event,) = events
785+
third_level_list = second_level_list[0]
786+
assert type(third_level_list) == list
787+
assert len(third_level_list) == 1
772788

773-
assert len(json.dumps(event)) < 10000
789+
inner_value_repr = third_level_list[0]
790+
assert type(inner_value_repr) == str
774791

775792

776-
def test_databag_string_stripping(sentry_init, capture_events, benchmark):
793+
def test_databag_string_stripping(sentry_init, capture_events):
777794
sentry_init()
778795
events = capture_events()
779796

780-
@benchmark
781-
def inner():
782-
del events[:]
783-
try:
784-
a = "A" * DEFAULT_MAX_VALUE_LENGTH * 10 # noqa
785-
1 / 0
786-
except Exception:
787-
capture_exception()
797+
del events[:]
798+
try:
799+
a = "A" * DEFAULT_MAX_VALUE_LENGTH * 10 # noqa
800+
1 / 0
801+
except Exception:
802+
capture_exception()
788803

789-
(event,) = events
804+
(event,) = events
790805

791-
assert len(json.dumps(event)) < DEFAULT_MAX_VALUE_LENGTH * 10
806+
assert len(json.dumps(event)) < DEFAULT_MAX_VALUE_LENGTH * 10
792807

793808

794-
def test_databag_breadth_stripping(sentry_init, capture_events, benchmark):
809+
def test_databag_breadth_stripping(sentry_init, capture_events):
795810
sentry_init()
796811
events = capture_events()
797812

798-
@benchmark
799-
def inner():
800-
del events[:]
801-
try:
802-
a = ["a"] * 1000000 # noqa
803-
1 / 0
804-
except Exception:
805-
capture_exception()
813+
del events[:]
814+
try:
815+
a = ["a"] * 1000000 # noqa
816+
1 / 0
817+
except Exception:
818+
capture_exception()
806819

807-
(event,) = events
820+
(event,) = events
808821

809-
assert (
810-
len(event["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]["a"])
811-
== MAX_DATABAG_BREADTH
812-
)
813-
assert len(json.dumps(event)) < 10000
822+
assert (
823+
len(event["exception"]["values"][0]["stacktrace"]["frames"][0]["vars"]["a"])
824+
== MAX_DATABAG_BREADTH
825+
)
826+
assert len(json.dumps(event)) < 10000
814827

815828

816829
def test_chained_exceptions(sentry_init, capture_events):

tox.ini

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ requires =
1818
virtualenv<20.26.3
1919
envlist =
2020
# === Common ===
21-
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-common
21+
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common
2222

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

2626
# === Integrations ===
2727

2828
# Asgi
29-
{py3.7,py3.12,py3.13}-asgi
29+
{py3.7,py3.12,py3.13,py3.14}-asgi
3030

3131
# AWS Lambda
3232
{py3.8,py3.9,py3.11,py3.13}-aws_lambda
@@ -38,7 +38,7 @@ envlist =
3838
{py3.7}-gcp
3939

4040
# OpenTelemetry (OTel)
41-
{py3.7,py3.9,py3.12,py3.13}-opentelemetry
41+
{py3.7,py3.9,py3.12,py3.13,py3.14}-opentelemetry
4242

4343
# OpenTelemetry Experimental (POTel)
4444
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-potel
@@ -304,7 +304,7 @@ deps =
304304
# and https://github.com/pytest-dev/pytest-forked/issues/67
305305
# for justification of the upper bound on pytest
306306
{py3.6,py3.7}-common: pytest<7.0.0
307-
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13}-common: pytest
307+
{py3.8,py3.9,py3.10,py3.11,py3.12,py3.13,py3.14}-common: pytest
308308

309309
# === Gevent ===
310310
{py3.6,py3.7,py3.8,py3.9,py3.10,py3.11}-gevent: gevent>=22.10.0, <22.11.0
@@ -825,6 +825,7 @@ basepython =
825825
py3.11: python3.11
826826
py3.12: python3.12
827827
py3.13: python3.13
828+
py3.14: python3.14
828829

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

0 commit comments

Comments
 (0)