Skip to content

Commit 97e60f3

Browse files
authored
Merge branch 'master' into ep/sdk-669-add-pipeline-to-span-attributes-93e
2 parents 840eced + 9193eb0 commit 97e60f3

File tree

12 files changed

+894
-604
lines changed

12 files changed

+894
-604
lines changed

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,6 @@ jobs:
6969
run: |
7070
set -x # print commands that are executed
7171
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub"
72-
- name: Test litellm
73-
run: |
74-
set -x # print commands that are executed
75-
./scripts/runtox.sh "py${{ matrix.python-version }}-litellm"
7672
- name: Test openai-base
7773
run: |
7874
set -x # print commands that are executed

CHANGELOG.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,40 @@
11
# Changelog
22

3+
## 2.56.0
4+
5+
### New Features ✨
6+
7+
- (asgi) Add option to disable suppressing chained exceptions by @alexander-alderman-webb in [#5714](https://github.com/getsentry/sentry-python/pull/5714)
8+
- (logging) Separate ignore lists for events/breadcrumbs and sentry logs by @sl0thentr0py in [#5698](https://github.com/getsentry/sentry-python/pull/5698)
9+
10+
### Bug Fixes 🐛
11+
12+
#### Anthropic
13+
14+
- Set exception info on streaming span when applicable by @alexander-alderman-webb in [#5683](https://github.com/getsentry/sentry-python/pull/5683)
15+
- Patch `AsyncStream.close()` and `AsyncMessageStream.close()` to finish spans by @alexander-alderman-webb in [#5675](https://github.com/getsentry/sentry-python/pull/5675)
16+
- Patch `Stream.close()` and `MessageStream.close()` to finish spans by @alexander-alderman-webb in [#5674](https://github.com/getsentry/sentry-python/pull/5674)
17+
18+
#### Other
19+
20+
- (starlette) Catch Jinja2Templates ImportError by @alexander-alderman-webb in [#5741](https://github.com/getsentry/sentry-python/pull/5741)
21+
22+
### Documentation 📚
23+
24+
- Add note on AI PRs to CONTRIBUTING.md by @sentrivana in [#5696](https://github.com/getsentry/sentry-python/pull/5696)
25+
26+
### Internal Changes 🔧
27+
28+
- Pin GitHub Actions to full-length commit SHAs by @joshuarli in [#5781](https://github.com/getsentry/sentry-python/pull/5781)
29+
- Add `-latest` alias for each integration test suite by @sentrivana in [#5706](https://github.com/getsentry/sentry-python/pull/5706)
30+
- Use date-based branch names for toxgen PRs by @sentrivana in [#5704](https://github.com/getsentry/sentry-python/pull/5704)
31+
- 🤖 Update test matrix with new releases (03/19) by @github-actions in [#5703](https://github.com/getsentry/sentry-python/pull/5703)
32+
- Add client report tests for span streaming by @sentrivana in [#5677](https://github.com/getsentry/sentry-python/pull/5677)
33+
34+
### Other
35+
36+
- Update CHANGELOG.md by @sentrivana in [#5685](https://github.com/getsentry/sentry-python/pull/5685)
37+
338
## 2.55.0
439

540
### New Features ✨

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
copyright = "2019-{}, Sentry Team and Contributors".format(datetime.now().year)
3232
author = "Sentry Team and Contributors"
3333

34-
release = "2.55.0"
34+
release = "2.56.0"
3535
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3636

3737

scripts/populate_tox/config.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,6 @@
230230
"package": "launchdarkly-server-sdk",
231231
"num_versions": 2,
232232
},
233-
"litellm": {
234-
"package": "litellm",
235-
},
236233
"litestar": {
237234
"package": "litestar",
238235
"deps": {

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@
8787
"cohere",
8888
"google_genai",
8989
"huggingface_hub",
90-
"litellm",
9190
"openai-base",
9291
"openai-notiktoken",
9392
],

scripts/split_tox_gh_actions/templates/test_group.jinja

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,26 +42,26 @@
4242
# Use Docker container only for Python 3.6
4343
{% raw %}container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }}{% endraw %}
4444
steps:
45-
- uses: actions/checkout@v6.0.2
46-
- uses: actions/setup-python@v6
45+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
46+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6
4747
{% raw %}if: ${{ matrix.python-version != '3.6' }}{% endraw %}
4848
with:
4949
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}
5050
allow-prereleases: true
5151

5252
{% if needs_clickhouse %}
5353
- name: "Setup ClickHouse Server"
54-
uses: getsentry/action-clickhouse-in-ci@v1.7
54+
uses: getsentry/action-clickhouse-in-ci@5dc8a6a50d689bd6051db0241f34849e5a36490b # v1.7
5555
{% endif %}
5656

5757
{% if needs_redis %}
5858
- name: Start Redis
59-
uses: supercharge/redis-github-action@v2
59+
uses: supercharge/redis-github-action@87f27ff1ab2d9e62db54b11ee5e7f78ff18f8933 # v2
6060
{% endif %}
6161

6262
{% if needs_java %}
6363
- name: Install Java
64-
uses: actions/setup-java@v5
64+
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
6565
with:
6666
distribution: 'temurin'
6767
java-version: '21'
@@ -96,7 +96,7 @@
9696

9797
- name: Parse and Upload Coverage
9898
if: {% raw %}${{ !cancelled() }}{% endraw %}
99-
uses: getsentry/codecov-action@main
99+
uses: getsentry/codecov-action@fda17cfc37e16a0cc23f61685813390bfee7daf3 # main
100100
with:
101101
token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
102102
files: coverage.xml

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1492,4 +1492,4 @@ def _get_default_options() -> "dict[str, Any]":
14921492
del _get_default_options
14931493

14941494

1495-
VERSION = "2.55.0"
1495+
VERSION = "2.56.0"

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def get_file_text(file_name):
2121

2222
setup(
2323
name="sentry-sdk",
24-
version="2.55.0",
24+
version="2.56.0",
2525
author="Sentry Team and Contributors",
2626
author_email="hello@sentry.io",
2727
url="https://github.com/getsentry/sentry-python",

tests/conftest.py

Lines changed: 115 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@
4848
from sentry_sdk.transport import Transport
4949
from sentry_sdk.utils import reraise
5050

51+
try:
52+
import openai
53+
except ImportError:
54+
openai = None
55+
56+
5157
from tests import _warning_recorder, _warning_recorder_mgr
5258

5359
from typing import TYPE_CHECKING
@@ -1018,21 +1024,29 @@ async def inner(values):
10181024

10191025
@pytest.fixture
10201026
def server_side_event_chunks():
1021-
def inner(events):
1027+
def inner(events, include_event_type=True):
10221028
for event in events:
10231029
payload = event.model_dump()
1024-
chunk = f"event: {payload['type']}\ndata: {json.dumps(payload)}\n\n"
1030+
chunk = (
1031+
f"event: {payload['type']}\ndata: {json.dumps(payload)}\n\n"
1032+
if include_event_type
1033+
else f"data: {json.dumps(payload)}\n\n"
1034+
)
10251035
yield chunk.encode("utf-8")
10261036

10271037
return inner
10281038

10291039

10301040
@pytest.fixture
10311041
def get_model_response():
1032-
def inner(response_content, serialize_pydantic=False):
1042+
def inner(response_content, serialize_pydantic=False, request_headers=None):
1043+
if request_headers is None:
1044+
request_headers = {}
1045+
10331046
model_request = HttpxRequest(
10341047
"POST",
10351048
"/responses",
1049+
headers=request_headers,
10361050
)
10371051

10381052
if serialize_pydantic:
@@ -1049,6 +1063,104 @@ def inner(response_content, serialize_pydantic=False):
10491063
return inner
10501064

10511065

1066+
@pytest.fixture
1067+
def nonstreaming_responses_model_response():
1068+
return openai.types.responses.Response(
1069+
id="resp_123",
1070+
output=[
1071+
openai.types.responses.ResponseOutputMessage(
1072+
id="msg_123",
1073+
type="message",
1074+
status="completed",
1075+
content=[
1076+
openai.types.responses.ResponseOutputText(
1077+
text="Hello, how can I help you?",
1078+
type="output_text",
1079+
annotations=[],
1080+
)
1081+
],
1082+
role="assistant",
1083+
)
1084+
],
1085+
parallel_tool_calls=False,
1086+
tool_choice="none",
1087+
tools=[],
1088+
created_at=10000000,
1089+
model="gpt-4",
1090+
object="response",
1091+
usage=openai.types.responses.ResponseUsage(
1092+
input_tokens=10,
1093+
input_tokens_details=openai.types.responses.response_usage.InputTokensDetails(
1094+
cached_tokens=0,
1095+
),
1096+
output_tokens=20,
1097+
output_tokens_details=openai.types.responses.response_usage.OutputTokensDetails(
1098+
reasoning_tokens=5,
1099+
),
1100+
total_tokens=30,
1101+
),
1102+
)
1103+
1104+
1105+
@pytest.fixture
1106+
def responses_tool_call_model_responses():
1107+
def inner(
1108+
tool_name: str,
1109+
arguments: str,
1110+
response_model: str,
1111+
response_text: str,
1112+
response_ids: "Iterator[str]",
1113+
usages: "Iterator[openai.types.responses.ResponseUsage]",
1114+
):
1115+
yield openai.types.responses.Response(
1116+
id=next(response_ids),
1117+
output=[
1118+
openai.types.responses.ResponseFunctionToolCall(
1119+
id="call_123",
1120+
call_id="call_123",
1121+
name=tool_name,
1122+
type="function_call",
1123+
arguments=arguments,
1124+
)
1125+
],
1126+
parallel_tool_calls=False,
1127+
tool_choice="none",
1128+
tools=[],
1129+
created_at=10000000,
1130+
model=response_model,
1131+
object="response",
1132+
usage=next(usages),
1133+
)
1134+
1135+
yield openai.types.responses.Response(
1136+
id=next(response_ids),
1137+
output=[
1138+
openai.types.responses.ResponseOutputMessage(
1139+
id="msg_final",
1140+
type="message",
1141+
status="completed",
1142+
content=[
1143+
openai.types.responses.ResponseOutputText(
1144+
text=response_text,
1145+
type="output_text",
1146+
annotations=[],
1147+
)
1148+
],
1149+
role="assistant",
1150+
)
1151+
],
1152+
parallel_tool_calls=False,
1153+
tool_choice="none",
1154+
tools=[],
1155+
created_at=10000000,
1156+
model=response_model,
1157+
object="response",
1158+
usage=next(usages),
1159+
)
1160+
1161+
return inner
1162+
1163+
10521164
class MockServerRequestHandler(BaseHTTPRequestHandler):
10531165
def do_GET(self): # noqa: N802
10541166
# Process an HTTP GET request and return a response.

0 commit comments

Comments
 (0)