Skip to content

Commit 227c65b

Browse files
committed
Merge remote-tracking branch 'origin/dev' into Haoming-tool.py
2 parents a53d370 + e286f30 commit 227c65b

File tree

1,545 files changed

+75448
-29667
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,545 files changed

+75448
-29667
lines changed

.github/workflows/_compile_integration_test.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
required: true
88
type: string
99
description: "From which folder this pipeline executes"
10+
langchain-core-location:
11+
required: false
12+
type: string
13+
description: "Relative path to the langchain core library folder"
1014

1115
env:
1216
POETRY_VERSION: "1.6.1"
@@ -40,6 +44,14 @@ jobs:
4044
shell: bash
4145
run: poetry install --with=test_integration
4246

47+
- name: Install langchain core editable
48+
working-directory: ${{ inputs.working-directory }}
49+
if: ${{ inputs.langchain-core-location }}
50+
env:
51+
LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }}
52+
run: |
53+
poetry run pip install -e "$LANGCHAIN_CORE_LOCATION"
54+
4355
- name: Check integration tests compile
4456
shell: bash
4557
run: poetry run pytest -m compile tests/integration_tests

.github/workflows/_lint.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ on:
1111
required: false
1212
type: string
1313
description: "Relative path to the langchain library folder"
14+
langchain-core-location:
15+
required: false
16+
type: string
17+
description: "Relative path to the langchain core library folder"
1418

1519
env:
1620
POETRY_VERSION: "1.6.1"
@@ -76,7 +80,15 @@ jobs:
7680
env:
7781
LANGCHAIN_LOCATION: ${{ inputs.langchain-location }}
7882
run: |
79-
pip install -e "$LANGCHAIN_LOCATION"
83+
poetry run pip install -e "$LANGCHAIN_LOCATION"
84+
85+
- name: Install langchain core editable
86+
working-directory: ${{ inputs.working-directory }}
87+
if: ${{ inputs.langchain-core-location }}
88+
env:
89+
LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }}
90+
run: |
91+
poetry run pip install -e "$LANGCHAIN_CORE_LOCATION"
8092
8193
- name: Get .mypy_cache to speed up mypy
8294
uses: actions/cache@v3

.github/workflows/_pydantic_compatibility.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
required: true
88
type: string
99
description: "From which folder this pipeline executes"
10+
langchain-location:
11+
required: false
12+
type: string
13+
description: "Relative path to the langchain library folder"
14+
langchain-core-location:
15+
required: false
16+
type: string
17+
description: "Relative path to the langchain core library folder"
1018

1119
env:
1220
POETRY_VERSION: "1.6.1"
@@ -40,6 +48,22 @@ jobs:
4048
shell: bash
4149
run: poetry install
4250

51+
- name: Install langchain editable
52+
working-directory: ${{ inputs.working-directory }}
53+
if: ${{ inputs.langchain-location }}
54+
env:
55+
LANGCHAIN_LOCATION: ${{ inputs.langchain-location }}
56+
run: |
57+
poetry run pip install -e "$LANGCHAIN_LOCATION"
58+
59+
- name: Install langchain core editable
60+
working-directory: ${{ inputs.working-directory }}
61+
if: ${{ inputs.langchain-core-location }}
62+
env:
63+
LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }}
64+
run: |
65+
poetry run pip install -e "$LANGCHAIN_CORE_LOCATION"
66+
4367
- name: Install the opposite major version of pydantic
4468
# If normal tests use pydantic v1, here we'll use v2, and vice versa.
4569
shell: bash

.github/workflows/_test.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ on:
77
required: true
88
type: string
99
description: "From which folder this pipeline executes"
10+
langchain-location:
11+
required: false
12+
type: string
13+
description: "Relative path to the langchain library folder"
14+
langchain-core-location:
15+
required: false
16+
type: string
17+
description: "Relative path to the langchain core library folder"
1018

1119
env:
1220
POETRY_VERSION: "1.6.1"
@@ -40,9 +48,26 @@ jobs:
4048
shell: bash
4149
run: poetry install
4250

51+
- name: Install langchain editable
52+
working-directory: ${{ inputs.working-directory }}
53+
if: ${{ inputs.langchain-location }}
54+
env:
55+
LANGCHAIN_LOCATION: ${{ inputs.langchain-location }}
56+
run: |
57+
poetry run pip install -e "$LANGCHAIN_LOCATION"
58+
59+
- name: Install langchain core editable
60+
working-directory: ${{ inputs.working-directory }}
61+
if: ${{ inputs.langchain-core-location }}
62+
env:
63+
LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }}
64+
run: |
65+
poetry run pip install -e "$LANGCHAIN_CORE_LOCATION"
66+
4367
- name: Run core tests
4468
shell: bash
45-
run: make test
69+
run: |
70+
make test
4671
4772
- name: Ensure the tests did not create any additional files
4873
shell: bash

.github/workflows/langchain_ci.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
- '.github/workflows/langchain_ci.yml'
1515
- 'libs/*'
1616
- 'libs/langchain/**'
17+
- 'libs/core/**'
1718
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
1819

1920
# If another push to the same PR or branch happens while this workflow is still running,
@@ -36,29 +37,73 @@ jobs:
3637
./.github/workflows/_lint.yml
3738
with:
3839
working-directory: libs/langchain
40+
langchain-core-location: ../core
3941
secrets: inherit
4042

4143
test:
4244
uses:
4345
./.github/workflows/_test.yml
4446
with:
4547
working-directory: libs/langchain
48+
langchain-core-location: ../core
4649
secrets: inherit
4750

