Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
67 commits
Select commit Hold shift + click to select a range
c3b7676
feat: drop 3.9, switch to uv, + others (#1097)
mdrxy Aug 28, 2025
f71be67
bump deps
mdrxy Aug 28, 2025
eae8665
bump community deps
mdrxy Aug 28, 2025
77ae63f
nit
mdrxy Aug 28, 2025
7c50dee
Apply patch [skip ci]
open-swe Sep 4, 2025
c75be7e
Apply patch [skip ci]
open-swe Sep 4, 2025
b1e8bb9
Apply patch [skip ci]
open-swe Sep 4, 2025
c5e5da0
Apply patch [skip ci]
open-swe Sep 4, 2025
85d259f
Apply patch [skip ci]
open-swe Sep 4, 2025
bae9d32
Apply patch [skip ci]
open-swe Sep 4, 2025
ec7a124
Apply patch [skip ci]
open-swe Sep 4, 2025
01a40d1
Apply patch [skip ci]
open-swe Sep 4, 2025
ea6765e
Apply patch [skip ci]
open-swe Sep 4, 2025
7027932
Apply patch [skip ci]
open-swe Sep 4, 2025
ad67df3
Apply patch [skip ci]
open-swe Sep 4, 2025
eb894d4
Apply patch [skip ci]
open-swe Sep 4, 2025
a25699b
Apply patch [skip ci]
open-swe Sep 4, 2025
fcc00e8
Apply patch [skip ci]
open-swe Sep 4, 2025
9d03f0b
Apply patch [skip ci]
open-swe Sep 4, 2025
743e30a
Apply patch [skip ci]
open-swe Sep 4, 2025
5d540fd
Apply patch [skip ci]
open-swe Sep 4, 2025
fa6be86
Apply patch [skip ci]
open-swe Sep 4, 2025
a00c763
Apply patch [skip ci]
open-swe Sep 4, 2025
b9ece93
Apply patch [skip ci]
open-swe Sep 4, 2025
19bac68
Apply patch [skip ci]
open-swe Sep 4, 2025
a441d72
Apply patch [skip ci]
open-swe Sep 4, 2025
1dd1145
Apply patch [skip ci]
open-swe Sep 4, 2025
4b833a5
Apply patch [skip ci]
open-swe Sep 4, 2025
8fbd155
Apply patch [skip ci]
open-swe Sep 4, 2025
626ef8a
Apply patch [skip ci]
open-swe Sep 4, 2025
48c45ed
Apply patch [skip ci]
open-swe Sep 4, 2025
b0a549e
Apply patch [skip ci]
open-swe Sep 4, 2025
9a9d8d2
Apply patch [skip ci]
open-swe Sep 4, 2025
f5471cb
Apply patch [skip ci]
open-swe Sep 4, 2025
3f27ed6
Apply patch [skip ci]
open-swe Sep 4, 2025
6b0a14d
Apply patch [skip ci]
open-swe Sep 4, 2025
500d0ea
Apply patch [skip ci]
open-swe Sep 4, 2025
b75c612
Apply patch [skip ci]
open-swe Sep 4, 2025
c79aa12
Apply patch [skip ci]
open-swe Sep 4, 2025
e0b31fd
Apply patch [skip ci]
open-swe Sep 4, 2025
bdda01c
Apply patch [skip ci]
open-swe Sep 4, 2025
9992096
Apply patch [skip ci]
open-swe Sep 4, 2025
072879b
Apply patch [skip ci]
open-swe Sep 4, 2025
ca66b1f
Apply patch [skip ci]
open-swe Sep 4, 2025
e8a32f9
Apply patch [skip ci]
open-swe Sep 4, 2025
23da1b3
Apply patch [skip ci]
open-swe Sep 4, 2025
929fb3b
Apply patch [skip ci]
open-swe Sep 4, 2025
c26264c
Apply patch [skip ci]
open-swe Sep 4, 2025
f644e0c
Apply patch [skip ci]
open-swe Sep 4, 2025
cc42e8a
Apply patch [skip ci]
open-swe Sep 4, 2025
031a40e
Apply patch [skip ci]
open-swe Sep 4, 2025
71fea56
Apply patch [skip ci]
open-swe Sep 4, 2025
f695d23
Apply patch [skip ci]
open-swe Sep 4, 2025
a869c2f
Apply patch [skip ci]
open-swe Sep 4, 2025
ea60b8f
Apply patch [skip ci]
open-swe Sep 4, 2025
e84b045
Apply patch [skip ci]
open-swe Sep 4, 2025
1fed39b
Apply patch [skip ci]
open-swe Sep 4, 2025
e6cfd89
Apply patch [skip ci]
open-swe Sep 4, 2025
d1a8fdd
Apply patch [skip ci]
open-swe Sep 4, 2025
c341b66
Apply patch [skip ci]
open-swe Sep 4, 2025
77adc1f
Apply patch [skip ci]
open-swe Sep 4, 2025
b98261e
Apply patch [skip ci]
open-swe Sep 4, 2025
d311b62
Apply patch [skip ci]
open-swe Sep 4, 2025
47e9f01
Apply patch [skip ci]
open-swe Sep 4, 2025
4cbf39f
Apply patch [skip ci]
open-swe Sep 4, 2025
46f138a
Apply patch [skip ci]
open-swe Sep 4, 2025
a0a2903
Apply patch [skip ci]
open-swe Sep 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
93 changes: 0 additions & 93 deletions .github/actions/poetry_setup/action.yml

This file was deleted.

39 changes: 39 additions & 0 deletions .github/actions/uv_setup/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# An action for setting up uv with caching.
name: uv-install-with-caching
description: uv install with support for caching of dependency groups.

inputs:
python-version:
description: Python version, supporting MAJOR.MINOR only
required: true

cache-key:
description: Cache key to use for manual handling of caching
required: true

working-directory:
description: Directory whose uv.lock file should be cached
required: true

runs:
using: composite
steps:
- uses: actions/setup-python@v5
name: Setup python ${{ inputs.python-version }}
id: setup-python
with:
python-version: ${{ inputs.python-version }}

- name: Install uv
uses: astral-sh/setup-uv@v4

- name: Restore uv cached dependencies
uses: actions/cache@v4
env:
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "4"
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
with:
path: |
~/.cache/uv
${{ env.WORKDIR }}/.venv
key: uv-deps-${{ runner.os }}-${{ runner.arch }}-py-${{ inputs.python-version }}-${{ inputs.cache-key }}-${{ hashFiles(format('{0}/**/uv.lock', env.WORKDIR)) }}
21 changes: 19 additions & 2 deletions .github/scripts/get_min_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,25 @@ def get_min_version_from_toml(toml_path: str, versions_for: str):
with open(toml_path, "rb") as file:
toml_data = tomllib.load(file)

# Get the dependencies from tool.poetry.dependencies
dependencies = toml_data["tool"]["poetry"]["dependencies"]
# Get the dependencies from project.dependencies
dependencies_list = toml_data.get("project", {}).get("dependencies", [])

# Convert list format to dict format for compatibility
dependencies = {}
for dep in dependencies_list:
if "==" in dep:
name, version = dep.split("==", 1)
elif ">=" in dep and "<" in dep:
# Handle >=x,<y format
name = dep.split(">=")[0]
version = dep.split(">=")[1]
elif ">=" in dep:
name = dep.split(">=")[0]
version = dep.split(">=")[1]
else:
# Skip complex dependencies for now
continue
dependencies[name] = version

# Initialize a dictionary to store the minimum versions
min_versions = {}
Expand Down
39 changes: 0 additions & 39 deletions .github/workflows/_codespell.yml

This file was deleted.

19 changes: 10 additions & 9 deletions .github/workflows/_compile_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ on:
type: string
description: "From which folder this pipeline executes"

env:
POETRY_VERSION: "1.7.1"

jobs:
build:
Expand All @@ -20,29 +18,32 @@ jobs:
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
- "3.11"
- "3.12"
name: "poetry run pytest -m compile tests/integration_tests #${{ matrix.python-version }}"
name: "uv run pytest -m compile tests/integration_tests #${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_setup"
- name: Set up Python ${{ matrix.python-version }} + uv
uses: "./.github/actions/uv_setup"
with:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}
cache-key: compile-integration

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libqpdf-dev

