Skip to content

Commit 43ea119

Browse files
authored
Merge branch 'master' into ivana/context_manager_state-missing-in-span-exit
2 parents 41e8884 + 4456351 commit 43ea119

File tree

21 files changed

+334
-246
lines changed

21 files changed

+334
-246
lines changed

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

Lines changed: 12 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -22,85 +22,6 @@ env:
2222
CACHED_BUILD_PATHS: |
2323
${{ github.workspace }}/dist-serverless
2424
jobs:
25-
test-ai-latest:
26-
name: AI (latest)
27-
timeout-minutes: 30
28-
runs-on: ${{ matrix.os }}
29-
strategy:
30-
fail-fast: false
31-
matrix:
32-
python-version: ["3.9","3.11","3.12"]
33-
# python3.6 reached EOL and is no longer being supported on
34-
# new versions of hosted runners on Github Actions
35-
# ubuntu-20.04 is the last version that supported python3.6
36-
# see https://github.com/actions/setup-python/issues/544#issuecomment-1332535877
37-
os: [ubuntu-22.04]
38-
# Use Docker container only for Python 3.6
39-
container: ${{ matrix.python-version == '3.6' && 'python:3.6' || null }}
40-
steps:
41-
- uses: actions/[email protected]
42-
- uses: actions/setup-python@v5
43-
if: ${{ matrix.python-version != '3.6' }}
44-
with:
45-
python-version: ${{ matrix.python-version }}
46-
allow-prereleases: true
47-
- name: Setup Test Env
48-
run: |
49-
pip install "coverage[toml]" tox
50-
- name: Erase coverage
51-
run: |
52-
coverage erase
53-
- name: Test anthropic latest
54-
run: |
55-
set -x # print commands that are executed
56-
./scripts/runtox.sh "py${{ matrix.python-version }}-anthropic-latest"
57-
- name: Test cohere latest
58-
run: |
59-
set -x # print commands that are executed
60-
./scripts/runtox.sh "py${{ matrix.python-version }}-cohere-latest"
61-
- name: Test langchain latest
62-
run: |
63-
set -x # print commands that are executed
64-
./scripts/runtox.sh "py${{ matrix.python-version }}-langchain-latest"
65-
- name: Test openai latest
66-
run: |
67-
set -x # print commands that are executed
68-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai-latest"
69-
- name: Test openai_agents latest
70-
run: |
71-
set -x # print commands that are executed
72-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai_agents-latest"
73-
- name: Test huggingface_hub latest
74-
run: |
75-
set -x # print commands that are executed
76-
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest"
77-
- name: Generate coverage XML (Python 3.6)
78-
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
79-
run: |
80-
export COVERAGE_RCFILE=.coveragerc36
81-
coverage combine .coverage-sentry-*
82-
coverage xml --ignore-errors
83-
- name: Generate coverage XML
84-
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
85-
run: |
86-
coverage combine .coverage-sentry-*
87-
coverage xml
88-
- name: Upload coverage to Codecov
89-
if: ${{ !cancelled() }}
90-
uses: codecov/[email protected]
91-
with:
92-
token: ${{ secrets.CODECOV_TOKEN }}
93-
files: coverage.xml
94-
# make sure no plugins alter our coverage reports
95-
plugins: noop
96-
verbose: true
97-
- name: Upload test results to Codecov
98-
if: ${{ !cancelled() }}
99-
uses: codecov/test-results-action@v1
100-
with:
101-
token: ${{ secrets.CODECOV_TOKEN }}
102-
files: .junitxml
103-
verbose: true
10425
test-ai-pinned:
10526
name: AI (pinned)
10627
timeout-minutes: 30
@@ -137,14 +58,22 @@ jobs:
13758
run: |
13859
set -x # print commands that are executed
13960
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cohere"
140-
- name: Test langchain pinned
61+
- name: Test langchain-base pinned
62+
run: |
63+
set -x # print commands that are executed
64+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain-base"
65+
- name: Test langchain-notiktoken pinned
66+
run: |
67+
set -x # print commands that are executed
68+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain-notiktoken"
69+
- name: Test openai-base pinned
14170
run: |
14271
set -x # print commands that are executed
143-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain"
144-
- name: Test openai pinned
72+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai-base"
73+
- name: Test openai-notiktoken pinned
14574
run: |
14675
set -x # print commands that are executed
147-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai"
76+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai-notiktoken"
14877
- name: Test openai_agents pinned
14978
run: |
15079
set -x # print commands that are executed

CHANGELOG.md

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

