File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,9 +16,7 @@ test_watch:
1616 poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests
1717
1818check_imports : $(shell find langchain_community -name '* .py')
19- for f in $^ ; do \
20- python -c " from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$ f').load_module()" || exit 1; \
21- done
19+ poetry run python ./scripts/check_imports.py $^
2220
2321extended_tests :
2422 poetry run pytest --only-extended tests/unit_tests
@@ -39,7 +37,7 @@ lint_tests: MYPY_CACHE=.mypy_cache_test
3937
4038lint lint_diff lint_package lint_tests :
4139 ./scripts/check_pydantic.sh .
42- ./scripts/check_imports .sh
40+ ./scripts/lint_imports .sh
4341 poetry run ruff .
4442 [ " $( PYTHON_FILES) " = " " ] || poetry run ruff format $(PYTHON_FILES ) --diff
4543 [ " $( PYTHON_FILES) " = " " ] || poetry run ruff --select I $(PYTHON_FILES )
Original file line number Diff line number Diff line change 1+ import sys
2+ import traceback
3+ from importlib .machinery import SourceFileLoader
4+
5+ if __name__ == "__main__" :
6+ files = sys .argv [1 :]
7+ has_failure = False
8+ for file in files :
9+ try :
10+ SourceFileLoader ("x" , file ).load_module ()
11+ except Exception :
12+ has_faillure = True
13+ print (file )
14+ traceback .print_exc ()
15+ print ()
16+
17+ sys .exit (1 if has_failure else 0 )
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -16,9 +16,7 @@ test_watch:
1616 poetry run ptw --snapshot-update --now . -- -vv -x tests/unit_tests
1717
1818check_imports : $(shell find langchain_core -name '* .py')
19- for f in $^ ; do \
20- python -c " from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$ f').load_module()" || exit 1; \
21- done
19+ poetry run python ./scripts/check_imports.py $^
2220
2321extended_tests :
2422 poetry run pytest --only-extended $(TEST_FILE )
Original file line number Diff line number Diff line change 1+ import sys
2+ import traceback
3+ from importlib .machinery import SourceFileLoader
4+
5+ if __name__ == "__main__" :
6+ files = sys .argv [1 :]
7+ has_failure = False
8+ for file in files :
9+ try :
10+ SourceFileLoader ("x" , file ).load_module ()
11+ except Exception :
12+ has_faillure = True
13+ print (file )
14+ traceback .print_exc ()
15+ print ()
16+
17+ sys .exit (1 if has_failure else 0 )
Original file line number Diff line number Diff line change @@ -22,9 +22,7 @@ integration_tests:
2222 poetry run pytest tests/integration_tests
2323
2424check_imports : $(shell find langchain_experimental -name '* .py')
25- for f in $^ ; do \
26- python -c " from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$ f').load_module()" || exit 1; \
27- done
25+ poetry run python ./scripts/check_imports.py $^
2826
2927
3028# #####################
Original file line number Diff line number Diff line change 1+ import sys
2+ import traceback
3+ from importlib .machinery import SourceFileLoader
4+
5+ if __name__ == "__main__" :
6+ files = sys .argv [1 :]
7+ has_failure = False
8+ for file in files :
9+ try :
10+ SourceFileLoader ("x" , file ).load_module ()
11+ except Exception :
12+ has_faillure = True
13+ print (file )
14+ traceback .print_exc ()
15+ print ()
16+
17+ sys .exit (1 if has_failure else 0 )
Original file line number Diff line number Diff line change @@ -41,9 +41,7 @@ docker_tests:
4141 docker run --rm my-langchain-image:test
4242
4343check_imports : $(shell find langchain -name '* .py')
44- for f in $^ ; do \
45- python -c " from importlib.machinery import SourceFileLoader; SourceFileLoader('x', '$$ f').load_module()" || exit 1; \
46- done
44+ poetry run python ./scripts/check_imports.py $^
4745
4846# #####################
4947# LINTING AND FORMATTING
Original file line number Diff line number Diff line change 1+ import sys
2+ import traceback
3+ from importlib .machinery import SourceFileLoader
4+
5+ if __name__ == "__main__" :
6+ files = sys .argv [1 :]
7+ has_failure = False
8+ for file in files :
9+ try :
10+ SourceFileLoader ("x" , file ).load_module ()
11+ except Exception :
12+ has_faillure = True
13+ print (file )
14+ traceback .print_exc ()
15+ print ()
16+
17+ sys .exit (1 if has_failure else 0 )
You can’t perform that action at this time.
0 commit comments