diff --git a/.github/workflows/_compile_integration_test.yml b/.github/workflows/_compile_integration_test.yml index 71c1721dd78..d52828084f5 100644 --- a/.github/workflows/_compile_integration_test.yml +++ b/.github/workflows/_compile_integration_test.yml @@ -7,10 +7,6 @@ on: required: true type: string description: "From which folder this pipeline executes" - langchain-core-location: - required: false - type: string - description: "Relative path to the langchain core library folder" env: POETRY_VERSION: "1.6.1" @@ -44,14 +40,6 @@ jobs: shell: bash run: poetry install --with=test_integration - - name: Install langchain core editable - working-directory: ${{ inputs.working-directory }} - if: ${{ inputs.langchain-core-location }} - env: - LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }} - run: | - poetry run pip install -e "$LANGCHAIN_CORE_LOCATION" - - name: Check integration tests compile shell: bash run: poetry run pytest -m compile tests/integration_tests diff --git a/.github/workflows/_lint.yml b/.github/workflows/_lint.yml index 9575b69fd35..72d52b5c8e5 100644 --- a/.github/workflows/_lint.yml +++ b/.github/workflows/_lint.yml @@ -11,10 +11,6 @@ on: required: false type: string description: "Relative path to the langchain library folder" - langchain-core-location: - required: false - type: string - description: "Relative path to the langchain core library folder" env: POETRY_VERSION: "1.6.1" @@ -82,14 +78,6 @@ jobs: run: | poetry run pip install -e "$LANGCHAIN_LOCATION" - - name: Install langchain core editable - working-directory: ${{ inputs.working-directory }} - if: ${{ inputs.langchain-core-location }} - env: - LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }} - run: | - poetry run pip install -e "$LANGCHAIN_CORE_LOCATION" - - name: Get .mypy_cache to speed up mypy uses: actions/cache@v3 env: diff --git a/.github/workflows/_pydantic_compatibility.yml b/.github/workflows/_pydantic_compatibility.yml index af943fbdfde..680d961c305 100644 --- a/.github/workflows/_pydantic_compatibility.yml +++ b/.github/workflows/_pydantic_compatibility.yml @@ -11,10 +11,6 @@ on: required: false type: string description: "Relative path to the langchain library folder" - langchain-core-location: - required: false - type: string - description: "Relative path to the langchain core library folder" env: POETRY_VERSION: "1.6.1" @@ -56,14 +52,6 @@ jobs: run: | poetry run pip install -e "$LANGCHAIN_LOCATION" - - name: Install langchain core editable - working-directory: ${{ inputs.working-directory }} - if: ${{ inputs.langchain-core-location }} - env: - LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }} - run: | - poetry run pip install -e "$LANGCHAIN_CORE_LOCATION" - - name: Install the opposite major version of pydantic # If normal tests use pydantic v1, here we'll use v2, and vice versa. shell: bash diff --git a/.github/workflows/_test.yml b/.github/workflows/_test.yml index 4172b899c31..cd8c7c1ef1a 100644 --- a/.github/workflows/_test.yml +++ b/.github/workflows/_test.yml @@ -11,10 +11,6 @@ on: required: false type: string description: "Relative path to the langchain library folder" - langchain-core-location: - required: false - type: string - description: "Relative path to the langchain core library folder" env: POETRY_VERSION: "1.6.1" @@ -56,14 +52,6 @@ jobs: run: | poetry run pip install -e "$LANGCHAIN_LOCATION" - - name: Install langchain core editable - working-directory: ${{ inputs.working-directory }} - if: ${{ inputs.langchain-core-location }} - env: - LANGCHAIN_CORE_LOCATION: ${{ inputs.langchain-core-location }} - run: | - poetry run pip install -e "$LANGCHAIN_CORE_LOCATION" - - name: Run core tests shell: bash run: | diff --git a/.github/workflows/langchain_ci.yml b/.github/workflows/langchain_ci.yml index b21670c9289..cd145e0612f 100644 --- a/.github/workflows/langchain_ci.yml +++ b/.github/workflows/langchain_ci.yml @@ -3,19 +3,19 @@ name: libs/langchain CI on: push: - branches: [ master ] + branches: [master] pull_request: paths: - - '.github/actions/poetry_setup/action.yml' - - '.github/tools/**' - - '.github/workflows/_lint.yml' - - '.github/workflows/_test.yml' - - '.github/workflows/_pydantic_compatibility.yml' - - '.github/workflows/langchain_ci.yml' - - 'libs/*' - - 'libs/langchain/**' - - 'libs/core/**' - workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI + - ".github/actions/poetry_setup/action.yml" + - ".github/tools/**" + - ".github/workflows/_lint.yml" + - ".github/workflows/_test.yml" + - ".github/workflows/_pydantic_compatibility.yml" + - ".github/workflows/langchain_ci.yml" + - "libs/*" + - "libs/langchain/**" + - "libs/core/**" + workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. @@ -33,77 +33,29 @@ env: jobs: lint: - uses: - ./.github/workflows/_lint.yml + uses: ./.github/workflows/_lint.yml with: working-directory: libs/langchain - langchain-core-location: ../core secrets: inherit test: - uses: - ./.github/workflows/_test.yml + uses: ./.github/workflows/_test.yml with: working-directory: libs/langchain - langchain-core-location: ../core secrets: inherit compile-integration-tests: - uses: - ./.github/workflows/_compile_integration_test.yml + uses: ./.github/workflows/_compile_integration_test.yml with: working-directory: libs/langchain - langchain-core-location: ../core secrets: inherit pydantic-compatibility: - uses: - ./.github/workflows/_pydantic_compatibility.yml + uses: ./.github/workflows/_pydantic_compatibility.yml with: working-directory: libs/langchain - langchain-core-location: ../core secrets: inherit - # It's possible that langchain works fine with the latest *published* langchain-core, - # but is broken with the langchain-core on `master`. - # - # We want to catch situations like that *before* releasing a new langchain-core, hence this test. - test-with-latest-langchain-core: - runs-on: ubuntu-latest - defaults: - run: - working-directory: ${{ env.WORKDIR }} - strategy: - matrix: - python-version: - - "3.8" - - "3.9" - - "3.10" - - "3.11" - name: test with unpublished langchain-core - Python ${{ matrix.python-version }} - steps: - - uses: actions/checkout@v4 - - - name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }} - uses: "./.github/actions/poetry_setup" - with: - python-version: ${{ matrix.python-version }} - poetry-version: ${{ env.POETRY_VERSION }} - working-directory: ${{ env.WORKDIR }} - cache-key: unpublished-langchain-core - - - name: Install dependencies - shell: bash - run: | - echo "Running tests with unpublished langchain, installing dependencies with poetry..." - poetry install - - echo "Editably installing langchain-core outside of poetry, to avoid messing up lockfile..." - poetry run pip install -e ../core - - - name: Run tests - run: make test - extended-tests: runs-on: ubuntu-latest defaults: diff --git a/.github/workflows/langchain_experimental_ci.yml b/.github/workflows/langchain_experimental_ci.yml index 38577b4e5b5..d42daa1c3f0 100644 --- a/.github/workflows/langchain_experimental_ci.yml +++ b/.github/workflows/langchain_experimental_ci.yml @@ -3,19 +3,19 @@ name: libs/experimental CI on: push: - branches: [ master ] + branches: [master] pull_request: paths: - - '.github/actions/poetry_setup/action.yml' - - '.github/tools/**' - - '.github/workflows/_lint.yml' - - '.github/workflows/_test.yml' - - '.github/workflows/langchain_experimental_ci.yml' - - 'libs/*' - - 'libs/experimental/**' - - 'libs/langchain/**' - - 'libs/core/**' - workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI + - ".github/actions/poetry_setup/action.yml" + - ".github/tools/**" + - ".github/workflows/_lint.yml" + - ".github/workflows/_test.yml" + - ".github/workflows/langchain_experimental_ci.yml" + - "libs/*" + - "libs/experimental/**" + - "libs/langchain/**" + - "libs/core/**" + workflow_dispatch: # Allows to trigger the workflow manually in GitHub UI # If another push to the same PR or branch happens while this workflow is still running, # cancel the earlier run in favor of the next run. @@ -33,26 +33,21 @@ env: jobs: lint: - uses: - ./.github/workflows/_lint.yml + uses: ./.github/workflows/_lint.yml with: working-directory: libs/experimental langchain-location: ../langchain - langchain-core-location: ../core secrets: inherit test: - uses: - ./.github/workflows/_test.yml + uses: ./.github/workflows/_test.yml with: working-directory: libs/experimental langchain-location: ../langchain - langchain-core-location: ../core secrets: inherit compile-integration-tests: - uses: - ./.github/workflows/_compile_integration_test.yml + uses: ./.github/workflows/_compile_integration_test.yml with: working-directory: libs/experimental secrets: inherit diff --git a/libs/langchain/poetry.lock b/libs/langchain/poetry.lock index 3db514d2623..5a8045916a1 100644 --- a/libs/langchain/poetry.lock +++ b/libs/langchain/poetry.lock @@ -4178,16 +4178,18 @@ version = "0.0.6" description = "Building applications with LLMs through composability" optional = false python-versions = ">=3.8.1,<4.0" -files = [ - {file = "langchain_core-0.0.6-py3-none-any.whl", hash = "sha256:dcc727ff811159e09fc1d72caae4aaea892611349d5c3fc1c18b3a19573faf27"}, - {file = "langchain_core-0.0.6.tar.gz", hash = "sha256:cffd1031764d838ad2a2f3f64477b710923ddad58eb9fe3130ff94b3669e8dd8"}, -] +files = [] +develop = true [package.dependencies] -jsonpatch = ">=1.33,<2.0" -langsmith = ">=0.0.63,<0.1.0" +jsonpatch = "^1.33" +langsmith = "~0.0.63" pydantic = ">=1,<3" -tenacity = ">=8.1.0,<9.0.0" +tenacity = "^8.1.0" + +[package.source] +type = "directory" +url = "../core" [[package]] name = "langkit" @@ -11194,4 +11196,4 @@ text-helpers = ["chardet"] [metadata] lock-version = "2.0" python-versions = ">=3.8.1,<4.0" -content-hash = "d57493dcdb7c864d71aa43463a57491f0c9cbd8fa8674d21c0b11117e8d7ea67" +content-hash = "d049735bc75655dbdda59770b6f5b2fe9fe3c1985c75e3ad662f0863158f1e7b" diff --git a/libs/langchain/pyproject.toml b/libs/langchain/pyproject.toml index d18b343b499..74d11e5a591 100644 --- a/libs/langchain/pyproject.toml +++ b/libs/langchain/pyproject.toml @@ -165,6 +165,7 @@ pytest-mock = "^3.10.0" pytest-socket = "^0.6.0" syrupy = "^4.0.2" requests-mock = "^1.11.0" +langchain-core = {path = "../core", develop = true} [tool.poetry.group.codespell.dependencies] diff --git a/libs/langchain/tests/unit_tests/test_dependencies.py b/libs/langchain/tests/unit_tests/test_dependencies.py index adb9ae2649b..2d326dcbbc0 100644 --- a/libs/langchain/tests/unit_tests/test_dependencies.py +++ b/libs/langchain/tests/unit_tests/test_dependencies.py @@ -74,6 +74,7 @@ def test_test_group_dependencies(poetry_conf: Mapping[str, Any]) -> None: [ "duckdb-engine", "freezegun", + "langchain-core", "lark", "pandas", "pytest",