mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-24 07:35:18 +00:00
infra: fix doc imports ci (#20629)
This commit is contained in:
parent
3425988de7
commit
726234eee5
4
.github/scripts/check_diff.py
vendored
4
.github/scripts/check_diff.py
vendored
@ -19,6 +19,7 @@ if __name__ == "__main__":
|
|||||||
"test": set(),
|
"test": set(),
|
||||||
"extended-test": set(),
|
"extended-test": set(),
|
||||||
}
|
}
|
||||||
|
docs_edited = False
|
||||||
|
|
||||||
if len(files) == 300:
|
if len(files) == 300:
|
||||||
# max diff length is 300 files - there are likely files missing
|
# max diff length is 300 files - there are likely files missing
|
||||||
@ -76,6 +77,8 @@ if __name__ == "__main__":
|
|||||||
"an update for this new library!"
|
"an update for this new library!"
|
||||||
)
|
)
|
||||||
elif any(file.startswith(p) for p in ["docs/", "templates/", "cookbook/"]):
|
elif any(file.startswith(p) for p in ["docs/", "templates/", "cookbook/"]):
|
||||||
|
if file.startswith("docs/"):
|
||||||
|
docs_edited = True
|
||||||
dirs_to_run["lint"].add(".")
|
dirs_to_run["lint"].add(".")
|
||||||
|
|
||||||
outputs = {
|
outputs = {
|
||||||
@ -84,6 +87,7 @@ if __name__ == "__main__":
|
|||||||
),
|
),
|
||||||
"dirs-to-test": list(dirs_to_run["test"] | dirs_to_run["extended-test"]),
|
"dirs-to-test": list(dirs_to_run["test"] | dirs_to_run["extended-test"]),
|
||||||
"dirs-to-extended-test": list(dirs_to_run["extended-test"]),
|
"dirs-to-extended-test": list(dirs_to_run["extended-test"]),
|
||||||
|
"docs-edited": "true" if docs_edited else "",
|
||||||
}
|
}
|
||||||
for key, value in outputs.items():
|
for key, value in outputs.items():
|
||||||
json_output = json.dumps(value)
|
json_output = json.dumps(value)
|
||||||
|
3
.github/workflows/check_diffs.yml
vendored
3
.github/workflows/check_diffs.yml
vendored
@ -36,6 +36,7 @@ jobs:
|
|||||||
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
|
dirs-to-lint: ${{ steps.set-matrix.outputs.dirs-to-lint }}
|
||||||
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
|
dirs-to-test: ${{ steps.set-matrix.outputs.dirs-to-test }}
|
||||||
dirs-to-extended-test: ${{ steps.set-matrix.outputs.dirs-to-extended-test }}
|
dirs-to-extended-test: ${{ steps.set-matrix.outputs.dirs-to-extended-test }}
|
||||||
|
docs-edited: ${{ steps.set-matrix.outputs.docs-edited }}
|
||||||
lint:
|
lint:
|
||||||
name: cd ${{ matrix.working-directory }}
|
name: cd ${{ matrix.working-directory }}
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
@ -62,7 +63,7 @@ jobs:
|
|||||||
|
|
||||||
test_doc_imports:
|
test_doc_imports:
|
||||||
needs: [ build ]
|
needs: [ build ]
|
||||||
if: ${{ needs.build.outputs.dirs-to-test != '[]' }}
|
if: ${{ needs.build.outputs.dirs-to-test != '[]' || needs.build.outputs.docs-edited }}
|
||||||
uses: ./.github/workflows/_test_doc_imports.yml
|
uses: ./.github/workflows/_test_doc_imports.yml
|
||||||
secrets: inherit
|
secrets: inherit
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@
|
|||||||
],
|
],
|
||||||
"source": [
|
"source": [
|
||||||
"from langchain_chroma import Chroma\n",
|
"from langchain_chroma import Chroma\n",
|
||||||
"from langchain_core.prompts.example_selector import SemanticSimilarityExampleSelector\n",
|
"from langchain_core.example_selectors import SemanticSimilarityExampleSelector\n",
|
||||||
"from langchain_openai import OpenAIEmbeddings\n",
|
"from langchain_openai import OpenAIEmbeddings\n",
|
||||||
"\n",
|
"\n",
|
||||||
"example_selector = SemanticSimilarityExampleSelector.from_examples(\n",
|
"example_selector = SemanticSimilarityExampleSelector.from_examples(\n",
|
||||||
|
@ -202,7 +202,7 @@
|
|||||||
"outputs": [],
|
"outputs": [],
|
||||||
"source": [
|
"source": [
|
||||||
"from langchain_chroma import Chroma\n",
|
"from langchain_chroma import Chroma\n",
|
||||||
"from langchain_core.prompts import SemanticSimilarityExampleSelector\n",
|
"from langchain_core.example_selectors import SemanticSimilarityExampleSelector\n",
|
||||||
"from langchain_openai import OpenAIEmbeddings"
|
"from langchain_openai import OpenAIEmbeddings"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user