Skip to content

Commit

Permalink
docs: experimental case, use yq action
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Oct 31, 2024
1 parent 8ad7ada commit fb8d4d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/prep_api_docs_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def move_libraries(packages: Dict[str, Any]) -> None:
package_name = package["name"].replace("langchain-", "")
source_path = package["path"]
target_dir = f"langchain/libs/partners/{package_name}"
if package_name == "experimental":
# special case experimental
target_dir = "langchain/libs/experimental"

# Handle root path case
if source_path == ".":
Expand Down
16 changes: 9 additions & 7 deletions .github/workflows/api_doc_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,19 @@ jobs:
path: langchain-api-docs-html
token: ${{ secrets.TOKEN_GITHUB_API_DOCS_HTML }}

- name: Install yq
run: |
sudo wget -qO /usr/local/bin/yq https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64
sudo chmod a+x /usr/local/bin/yq
- name: Get repos with yq
id: get-unsorted-repos
uses: mikefarah/yq@master
with:
cmd: yq '.packages[].repo' langchain/libs/packages.yml

- name: Parse YAML and checkout repos
env:
REPOS_UNSORTED: ${{ steps.get-unsorted-repos.outputs.result }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
# Get unique repositories
REPOS=$(yq '.packages[].repo' langchain/libs/packages.yml | sort -u)
REPOS=$(echo "$REPOS_UNSORTED" | sort -u)
# Checkout each unique repository
for repo in $REPOS; do
Expand All @@ -41,8 +45,6 @@ jobs:
git clone --depth 1 https://github.com/$repo.git $REPO_NAME
fi
done
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python ${{ env.PYTHON_VERSION }} + Poetry ${{ env.POETRY_VERSION }}
uses: "./langchain/.github/actions/poetry_setup"
Expand Down

0 comments on commit fb8d4d3

Please sign in to comment.