4851
compile-integration-tests:
4952
uses:
5053
./.github/workflows/_compile_integration_test.yml
5154
with:
5255
working-directory: libs/langchain
56+
langchain-core-location: ../core
5357
secrets: inherit
5458

5559
pydantic-compatibility:
5660
uses:
5761
./.github/workflows/_pydantic_compatibility.yml
5862
with:
5963
working-directory: libs/langchain
64+
langchain-core-location: ../core
6065
secrets: inherit
6166

67+
# It's possible that langchain works fine with the latest *published* langchain-core,
68+
# but is broken with the langchain-core on `master`.
69+
#
70+
# We want to catch situations like that *before* releasing a new langchain-core, hence this test.
71+
test-with-latest-langchain-core:
72+
runs-on: ubuntu-latest
73+
defaults:
74+
run:
75+
working-directory: ${{ env.WORKDIR }}
76+
strategy:
77+
matrix:
78+
python-version:
79+
- "3.8"
80+
- "3.9"
81+
- "3.10"
82+
- "3.11"
83+
name: test with unpublished langchain-core - Python ${{ matrix.python-version }}
84+
steps:
85+
- uses: actions/checkout@v4
86+
87+
- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
88+
uses: "./.github/actions/poetry_setup"
89+
with:
90+
python-version: ${{ matrix.python-version }}
91+
poetry-version: ${{ env.POETRY_VERSION }}
92+
working-directory: ${{ env.WORKDIR }}
93+
cache-key: unpublished-langchain-core
94+
95+
- name: Install dependencies
96+
shell: bash
97+
run: |
98+
echo "Running tests with unpublished langchain, installing dependencies with poetry..."
99+
poetry install
100+
101+
echo "Editably installing langchain-core outside of poetry, to avoid messing up lockfile..."
102+
poetry run pip install -e ../core
103+
104+
- name: Run tests
105+
run: make test
106+
62107
extended-tests:
63108
runs-on: ubuntu-latest
64109
defaults:
@@ -89,6 +134,11 @@ jobs:
89134
echo "Running extended tests, installing dependencies with poetry..."
90135
poetry install -E extended_testing
91136
137+
- name: Install langchain core editable
138+
shell: bash
139+
run: |
140+
poetry run pip install -e ../core
141+
92142
- name: Run extended tests
93143
run: make extended_tests
94144

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
---
2+
name: libs/langchain core CI
3+
4+
on:
5+
push:
6+
branches: [ master ]
7+
pull_request:
8+
paths:
9+
- '.github/actions/poetry_setup/action.yml'
10+
- '.github/tools/**'
11+
- '.github/workflows/_lint.yml'
12+
- '.github/workflows/_test.yml'
13+
- '.github/workflows/_pydantic_compatibility.yml'
14+
- '.github/workflows/langchain_core_ci.yml'
15+
- 'libs/core/**'
16+
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
17+
18+
# If another push to the same PR or branch happens while this workflow is still running,
19+
# cancel the earlier run in favor of the next run.
20+
#
21+
# There's no point in testing an outdated version of the code. GitHub only allows
22+
# a limited number of job runners to be active at the same time, so it's better to cancel
23+
# pointless jobs early so that more useful jobs can run sooner.
24+
concurrency:
25+
group: ${{ github.workflow }}-${{ github.ref }}
26+
cancel-in-progress: true
27+
28+
env:
29+
POETRY_VERSION: "1.6.1"
30+
WORKDIR: "libs/core"
31+
32+
jobs:
33+
lint:
34+
uses:
35+
./.github/workflows/_lint.yml
36+
with:
37+
working-directory: libs/core
38+
secrets: inherit
39+
40+
test:
41+
uses:
42+
./.github/workflows/_test.yml
43+
with:
44+
working-directory: libs/core
45+
secrets: inherit
46+
47+
pydantic-compatibility:
48+
uses:
49+
./.github/workflows/_pydantic_compatibility.yml
50+
with:
51+
working-directory: libs/core
52+
secrets: inherit
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: libs/core Release
3+
4+
on:
5+
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
6+
7+
jobs:
8+
release:
9+
uses:
10+
./.github/workflows/_release.yml
11+
with:
12+
working-directory: libs/core
13+
secrets: inherit

.github/workflows/langchain_experimental_ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ on:
1313
- '.github/workflows/langchain_experimental_ci.yml'
1414
- 'libs/*'
1515
- 'libs/experimental/**'
16+
- 'libs/langchain/**'
17+
- 'libs/core/**'
1618
workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI
1719

1820
# If another push to the same PR or branch happens while this workflow is still running,
@@ -36,13 +38,16 @@ jobs:
3638
with:
3739
working-directory: libs/experimental
3840
langchain-location: ../langchain
41+
langchain-core-location: ../core
3942
secrets: inherit
4043

4144
test:
4245
uses:
4346
./.github/workflows/_test.yml
4447
with:
4548
working-directory: libs/experimental
49+
langchain-location: ../langchain
50+
langchain-core-location: ../core
4651
secrets: inherit
4752

4853
compile-integration-tests:
@@ -88,6 +93,7 @@ jobs:
8893
8994
echo "Editably installing langchain outside of poetry, to avoid messing up lockfile..."
9095
poetry run pip install -e ../langchain
96+
poetry run pip install -e ../core
9197
9298
- name: Run tests
9399
run: make test

0 commit comments

Comments
 (0)