INFRA: Lint for imports (#13632)

- Adds pydantic/import linting to core
- Adds a check for `langchain_experimental` imports to langchain
This commit is contained in:
Erick Friis
2023-11-21 17:42:56 -08:00
committed by GitHub
parent 131db4ba68
commit c5ae9f832d
4 changed files with 49 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ git grep '^from langchain\.' langchain/embeddings | grep -vE 'from langchain.(py
git grep '^from langchain\.' langchain/docstore | grep -vE 'from langchain.(pydantic_v1|utils|schema|docstore)' && errors=$((errors+1))
git grep '^from langchain\.' langchain/vectorstores | grep -vE 'from langchain.(pydantic_v1|utils|schema|load|callbacks|env|_api|storage|llms|docstore|vectorstores|utilities)' && errors=$((errors+1))
# make sure not importing from langchain_experimental
git --no-pager grep '^from langchain_experimental\.' . && errors=$((errors+1))
# Decide on an exit status based on the errors
if [ "$errors" -gt 0 ]; then
exit 1