generalize

This commit is contained in:
Chester Curme 2025-04-25 12:34:33 -04:00
parent cd306978b6
commit 639d1f31be
3 changed files with 16 additions and 14 deletions

View File

@ -59,9 +59,6 @@ def move_libraries(packages: list) -> None:
print(f"Error moving {source_dir} to {target_dir}: {e}")
OUTSIDE_REPOS = ["tavily-ai/langchain-tavily"]
def main():
"""Main function to orchestrate the library sync process."""
try:
@ -72,7 +69,7 @@ def main():
clean_target_directories([
p
for p in package_yaml["packages"]
if (p["repo"].startswith("langchain-ai/") or p["repo"] in OUTSIDE_REPOS)
if (p["repo"].startswith("langchain-ai/") or p.get("include_in_api_ref"))
and p["repo"] != "langchain-ai/langchain"
])
@ -81,7 +78,7 @@ def main():
p
for p in package_yaml["packages"]
if not p.get("disabled", False)
and (p["repo"].startswith("langchain-ai/") or p["repo"] in OUTSIDE_REPOS)
and (p["repo"].startswith("langchain-ai/") or p.get("include_in_api_ref"))
and p["repo"] != "langchain-ai/langchain"
])

View File

@ -26,7 +26,16 @@ jobs:
id: get-unsorted-repos
uses: mikefarah/yq@master
with:
cmd: yq '.packages[].repo' langchain/libs/packages.yml
cmd: |
yq '
.packages[]
| select(
(.repo | test("^langchain-ai/")) # in org
or
(.include_in_api_ref // false) # explicit flag
)
| .repo
' langchain/libs/packages.yml
- name: Parse YAML and checkout repos
env:
@ -38,14 +47,9 @@ jobs:
# Checkout each unique repository that is in langchain-ai org
for repo in $REPOS; do
if {
[[ "$repo" != "langchain-ai/langchain" ]] &&
[[ "$repo" == langchain-ai/* ]]
} || [[ "$repo" == "tavily-ai/langchain-tavily" ]]; then
REPO_NAME=$(echo $repo | cut -d'/' -f2)
echo "Checking out $repo to $REPO_NAME"
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
fi
REPO_NAME=$(echo $repo | cut -d'/' -f2)
echo "Checking out $repo to $REPO_NAME"
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
done
- name: Setup python ${{ env.PYTHON_VERSION }}

View File

@ -549,6 +549,7 @@ packages:
- name: langchain-tavily
path: .
repo: tavily-ai/langchain-tavily
include_in_api_ref: true
downloads: 13796
downloads_updated_at: '2025-04-22T15:25:24.644345+00:00'
- name: langchain-zotero-retriever