Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions .github/scripts/check_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@
"libs/trt",
]

PYTHON_VERSIONS = {
"libs/ai-endpoints": ["3.10", "3.11", "3.12", "3.13"],
"libs/trt": ["3.8", "3.9", "3.10", "3.11"],
}

LINT_PYTHON_VERSIONS = {
"libs/ai-endpoints": ["3.10", "3.13"],
"libs/trt": ["3.8", "3.11"],
}

if __name__ == "__main__":
files = sys.argv[1:]

Expand Down Expand Up @@ -48,11 +58,29 @@
# elif any(file.startswith(p) for p in ["docs/", "templates/", "cookbook/"]):
# dirs_to_run["lint"].add(".")

test_matrix = [
{
"working-directory": dir_,
"python-versions": json.dumps(PYTHON_VERSIONS.get(dir_, ["3.8", "3.9", "3.10", "3.11"]))
}
for dir_ in dirs_to_run["test"]
]

lint_matrix = [
{
"working-directory": dir_,
"python-versions": json.dumps(LINT_PYTHON_VERSIONS.get(dir_, ["3.8", "3.11"]))
}
for dir_ in (dirs_to_run["lint"] | dirs_to_run["test"])
]

outputs = {
"dirs-to-lint": list(
dirs_to_run["lint"] | dirs_to_run["test"]
),
"dirs-to-test": list(dirs_to_run["test"]),
"test-matrix": test_matrix,
"lint-matrix": lint_matrix,
}
for key, value in outputs.items():
json_output = json.dumps(value)
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/_compile_integration_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
required: true
type: string
description: "From which folder this pipeline executes"
python-versions:
required: false
type: string
default: '["3.8", "3.9", "3.10", "3.11"]'
description: "JSON array of Python versions to test"

env:
POETRY_VERSION: "1.7.1"
Expand All @@ -19,11 +24,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
python-version: ${{ fromJson(inputs.python-versions) }}
name: "poetry run pytest -m compile tests/integration_tests #${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/_lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
type: string
description: "Relative path to the langchain library folder"
python-versions:
required: false
type: string
default: '["3.8", "3.11"]'
description: "JSON array of Python versions to lint (should be min and max supported versions)"

env:
POETRY_VERSION: "1.7.1"
Expand All @@ -32,9 +37,7 @@ jobs:
# GitHub rate-limits how many jobs can be running at any one time.
# Starting new jobs is also relatively slow,
# so linting on fewer versions makes CI faster.
python-version:
- "3.8"
- "3.11"
python-version: ${{ fromJson(inputs.python-versions) }}
steps:
- uses: actions/checkout@v4

Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/_scheduled_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,15 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version:
- "3.8"
- "3.11"
working-directory:
- "libs/ai-endpoints"
- "libs/trt"
include:
- python-version: "3.8"
working-directory: "libs/trt"
- python-version: "3.11"
working-directory: "libs/trt"
- python-version: "3.11"
working-directory: "libs/ai-endpoints"
- python-version: "3.13"
working-directory: "libs/ai-endpoints"

steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 6 additions & 5 deletions .github/workflows/_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ on:
required: false
type: string
description: "Relative path to the langchain library folder"
python-versions:
required: false
type: string
default: '["3.8", "3.9", "3.10", "3.11"]'
description: "JSON array of Python versions to test"

env:
POETRY_VERSION: "1.7.1"
Expand All @@ -23,11 +28,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
python-version: ${{ fromJson(inputs.python-versions) }}
name: "make test #${{ matrix.python-version }}"
steps:
- uses: actions/checkout@v4
Expand Down
29 changes: 17 additions & 12 deletions .github/workflows/check_diffs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,42 +35,47 @@
outputs:
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
test-matrix: ${{ steps.set-matrix.outputs.test-matrix }}
lint-matrix: ${{ steps.set-matrix.outputs.lint-matrix }}
lint:
name: cd ${{ matrix.working-directory }}
name: cd ${{ matrix.config.working-directory }}
needs: [ build ]
if: ${{ needs.build.outputs.dirs-to-lint != '[]' }}
if: ${{ needs.build.outputs.lint-matrix != '[]' }}
strategy:
matrix:
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-lint) }}
config: ${{ fromJson(needs.build.outputs.lint-matrix) }}
uses: ./.github/workflows/_lint.yml
with:
working-directory: ${{ matrix.working-directory }}
working-directory: ${{ matrix.config.working-directory }}
python-versions: ${{ matrix.config.python-versions }}
secrets: inherit

test:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: cd ${{ matrix.working-directory }}
name: cd ${{ matrix.config.working-directory }}
needs: [ build ]
if: ${{ needs.build.outputs.dirs-to-test != '[]' }}
if: ${{ needs.build.outputs.test-matrix != '[]' }}
strategy:
matrix:
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-test) }}
config: ${{ fromJson(needs.build.outputs.test-matrix) }}
uses: ./.github/workflows/_test.yml
with:
working-directory: ${{ matrix.working-directory }}
working-directory: ${{ matrix.config.working-directory }}
python-versions: ${{ matrix.config.python-versions }}
secrets: inherit

compile-integration-tests:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: cd ${{ matrix.working-directory }}
name: cd ${{ matrix.config.working-directory }}
needs: [ build ]
if: ${{ needs.build.outputs.dirs-to-test != '[]' }}
if: ${{ needs.build.outputs.test-matrix != '[]' }}
strategy:
matrix:
working-directory: ${{ fromJson(needs.build.outputs.dirs-to-test) }}
config: ${{ fromJson(needs.build.outputs.test-matrix) }}
uses: ./.github/workflows/_compile_integration_test.yml
with:
working-directory: ${{ matrix.working-directory }}
working-directory: ${{ matrix.config.working-directory }}
python-versions: ${{ matrix.config.python-versions }}
secrets: inherit
ci_success:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {}
name: "CI Success"
needs: [build, lint, test, compile-integration-tests]
if: |
Expand Down
58 changes: 5 additions & 53 deletions libs/ai-endpoints/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion libs/ai-endpoints/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ packages = [
"Source Code" = "https://github.com/langchain-ai/langchain-nvidia/tree/main/libs/ai-endpoints"

[tool.poetry.dependencies]
python = ">=3.9,<4.0"
python = ">=3.10,<4.0"
langchain-core = ">=0.3.51"
aiohttp = "^3.9.1"
filetype = "^1.2.0"
Expand Down
Loading