mirror of
https://github.com/hwchase17/langchain.git
synced 2025-08-13 06:40:04 +00:00
update workflows
This commit is contained in:
parent
b7bdf0b81a
commit
aa7637b2e4
16
.github/workflows/_compile_integration_test.yml
vendored
16
.github/workflows/_compile_integration_test.yml
vendored
@ -12,9 +12,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: "Python version to use"
|
description: "Python version to use"
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
defaults:
|
defaults:
|
||||||
@ -22,25 +19,22 @@ jobs:
|
|||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
timeout-minutes: 20
|
timeout-minutes: 20
|
||||||
name: "poetry run pytest -m compile tests/integration_tests #${{ inputs.python-version }}"
|
name: "uv run pytest -m compile tests/integration_tests #${{ inputs.python-version }}"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ inputs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
poetry-version: ${{ env.POETRY_VERSION }}
|
|
||||||
working-directory: ${{ inputs.working-directory }}
|
|
||||||
cache-key: compile-integration
|
|
||||||
|
|
||||||
- name: Install integration dependencies
|
- name: Install integration dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry install --with=test_integration,test
|
run: uv sync --group test --group test_integration
|
||||||
|
|
||||||
- name: Check integration tests compile
|
- name: Check integration tests compile
|
||||||
shell: bash
|
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
|
- name: Ensure the tests did not create any additional files
|
||||||
shell: bash
|
shell: bash
|
||||||
|
14
.github/workflows/_integration_test.yml
vendored
14
.github/workflows/_integration_test.yml
vendored
@ -11,9 +11,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: "Python version to use"
|
description: "Python version to use"
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
defaults:
|
defaults:
|
||||||
@ -24,22 +21,19 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ inputs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
poetry-version: ${{ env.POETRY_VERSION }}
|
|
||||||
working-directory: ${{ inputs.working-directory }}
|
|
||||||
cache-key: core
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry install --with test,test_integration
|
run: uv sync --group test --group test_integration
|
||||||
|
|
||||||
- name: Install deps outside pyproject
|
- name: Install deps outside pyproject
|
||||||
if: ${{ startsWith(inputs.working-directory, 'libs/community/') }}
|
if: ${{ startsWith(inputs.working-directory, 'libs/community/') }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry run pip install "boto3<2" "google-cloud-aiplatform<2"
|
run: uv pip install "boto3<2" "google-cloud-aiplatform<2"
|
||||||
|
|
||||||
- name: Run integration tests
|
- name: Run integration tests
|
||||||
shell: bash
|
shell: bash
|
||||||
|
47
.github/workflows/_lint.yml
vendored
47
.github/workflows/_lint.yml
vendored
@ -13,7 +13,6 @@ on:
|
|||||||
description: "Python version to use"
|
description: "Python version to use"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
|
WORKDIR: ${{ inputs.working-directory == '' && '.' || inputs.working-directory }}
|
||||||
|
|
||||||
# This env var allows us to get inline annotations when ruff has complaints.
|
# This env var allows us to get inline annotations when ruff has complaints.
|
||||||
@ -27,25 +26,10 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ inputs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.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
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
# Also installs dev/lint/test/typing dependencies, to ensure we have
|
||||||
@ -58,17 +42,7 @@ jobs:
|
|||||||
# It doesn't matter how you change it, any change will cause a cache-bust.
|
# It doesn't matter how you change it, any change will cause a cache-bust.
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
poetry install --with lint,typing
|
uv sync --group lint --group typing
|
||||||
|
|
||||||
- name: Get .mypy_cache to speed up mypy
|
|
||||||
uses: actions/cache@v4
|
|
||||||
env:
|
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ env.WORKDIR }}/.mypy_cache
|
|
||||||
key: mypy-lint-${{ runner.os }}-${{ runner.arch }}-py${{ inputs.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
|
|
||||||
|
|
||||||
|
|
||||||
- name: Analysing the code with our lint
|
- name: Analysing the code with our lint
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
@ -87,21 +61,12 @@ jobs:
|
|||||||
if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') }}
|
if: ${{ ! startsWith(inputs.working-directory, 'libs/partners/') }}
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
run: |
|
||||||
poetry install --with test
|
uv sync --group test
|
||||||
- name: Install unit+integration test dependencies
|
- name: Install unit+integration test dependencies
|
||||||
if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}
|
if: ${{ startsWith(inputs.working-directory, 'libs/partners/') }}
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
run: |
|
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
|
|
||||||
env:
|
|
||||||
SEGMENT_DOWNLOAD_TIMEOUT_MIN: "2"
|
|
||||||
with:
|
|
||||||
path: |
|
|
||||||
${{ env.WORKDIR }}/.mypy_cache_test
|
|
||||||
key: mypy-test-${{ runner.os }}-${{ runner.arch }}-py${{ inputs.python-version }}-${{ inputs.working-directory }}-${{ hashFiles(format('{0}/poetry.lock', inputs.working-directory)) }}
|
|
||||||
|
|
||||||
- name: Analysing the code with our lint
|
- name: Analysing the code with our lint
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
21
.github/workflows/_test.yml
vendored
21
.github/workflows/_test.yml
vendored
@ -12,9 +12,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: "Python version to use"
|
description: "Python version to use"
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
defaults:
|
defaults:
|
||||||
@ -26,17 +23,14 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ inputs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
id: setup-python
|
id: setup-python
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
poetry-version: ${{ env.POETRY_VERSION }}
|
|
||||||
working-directory: ${{ inputs.working-directory }}
|
|
||||||
cache-key: core
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry install --with test
|
run: uv sync --all-extras --dev
|
||||||
|
|
||||||
- name: Run core tests
|
- name: Run core tests
|
||||||
shell: bash
|
shell: bash
|
||||||
@ -48,9 +42,9 @@ jobs:
|
|||||||
id: min-version
|
id: min-version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
poetry run pip install packaging tomli requests
|
uv run pip install packaging tomli requests
|
||||||
python_version="$(poetry run python --version | awk '{print $2}')"
|
python_version="$(uv run python --version | awk '{print $2}')"
|
||||||
min_versions="$(poetry run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request $python_version)"
|
min_versions="$(uv run python $GITHUB_WORKSPACE/.github/scripts/get_min_versions.py pyproject.toml pull_request $python_version)"
|
||||||
echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
|
echo "min-versions=$min_versions" >> "$GITHUB_OUTPUT"
|
||||||
echo "min-versions=$min_versions"
|
echo "min-versions=$min_versions"
|
||||||
|
|
||||||
@ -59,8 +53,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}
|
MIN_VERSIONS: ${{ steps.min-version.outputs.min-versions }}
|
||||||
run: |
|
run: |
|
||||||
poetry run pip install uv
|
uv run pip install $MIN_VERSIONS
|
||||||
poetry run uv pip install $MIN_VERSIONS
|
|
||||||
make tests
|
make tests
|
||||||
working-directory: ${{ inputs.working-directory }}
|
working-directory: ${{ inputs.working-directory }}
|
||||||
|
|
||||||
|
14
.github/workflows/_test_pydantic.yml
vendored
14
.github/workflows/_test_pydantic.yml
vendored
@ -17,9 +17,6 @@ on:
|
|||||||
type: string
|
type: string
|
||||||
description: "Pydantic version to test."
|
description: "Pydantic version to test."
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
defaults:
|
defaults:
|
||||||
@ -31,21 +28,18 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ inputs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ inputs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
poetry-version: ${{ env.POETRY_VERSION }}
|
|
||||||
working-directory: ${{ inputs.working-directory }}
|
|
||||||
cache-key: core
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry install --with test
|
run: uv sync --group test
|
||||||
|
|
||||||
- name: Overwrite pydantic version
|
- name: Overwrite pydantic version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: poetry run pip install pydantic~=${{ inputs.pydantic-version }}
|
run: uv pip install pydantic~=${{ inputs.pydantic-version }}
|
||||||
|
|
||||||
- name: Run core tests
|
- name: Run core tests
|
||||||
shell: bash
|
shell: bash
|
||||||
|
17
.github/workflows/check_diffs.yml
vendored
17
.github/workflows/check_diffs.yml
vendored
@ -17,9 +17,6 @@ concurrency:
|
|||||||
group: ${{ github.workflow }}-${{ github.ref }}
|
group: ${{ github.workflow }}-${{ github.ref }}
|
||||||
cancel-in-progress: true
|
cancel-in-progress: true
|
||||||
|
|
||||||
env:
|
|
||||||
POETRY_VERSION: "1.8.4"
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -127,21 +124,17 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Python ${{ matrix.job-configs.python-version }} + Poetry ${{ env.POETRY_VERSION }}
|
- name: Set up Python ${{ matrix.job-configs.python-version }} + uv
|
||||||
uses: "./.github/actions/poetry_setup"
|
uses: "./.github/actions/uv_setup"
|
||||||
with:
|
with:
|
||||||
python-version: ${{ matrix.job-configs.python-version }}
|
python-version: ${{ matrix.job-configs.python-version }}
|
||||||
poetry-version: ${{ env.POETRY_VERSION }}
|
|
||||||
working-directory: ${{ matrix.job-configs.working-directory }}
|
|
||||||
cache-key: extended
|
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
echo "Running extended tests, installing dependencies with poetry..."
|
echo "Running extended tests, installing dependencies with uv..."
|
||||||
poetry install --with test
|
uv sync --group test
|
||||||
poetry run pip install uv
|
uv pip install -r extended_testing_deps.txt
|
||||||
poetry run uv pip install -r extended_testing_deps.txt
|
|
||||||
|
|
||||||
- name: Run extended tests
|
- name: Run extended tests
|
||||||
run: make extended_tests
|
run: make extended_tests
|
||||||
|
Loading…
Reference in New Issue
Block a user