- name: Install integration dependencies
shell: bash
run: poetry install --with=test_integration,test
run: uv sync --group test_integration --group test

- name: Check integration tests compile
shell: bash
run: poetry run pytest -m compile tests/integration_tests
run: uv run pytest -m compile tests/integration_tests

- name: Ensure the tests did not create any additional files
shell: bash
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
type: string
description: "Python version to use"

env:
POETRY_VERSION: "1.7.1"

jobs:
build:
defaults:
Expand All @@ -24,17 +21,21 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_setup"
- name: Set up Python ${{ inputs.python-version }} + uv
uses: "./.github/actions/uv_setup"
with:
python-version: ${{ inputs.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}
cache-key: core

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y libqpdf-dev

- name: Install dependencies
shell: bash
run: poetry install --with test,test_integration
run: uv sync --group test --group test_integration

- name: 'Authenticate to Google Cloud'
id: 'auth'
Expand Down
32 changes: 12 additions & 20 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ on:
description: "Relative path to the langchain library folder"

env:
POETRY_VERSION: "1.7.1"
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}

# This env var allows us to get inline annotations when ruff has complaints.
Expand All @@ -33,30 +32,23 @@ jobs:
# Starting new jobs is also relatively slow,
# so linting on fewer versions makes CI faster.
python-version:
- "3.9"
- "3.10"
- "3.12"
steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./.github/actions/poetry_setup"
- name: Set up Python ${{ matrix.python-version }} + uv
uses: "./.github/actions/uv_setup"
with:
python-version: ${{ matrix.python-version }}
poetry-version: ${{ env.POETRY_VERSION }}
working-directory: ${{ inputs.working-directory }}
cache-key: lint-with-extras

