Skip to content

Commit

Permalink
core[patch], langchain[patch]: import CI
Browse files Browse the repository at this point in the history
  • Loading branch information
efriis committed Dec 7, 2023
1 parent 7186fae commit 7581782
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/_pydantic_compatibility.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ jobs:
shell: bash
run: poetry install

- name: Check imports with base dependencies
shell: bash
run: make check_imports

- name: Install langchain editable
working-directory: ${{ inputs.working-directory }}
if: ${{ inputs.langchain-location }}
Expand Down
6 changes: 5 additions & 1 deletion libs/core/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ tests:
test_watch:
poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests

check_imports: langchain_core/**/*.py
for f in $^ ; do \
python -c "from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$f').load_module()" ; \
done

######################
# LINTING AND FORMATTING
Expand All @@ -27,7 +31,7 @@ lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/experimenta

lint lint_diff:
./scripts/check_pydantic.sh .
./scripts/check_imports.sh
./scripts/lint_imports.sh
poetry run ruff .
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff --select I $(PYTHON_FILES)
Expand Down
File renamed without changes.
7 changes: 6 additions & 1 deletion libs/langchain/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ docker_tests:
docker build -t my-langchain-image:test .
docker run --rm my-langchain-image:test

check_imports: langchain/**/*.py
for f in $^ ; do \
python -c "from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$f').load_module()" ; \
done

######################
# LINTING AND FORMATTING
######################
Expand All @@ -51,7 +56,7 @@ lint_diff format_diff: PYTHON_FILES=$(shell git diff --relative=libs/langchain -

lint lint_diff:
./scripts/check_pydantic.sh .
./scripts/check_imports.sh
./scripts/lint_imports.sh
poetry run ruff .
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff --select I $(PYTHON_FILES)
Expand Down
File renamed without changes.

0 comments on commit 7581782

Please sign in to comment.