3+
## 2.35.2
4+
5+
### Various fixes & improvements
6+
7+
- fix(logs): Do not attach template if there are no parameters (#4728) by @sentrivana
8+
9+
## 2.35.1
10+
11+
### Various fixes & improvements
12+
13+
- OpenAI Agents: Isolate agent run (#4720) by @sentrivana
14+
- Tracing: Do not attach stacktrace to transaction (#4713) by @Zylphrex
15+
316
## 2.35.0
417

518
### Various fixes & improvements

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.35.0"
34+
release = "2.35.2"
3535
version = ".".join(release.split(".")[:2]) # The short X.Y version.
3636

3737

scripts/populate_tox/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,14 @@ be expressed like so:
153153
}
154154
```
155155

156+
### `integration_name`
157+
158+
Sometimes, the name of the test suite doesn't match the name of the integration.
159+
For example, we have the `openai_base` and `openai_notiktoken` test suites, both
160+
of which are actually testing the `openai` integration. If this is the case, you can use the `integration_name` key to define the name of the integration. If not provided, it will default to the name of the test suite.
161+
162+
Linking an integration to a test suite allows the script to access integration configuration like for example the minimum version defined in `sentry_sdk/integrations/__init__.py`.
163+
156164

157165
## How-Tos
158166

scripts/populate_tox/config.py

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,26 @@
126126
"huggingface_hub": {
127127
"package": "huggingface_hub",
128128
},
129+
"langchain-base": {
130+
"package": "langchain",
131+
"integration_name": "langchain",
132+
"deps": {
133+
"*": ["openai", "tiktoken", "langchain-openai"],
134+
"<=0.1": ["httpx<0.28.0"],
135+
">=0.3": ["langchain-community"],
136+
},
137+
"include": "<1.0",
138+
},
139+
"langchain-notiktoken": {
140+
"package": "langchain",
141+
"integration_name": "langchain",
142+
"deps": {
143+
"*": ["openai", "langchain-openai"],
144+
"<=0.1": ["httpx<0.28.0"],
145+
">=0.3": ["langchain-community"],
146+
},
147+
"include": "<1.0",
148+
},
129149
"launchdarkly": {
130150
"package": "launchdarkly-server-sdk",
131151
},
@@ -139,10 +159,29 @@
139159
"loguru": {
140160
"package": "loguru",
141161
},
162+
"openai-base": {
163+
"package": "openai",
164+
"integration_name": "openai",
165+
"deps": {
166+
"*": ["pytest-asyncio", "tiktoken"],
167+
"<1.55": ["httpx<0.28"],
168+
},
169+
"python": ">=3.8",
170+
},
171+
"openai-notiktoken": {
172+
"package": "openai",
173+
"integration_name": "openai",
174+
"deps": {
175+
"*": ["pytest-asyncio"],
176+
"<1.55": ["httpx<0.28"],
177+
},
178+
"python": ">=3.8",
179+
},
142180
"openai_agents": {
143181
"package": "openai-agents",
144182
"deps": {
145183
"*": ["pytest-asyncio"],
184+
"<=0.2.10": ["openai<1.103.0"],
146185
},
147186
"python": ">=3.10",
148187
},

scripts/populate_tox/populate_tox.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,6 @@
7474
"chalice",
7575
"gcp",
7676
"httpx",
77-
"langchain",
78-
"langchain_notiktoken",
79-
"openai",
80-
"openai_notiktoken",
8177
"pure_eval",
8278
"quart",
8379
"ray",
@@ -141,7 +137,11 @@ def _prefilter_releases(
141137
- the list of prefiltered releases
142138
- an optional prerelease if there is one that should be tested
143139
"""
144-
min_supported = _MIN_VERSIONS.get(integration)
140+
integration_name = (
141+
TEST_SUITE_CONFIG[integration].get("integration_name") or integration
142+
)
143+
144+
min_supported = _MIN_VERSIONS.get(integration_name)
145145
if min_supported is not None:
146146
min_supported = Version(".".join(map(str, min_supported)))
147147
else:

scripts/populate_tox/tox.jinja

100644100755
Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,6 @@ envlist =
7777
{py3.9,py3.11,py3.12}-httpx-v{0.25,0.27}
7878
{py3.9,py3.12,py3.13}-httpx-latest
7979

80-
# Langchain
81-
{py3.9,py3.11,py3.12}-langchain-v0.1
82-
{py3.9,py3.11,py3.12}-langchain-v0.3
83-
{py3.9,py3.11,py3.12}-langchain-latest
84-
{py3.9,py3.11,py3.12}-langchain-notiktoken
85-
86-
# OpenAI
87-
{py3.9,py3.11,py3.12}-openai-v1.0
88-
{py3.9,py3.11,py3.12}-openai-v1.22
89-
{py3.9,py3.11,py3.12}-openai-v1.55
90-
{py3.9,py3.11,py3.12}-openai-latest
91-
{py3.9,py3.11,py3.12}-openai-notiktoken
92-
9380
# OpenTelemetry (OTel)
9481
{py3.7,py3.9,py3.12,py3.13}-opentelemetry
9582

@@ -238,34 +225,6 @@ deps =
238225
httpx-v0.27: httpx~=0.27.0
239226
httpx-latest: httpx
240227
241-
# Langchain
242-
langchain-v0.1: openai~=1.0.0
243-
langchain-v0.1: langchain~=0.1.11
244-
langchain-v0.1: tiktoken~=0.6.0
245-
langchain-v0.1: httpx<0.28.0
246-
langchain-v0.3: langchain~=0.3.0
247-
langchain-v0.3: langchain-community
248-
langchain-v0.3: tiktoken
249-
langchain-v0.3: openai
250-
langchain-{latest,notiktoken}: langchain
251-
langchain-{latest,notiktoken}: langchain-openai
252-
langchain-{latest,notiktoken}: openai>=1.6.1
253-
langchain-latest: tiktoken~=0.6.0
254-
255-
# OpenAI
256-
openai: pytest-asyncio
257-
openai-v1.0: openai~=1.0.0
258-
openai-v1.0: tiktoken
259-
openai-v1.0: httpx<0.28.0
260-
openai-v1.22: openai~=1.22.0
261-
openai-v1.22: tiktoken
262-
openai-v1.22: httpx<0.28.0
263-
openai-v1.55: openai~=1.55.0
264-
openai-v1.55: tiktoken
265-
openai-latest: openai
266-
openai-latest: tiktoken~=0.6.0
267-
openai-notiktoken: openai
268-
269228
# OpenTelemetry (OTel)
270229
opentelemetry: opentelemetry-distro
271230
@@ -397,11 +356,13 @@ setenv =
397356
httpx: TESTPATH=tests/integrations/httpx
398357
huey: TESTPATH=tests/integrations/huey
399358
huggingface_hub: TESTPATH=tests/integrations/huggingface_hub
400-
langchain: TESTPATH=tests/integrations/langchain
359+
langchain-base: TESTPATH=tests/integrations/langchain
360+
langchain-notiktoken: TESTPATH=tests/integrations/langchain
401361
launchdarkly: TESTPATH=tests/integrations/launchdarkly
402362
litestar: TESTPATH=tests/integrations/litestar
403363
loguru: TESTPATH=tests/integrations/loguru
404-
openai: TESTPATH=tests/integrations/openai
364+
openai-base: TESTPATH=tests/integrations/openai
365+
openai-notiktoken: TESTPATH=tests/integrations/openai
405366
openai_agents: TESTPATH=tests/integrations/openai_agents
406367
openfeature: TESTPATH=tests/integrations/openfeature
407368
opentelemetry: TESTPATH=tests/integrations/opentelemetry
@@ -468,7 +429,7 @@ commands =
468429
; Running `pytest` as an executable suffers from an import error
469430
; when loading tests in scenarios. In particular, django fails to
470431
; load the settings from the test module.
471-
python -m pytest {env:TESTPATH} -o junit_suite_name={envname} {posargs}
432+
python -m pytest -W error::pytest.PytestUnraisableExceptionWarning {env:TESTPATH} -o junit_suite_name={envname} {posargs}
472433
473434
[testenv:linters]
474435
commands =

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,10 @@
6161
"AI": [
6262
"anthropic",
6363
"cohere",
64-
"langchain",
65-
"openai",
64+
"langchain-base",
65+
"langchain-notiktoken",
66+
"openai-base",
67+
"openai-notiktoken",
6668
"openai_agents",
6769
"huggingface_hub",
6870
],

sentry_sdk/consts.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1329,4 +1329,4 @@ def _get_default_options():
13291329
del _get_default_options
13301330

13311331

1332-
VERSION = "2.35.0"
1332+
VERSION = "2.35.2"

sentry_sdk/integrations/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def iter_default_integrations(with_auto_enabling_integrations):
141141
"graphene": (3, 3),
142142
"grpc": (1, 32, 0), # grpcio
143143
"huggingface_hub": (0, 22),
144-
"langchain": (0, 0, 210),
144+
"langchain": (0, 1, 0),
145145
"launchdarkly": (9, 8, 0),
146146
"loguru": (0, 7, 0),
147147
"openai": (1, 0, 0),

0 commit comments

Comments
 (0)