- name: Check Poetry File
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
poetry check

- name: Check lock file
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
poetry lock --check
uv lock --check

- name: Install dependencies
# Also installs dev/lint/test/typing dependencies, to ensure we have
Expand All @@ -65,19 +57,19 @@ jobs:
# https://github.com/langchain-ai/langchain/pull/10249/files#diff-935185cd488d015f026dcd9e19616ff62863e8cde8c0bee70318d3ccbca98341
#
# If you change this configuration, make sure to change the `cache-key`
# in the `poetry_setup` action above to stop using the old cache.
# in the `uv_setup` action above to stop using the old cache.
# It doesn't matter how you change it, any change will cause a cache-bust.
working-directory: ${{ inputs.working-directory }}
run: |
poetry install --with lint,typing --all-extras
uv sync --group lint --group typing --all-extras

- name: Install langchain editable
working-directory: ${{ inputs.working-directory }}
if: ${{ inputs.langchain-location }}
env:
LANGCHAIN_LOCATION: ${{ inputs.langchain-location }}
run: |
poetry run pip install -e "$LANGCHAIN_LOCATION"
uv pip install -e "$LANGCHAIN_LOCATION"

- name: Get .mypy_cache to speed up mypy
uses: actions/cache@v4
Expand All @@ -86,7 +78,7 @@ jobs:
with:
path: |
${{ env.WORKDIR }}/.mypy_cache
key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/uv.lock', inputs.working-directory)) }}

- name: Analysing the code with our lint
working-directory: ${{ inputs.working-directory }}
Expand All @@ -100,17 +92,17 @@ jobs:
# https://github.com/langchain-ai/langchain/pull/10249/files#diff-935185cd488d015f026dcd9e19616ff62863e8cde8c0bee70318d3ccbca98341
#
# If you change this configuration, make sure to change the `cache-key`
# in the `poetry_setup` action above to stop using the old cache.
# in the `uv_setup` action above to stop using the old cache.
# It doesn't matter how you change it, any change will cause a cache-bust.
if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') }}
working-directory: ${{ inputs.working-directory }}
run: |
poetry install --with test
uv sync --group test
- name: Install unit+integration test dependencies
if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}
working-directory: ${{ inputs.working-directory }}
run: |
poetry install --with test,test_integration
uv sync --group test --group test_integration

- name: Get .mypy_cache_test to speed up mypy
uses: actions/cache@v4
Expand All @@ -119,7 +111,7 @@ jobs:
with:
path: |
${{ env.WORKDIR }}/.mypy_cache_test
key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ matrix.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/uv.lock', inputs.working-directory)) }}

- name: Analysing the code with our lint
working-directory: ${{ inputs.working-directory }}
Expand Down
Loading