mirror of
https://github.com/hwchase17/langchain.git
synced 2026-02-21 22:56:05 +00:00
Use docusaurus versioning with a callout, merged master as well @hwchase17 @baskaryan --------- Signed-off-by: Weichen Xu <weichen.xu@databricks.com> Signed-off-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: Leonid Ganeline <leo.gan.57@gmail.com> Co-authored-by: Leonid Kuligin <lkuligin@yandex.ru> Co-authored-by: Averi Kitsch <akitsch@google.com> Co-authored-by: Erick Friis <erick@langchain.dev> Co-authored-by: Nuno Campos <nuno@langchain.dev> Co-authored-by: Nuno Campos <nuno@boringbits.io> Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com> Co-authored-by: Eugene Yurtsev <eyurtsev@gmail.com> Co-authored-by: Martín Gotelli Ferenaz <martingotelliferenaz@gmail.com> Co-authored-by: Fayfox <admin@fayfox.com> Co-authored-by: Eugene Yurtsev <eugene@langchain.dev> Co-authored-by: Dawson Bauer <105886620+djbauer2@users.noreply.github.com> Co-authored-by: Ravindu Somawansa <ravindu.somawansa@gmail.com> Co-authored-by: Dhruv Chawla <43818888+Dominastorm@users.noreply.github.com> Co-authored-by: ccurme <chester.curme@gmail.com> Co-authored-by: Bagatur <baskaryan@gmail.com> Co-authored-by: WeichenXu <weichen.xu@databricks.com> Co-authored-by: Benito Geordie <89472452+benitoThree@users.noreply.github.com> Co-authored-by: kartikTAI <129414343+kartikTAI@users.noreply.github.com> Co-authored-by: Kartik Sarangmath <kartik@thirdai.com> Co-authored-by: Sevin F. Varoglu <sfvaroglu@octoml.ai> Co-authored-by: MacanPN <martin.triska@gmail.com> Co-authored-by: Prashanth Rao <35005448+prrao87@users.noreply.github.com> Co-authored-by: Hyeongchan Kim <kozistr@gmail.com> Co-authored-by: sdan <git@sdan.io> Co-authored-by: Guangdong Liu <liugddx@gmail.com> Co-authored-by: Rahul Triptahi <rahul.psit.ec@gmail.com> Co-authored-by: Rahul Tripathi <rauhl.psit.ec@gmail.com> Co-authored-by: pjb157 <84070455+pjb157@users.noreply.github.com> Co-authored-by: Eun Hye Kim <ehkim1440@gmail.com> Co-authored-by: kaijietti <43436010+kaijietti@users.noreply.github.com> Co-authored-by: Pengcheng Liu <pcliu.fd@gmail.com> Co-authored-by: Tomer Cagan <tomer@tomercagan.com> Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
91 lines
3.3 KiB
Python
91 lines
3.3 KiB
Python
import json
|
|
import sys
|
|
import os
|
|
from typing import Dict
|
|
|
|
LANGCHAIN_DIRS = [
|
|
"libs/core",
|
|
"libs/text-splitters",
|
|
"libs/community",
|
|
"libs/langchain",
|
|
"libs/experimental",
|
|
]
|
|
|
|
if __name__ == "__main__":
|
|
files = sys.argv[1:]
|
|
|
|
dirs_to_run: Dict[str, set] = {
|
|
"lint": set(),
|
|
"test": set(),
|
|
"extended-test": set(),
|
|
}
|
|
|
|
if len(files) == 300:
|
|
# max diff length is 300 files - there are likely files missing
|
|
raise ValueError("Max diff reached. Please manually run CI on changed libs.")
|
|
|
|
for file in files:
|
|
if any(
|
|
file.startswith(dir_)
|
|
for dir_ in (
|
|
".github/workflows",
|
|
".github/tools",
|
|
".github/actions",
|
|
".github/scripts/check_diff.py",
|
|
)
|
|
):
|
|
# add all LANGCHAIN_DIRS for infra changes
|
|
dirs_to_run["extended-test"].update(LANGCHAIN_DIRS)
|
|
dirs_to_run["lint"].add(".")
|
|
|
|
if any(file.startswith(dir_) for dir_ in LANGCHAIN_DIRS):
|
|
# add that dir and all dirs after in LANGCHAIN_DIRS
|
|
# for extended testing
|
|
found = False
|
|
for dir_ in LANGCHAIN_DIRS:
|
|
if file.startswith(dir_):
|
|
found = True
|
|
if found:
|
|
dirs_to_run["extended-test"].add(dir_)
|
|
elif file.startswith("libs/standard-tests"):
|
|
# TODO: update to include all packages that rely on standard-tests (all partner packages)
|
|
# note: won't run on external repo partners
|
|
dirs_to_run["lint"].add("libs/standard-tests")
|
|
dirs_to_run["test"].add("libs/partners/mistralai")
|
|
dirs_to_run["test"].add("libs/partners/openai")
|
|
dirs_to_run["test"].add("libs/partners/anthropic")
|
|
dirs_to_run["test"].add("libs/partners/ai21")
|
|
dirs_to_run["test"].add("libs/partners/fireworks")
|
|
dirs_to_run["test"].add("libs/partners/groq")
|
|
|
|
elif file.startswith("libs/cli"):
|
|
# todo: add cli makefile
|
|
pass
|
|
elif file.startswith("libs/partners"):
|
|
partner_dir = file.split("/")[2]
|
|
if os.path.isdir(f"libs/partners/{partner_dir}") and [
|
|
filename
|
|
for filename in os.listdir(f"libs/partners/{partner_dir}")
|
|
if not filename.startswith(".")
|
|
] != ["README.md"]:
|
|
dirs_to_run["test"].add(f"libs/partners/{partner_dir}")
|
|
# Skip if the directory was deleted or is just a tombstone readme
|
|
elif file.startswith("libs/"):
|
|
raise ValueError(
|
|
f"Unknown lib: {file}. check_diff.py likely needs "
|
|
"an update for this new library!"
|
|
)
|
|
elif any(file.startswith(p) for p in ["docs/", "templates/", "cookbook/"]):
|
|
dirs_to_run["lint"].add(".")
|
|
|
|
outputs = {
|
|
"dirs-to-lint": list(
|
|
dirs_to_run["lint"] | 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"]),
|
|
}
|
|
for key, value in outputs.items():
|
|
json_output = json.dumps(value)
|
|
print(f"{key}={json_output}") # noqa: T201
|