Skip to content

Commit 65755f9

Browse files
authored
tests: Move langchain under toxgen (#4734)
- move the langchain test suites to be governed by toxgen - this indirectly results in removing the `-latest` tests in the AI group 🎉 - `-latest` tests predate toxgen and langchain was the last non-toxgen test suite (the rest was just skipped) -- all AI tests are now pinned - updated the naming scheme to use dashes instead of underscores for variants so that it's clearer if something is part of the name of the integration or if it denotes a variant - for instance, `openai-base` means this is the `base` variant of the `openai` test suite, but `openai_agents` means this is the `openai_agents` test suite (no variant) I'm explicitly ignoring the two alpha versions of 1.0 since adapting the integration to work with those is out of scope: [dedicated issue](#4735) Part of #4506
1 parent 1d473b6 commit 65755f9

File tree

6 files changed

+93
-166
lines changed

6 files changed

+93
-166
lines changed

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

Lines changed: 10 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -22,89 +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_base latest
66-
run: |
67-
set -x # print commands that are executed
68-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai_base-latest"
69-
- name: Test openai_notiktoken latest
70-
run: |
71-
set -x # print commands that are executed
72-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai_notiktoken-latest"
73-
- name: Test openai_agents latest
74-
run: |
75-
set -x # print commands that are executed
76-
./scripts/runtox.sh "py${{ matrix.python-version }}-openai_agents-latest"
77-
- name: Test huggingface_hub latest
78-
run: |
79-
set -x # print commands that are executed
80-
./scripts/runtox.sh "py${{ matrix.python-version }}-huggingface_hub-latest"
81-
- name: Generate coverage XML (Python 3.6)
82-
if: ${{ !cancelled() && matrix.python-version == '3.6' }}
83-
run: |
84-
export COVERAGE_RCFILE=.coveragerc36
85-
coverage combine .coverage-sentry-*
86-
coverage xml --ignore-errors
87-
- name: Generate coverage XML
88-
if: ${{ !cancelled() && matrix.python-version != '3.6' }}
89-
run: |
90-
coverage combine .coverage-sentry-*
91-
coverage xml
92-
- name: Upload coverage to Codecov
93-
if: ${{ !cancelled() }}
94-
uses: codecov/[email protected]
95-
with:
96-
token: ${{ secrets.CODECOV_TOKEN }}
97-
files: coverage.xml
98-
# make sure no plugins alter our coverage reports
99-
plugins: noop
100-
verbose: true
101-
- name: Upload test results to Codecov
102-
if: ${{ !cancelled() }}
103-
uses: codecov/test-results-action@v1
104-
with:
105-
token: ${{ secrets.CODECOV_TOKEN }}
106-
files: .junitxml
107-
verbose: true
10825
test-ai-pinned:
10926
name: AI (pinned)
11027
timeout-minutes: 30
@@ -141,18 +58,22 @@ jobs:
14158
run: |
14259
set -x # print commands that are executed
14360
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-cohere"
144-
- 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
14566
run: |
14667
set -x # print commands that are executed
147-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain"
148-
- name: Test openai_base pinned
68+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-langchain-notiktoken"
69+
- name: Test openai-base pinned
14970
run: |
15071
set -x # print commands that are executed
151-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai_base"
152-
- name: Test openai_notiktoken pinned
72+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai-base"
73+
- name: Test openai-notiktoken pinned
15374
run: |
15475
set -x # print commands that are executed
155-
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai_notiktoken"
76+
./scripts/runtox.sh --exclude-latest "py${{ matrix.python-version }}-openai-notiktoken"
15677
- name: Test openai_agents pinned
15778
run: |
15879
set -x # print commands that are executed

scripts/populate_tox/config.py

Lines changed: 22 additions & 2 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,7 +159,7 @@
139159
"loguru": {
140160
"package": "loguru",
141161
},
142-
"openai_base": {
162+
"openai-base": {
143163
"package": "openai",
144164
"integration_name": "openai",
145165
"deps": {
@@ -148,7 +168,7 @@
148168
},
149169
"python": ">=3.8",
150170
},
151-
"openai_notiktoken": {
171+
"openai-notiktoken": {
152172
"package": "openai",
153173
"integration_name": "openai",
154174
"deps": {

scripts/populate_tox/tox.jinja

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +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-
8680
# OpenTelemetry (OTel)
8781
{py3.7,py3.9,py3.12,py3.13}-opentelemetry
8882

@@ -231,20 +225,6 @@ deps =
231225
httpx-v0.27: httpx~=0.27.0
232226
httpx-latest: httpx
233227
234-
# Langchain
235-
langchain-v0.1: openai~=1.0.0
236-
langchain-v0.1: langchain~=0.1.11
237-
langchain-v0.1: tiktoken~=0.6.0
238-
langchain-v0.1: httpx<0.28.0
239-
langchain-v0.3: langchain~=0.3.0
240-
langchain-v0.3: langchain-community
241-
langchain-v0.3: tiktoken
242-
langchain-v0.3: openai
243-
langchain-{latest,notiktoken}: langchain
244-
langchain-{latest,notiktoken}: langchain-openai
245-
langchain-{latest,notiktoken}: openai>=1.6.1
246-
langchain-latest: tiktoken~=0.6.0
247-
248228
# OpenTelemetry (OTel)
249229
opentelemetry: opentelemetry-distro
250230
@@ -376,12 +356,13 @@ setenv =
376356
httpx: TESTPATH=tests/integrations/httpx
377357
huey: TESTPATH=tests/integrations/huey
378358
huggingface_hub: TESTPATH=tests/integrations/huggingface_hub
379-
langchain: TESTPATH=tests/integrations/langchain
359+
langchain-base: TESTPATH=tests/integrations/langchain
360+
langchain-notiktoken: TESTPATH=tests/integrations/langchain
380361
launchdarkly: TESTPATH=tests/integrations/launchdarkly
381362
litestar: TESTPATH=tests/integrations/litestar
382363
loguru: TESTPATH=tests/integrations/loguru
383-
openai_base: TESTPATH=tests/integrations/openai
384-
openai_notiktoken: TESTPATH=tests/integrations/openai
364+
openai-base: TESTPATH=tests/integrations/openai
365+
openai-notiktoken: TESTPATH=tests/integrations/openai
385366
openai_agents: TESTPATH=tests/integrations/openai_agents
386367
openfeature: TESTPATH=tests/integrations/openfeature
387368
opentelemetry: TESTPATH=tests/integrations/opentelemetry

scripts/split_tox_gh_actions/split_tox_gh_actions.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@
6161
"AI": [
6262
"anthropic",
6363
"cohere",
64-
"langchain",
65-
"openai_base",
66-
"openai_notiktoken",
64+
"langchain-base",
65+
"langchain-notiktoken",
66+
"openai-base",
67+
"openai-notiktoken",
6768
"openai_agents",
6869
"huggingface_hub",
6970
],

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),

tox.ini

Lines changed: 52 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# The file (and all resulting CI YAMLs) then need to be regenerated via
1111
# "scripts/generate-test-files.sh".
1212
#
13-
# Last generated: 2025-09-01T14:09:50.564158+00:00
13+
# Last generated: 2025-09-02T10:59:55.249513+00:00
1414

1515
[tox]
1616
requires =
@@ -77,12 +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-
8680
# OpenTelemetry (OTel)
8781
{py3.7,py3.9,py3.12,py3.13}-opentelemetry
8882

@@ -138,15 +132,23 @@ envlist =
138132
{py3.9,py3.11,py3.12}-cohere-v5.13.12
139133
{py3.9,py3.11,py3.12}-cohere-v5.17.0
140134

141-
{py3.8,py3.11,py3.12}-openai_base-v1.0.1
142-
{py3.8,py3.11,py3.12}-openai_base-v1.35.15
143-
{py3.8,py3.11,py3.12}-openai_base-v1.69.0
144-
{py3.8,py3.12,py3.13}-openai_base-v1.102.0
135+
{py3.9,py3.11,py3.12}-langchain-base-v0.1.20
136+
{py3.9,py3.11,py3.12}-langchain-base-v0.2.17
137+
{py3.9,py3.12,py3.13}-langchain-base-v0.3.27
138+
139+
{py3.9,py3.11,py3.12}-langchain-notiktoken-v0.1.20
140+
{py3.9,py3.11,py3.12}-langchain-notiktoken-v0.2.17
141+
{py3.9,py3.12,py3.13}-langchain-notiktoken-v0.3.27
145142

146-
{py3.8,py3.11,py3.12}-openai_notiktoken-v1.0.1
147-
{py3.8,py3.11,py3.12}-openai_notiktoken-v1.35.15
148-
{py3.8,py3.11,py3.12}-openai_notiktoken-v1.69.0
149-
{py3.8,py3.12,py3.13}-openai_notiktoken-v1.102.0
143+
{py3.8,py3.11,py3.12}-openai-base-v1.0.1
144+
{py3.8,py3.11,py3.12}-openai-base-v1.35.15
145+
{py3.8,py3.11,py3.12}-openai-base-v1.69.0
146+
{py3.8,py3.12,py3.13}-openai-base-v1.102.0
147+
148+
{py3.8,py3.11,py3.12}-openai-notiktoken-v1.0.1
149+
{py3.8,py3.11,py3.12}-openai-notiktoken-v1.35.15
150+
{py3.8,py3.11,py3.12}-openai-notiktoken-v1.69.0
151+
{py3.8,py3.12,py3.13}-openai-notiktoken-v1.102.0
150152

151153
{py3.10,py3.11,py3.12}-openai_agents-v0.0.19
152154
{py3.10,py3.12,py3.13}-openai_agents-v0.1.0
@@ -412,20 +414,6 @@ deps =
412414
httpx-v0.27: httpx~=0.27.0
413415
httpx-latest: httpx
414416

415-
# Langchain
416-
langchain-v0.1: openai~=1.0.0
417-
langchain-v0.1: langchain~=0.1.11
418-
langchain-v0.1: tiktoken~=0.6.0
419-
langchain-v0.1: httpx<0.28.0
420-
langchain-v0.3: langchain~=0.3.0
421-
langchain-v0.3: langchain-community
422-
langchain-v0.3: tiktoken
423-
langchain-v0.3: openai
424-
langchain-{latest,notiktoken}: langchain
425-
langchain-{latest,notiktoken}: langchain-openai
426-
langchain-{latest,notiktoken}: openai>=1.6.1
427-
langchain-latest: tiktoken~=0.6.0
428-
429417
# OpenTelemetry (OTel)
430418
opentelemetry: opentelemetry-distro
431419

@@ -516,22 +504,37 @@ deps =
516504
cohere-v5.13.12: cohere==5.13.12
517505
cohere-v5.17.0: cohere==5.17.0
518506

519-
openai_base-v1.0.1: openai==1.0.1
520-
openai_base-v1.35.15: openai==1.35.15
521-
openai_base-v1.69.0: openai==1.69.0
522-
openai_base-v1.102.0: openai==1.102.0
523-
openai_base: pytest-asyncio
524-
openai_base: tiktoken
525-
openai_base-v1.0.1: httpx<0.28
526-
openai_base-v1.35.15: httpx<0.28
527-
528-
openai_notiktoken-v1.0.1: openai==1.0.1
529-
openai_notiktoken-v1.35.15: openai==1.35.15
530-
openai_notiktoken-v1.69.0: openai==1.69.0
531-
openai_notiktoken-v1.102.0: openai==1.102.0
532-
openai_notiktoken: pytest-asyncio
533-
openai_notiktoken-v1.0.1: httpx<0.28
534-
openai_notiktoken-v1.35.15: httpx<0.28
507+
langchain-base-v0.1.20: langchain==0.1.20
508+
langchain-base-v0.2.17: langchain==0.2.17
509+
langchain-base-v0.3.27: langchain==0.3.27
510+
langchain-base: openai
511+
langchain-base: tiktoken
512+
langchain-base: langchain-openai
513+
langchain-base-v0.3.27: langchain-community
514+
515+
langchain-notiktoken-v0.1.20: langchain==0.1.20
516+
langchain-notiktoken-v0.2.17: langchain==0.2.17
517+
langchain-notiktoken-v0.3.27: langchain==0.3.27
518+
langchain-notiktoken: openai
519+
langchain-notiktoken: langchain-openai
520+
langchain-notiktoken-v0.3.27: langchain-community
521+
522+
openai-base-v1.0.1: openai==1.0.1
523+
openai-base-v1.35.15: openai==1.35.15
524+
openai-base-v1.69.0: openai==1.69.0
525+
openai-base-v1.102.0: openai==1.102.0
526+
openai-base: pytest-asyncio
527+
openai-base: tiktoken
528+
openai-base-v1.0.1: httpx<0.28
529+
openai-base-v1.35.15: httpx<0.28
530+
531+
openai-notiktoken-v1.0.1: openai==1.0.1
532+
openai-notiktoken-v1.35.15: openai==1.35.15
533+
openai-notiktoken-v1.69.0: openai==1.69.0
534+
openai-notiktoken-v1.102.0: openai==1.102.0
535+
openai-notiktoken: pytest-asyncio
536+
openai-notiktoken-v1.0.1: httpx<0.28
537+
openai-notiktoken-v1.35.15: httpx<0.28
535538

536539
openai_agents-v0.0.19: openai-agents==0.0.19
537540
openai_agents-v0.1.0: openai-agents==0.1.0
@@ -833,12 +836,13 @@ setenv =
833836
httpx: TESTPATH=tests/integrations/httpx
834837
huey: TESTPATH=tests/integrations/huey
835838
huggingface_hub: TESTPATH=tests/integrations/huggingface_hub
836-
langchain: TESTPATH=tests/integrations/langchain
839+
langchain-base: TESTPATH=tests/integrations/langchain
840+
langchain-notiktoken: TESTPATH=tests/integrations/langchain
837841
launchdarkly: TESTPATH=tests/integrations/launchdarkly
838842
litestar: TESTPATH=tests/integrations/litestar
839843
loguru: TESTPATH=tests/integrations/loguru
840-
openai_base: TESTPATH=tests/integrations/openai
841-
openai_notiktoken: TESTPATH=tests/integrations/openai
844+
openai-base: TESTPATH=tests/integrations/openai
845+
openai-notiktoken: TESTPATH=tests/integrations/openai
842846
openai_agents: TESTPATH=tests/integrations/openai_agents
843847
openfeature: TESTPATH=tests/integrations/openfeature
844848
opentelemetry: TESTPATH=tests/integrations/opentelemetry

0 commit comments

Comments
 (0)