Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core[patch], langchain[patch], experimental[patch]: import CI #14414

Merged
merged 19 commits into from
Dec 8, 2023
4 changes: 4 additions & 0 deletions .github/workflows/_pydantic_compatibility.yml
efriis marked this conversation as resolved.
Show resolved Hide resolved
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed this to not confuse with make check_imports

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
Loading