This commit is contained in:
Chester Curme 2025-02-03 11:14:44 -05:00
parent 10f677f2f7
commit 4202c1411b
4 changed files with 4421 additions and 26 deletions

View File

@ -12,7 +12,7 @@ test tests:
-u LANGCHAIN_API_KEY \ -u LANGCHAIN_API_KEY \
-u LANGSMITH_TRACING \ -u LANGSMITH_TRACING \
-u LANGCHAIN_PROJECT \ -u LANGCHAIN_PROJECT \
poetry run pytest -n auto --disable-socket --allow-unix-socket $(TEST_FILE) uv run --group test pytest -n auto --disable-socket --allow-unix-socket $(TEST_FILE)
test_watch: test_watch:
env \ env \
@ -20,16 +20,16 @@ test_watch:
-u LANGCHAIN_API_KEY \ -u LANGCHAIN_API_KEY \
-u LANGSMITH_TRACING \ -u LANGSMITH_TRACING \
-u LANGCHAIN_PROJECT \ -u LANGCHAIN_PROJECT \
poetry run ptw --snapshot-update --now . --disable-socket --allow-unix-socket -- -vv $(TEST_FILE) uv run --group test ptw --snapshot-update --now . --disable-socket --allow-unix-socket -- -vv $(TEST_FILE)
test_profile: test_profile:
poetry run pytest -vv tests/unit_tests/ --profile-svg uv run --group test pytest -vv tests/unit_tests/ --profile-svg
check_imports: $(shell find langchain_core -name '*.py') check_imports: $(shell find langchain_core -name '*.py')
poetry run python ./scripts/check_imports.py $^ uv run --group test python ./scripts/check_imports.py $^
extended_tests: extended_tests:
poetry run pytest --only-extended --disable-socket --allow-unix-socket $(TEST_FILE) uv run --group test pytest --only-extended --disable-socket --allow-unix-socket $(TEST_FILE)
###################### ######################
@ -47,19 +47,19 @@ lint_tests: MYPY_CACHE=.mypy_cache_test
lint lint_diff lint_package lint_tests: lint lint_diff lint_package lint_tests:
./scripts/lint_imports.sh ./scripts/lint_imports.sh
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check $(PYTHON_FILES)
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES) --diff
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && uv run --all-groups mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
format format_diff: format format_diff:
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES)
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --fix $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check --fix $(PYTHON_FILES)
spell_check: spell_check:
poetry run codespell --toml pyproject.toml uv run --all-groups codespell --toml pyproject.toml
spell_fix: spell_fix:
poetry run codespell --toml pyproject.toml -w uv run --all-groups codespell --toml pyproject.toml -w
###################### ######################
# HELP # HELP

View File

@ -72,6 +72,10 @@ test_integration = []
[tool.pdm.build] [tool.pdm.build]
includes = [] includes = []
[tool.uv.sources]
langchain-tests = { path = "../standard-tests" }
langchain-text-splitters = { path = "../text-splitters" }
[project] [project]
authors = [] authors = []
license = {text = "MIT"} license = {text = "MIT"}
@ -105,6 +109,7 @@ typing = [
"types-pyyaml<7.0.0.0,>=6.0.12.2", "types-pyyaml<7.0.0.0,>=6.0.12.2",
"types-requests<3.0.0.0,>=2.28.11.5", "types-requests<3.0.0.0,>=2.28.11.5",
"types-jinja2<3.0.0,>=2.11.9", "types-jinja2<3.0.0,>=2.11.9",
"langchain-text-splitters",
] ]
dev = [ dev = [
"jupyter<2.0.0,>=1.0.0", "jupyter<2.0.0,>=1.0.0",
@ -125,5 +130,6 @@ test = [
"blockbuster~=1.5.11", "blockbuster~=1.5.11",
"numpy<2.0.0,>=1.24.0; python_version < \"3.12\"", "numpy<2.0.0,>=1.24.0; python_version < \"3.12\"",
"numpy<3,>=1.26.0; python_version >= \"3.12\"", "numpy<3,>=1.26.0; python_version >= \"3.12\"",
"langchain-tests",
] ]
test_integration = [] test_integration = []

View File

@ -12,33 +12,33 @@ TEST_FILE ?= tests/unit_tests/
# Run unit tests and generate a coverage report. # Run unit tests and generate a coverage report.
coverage: coverage:
poetry run pytest --cov \ uv run --group test pytest --cov \
--cov-config=.coveragerc \ --cov-config=.coveragerc \
--cov-report xml \ --cov-report xml \
--cov-report term-missing:skip-covered \ --cov-report term-missing:skip-covered \
$(TEST_FILE) $(TEST_FILE)
test tests: test tests:
poetry run pytest -n auto --disable-socket --allow-unix-socket $(TEST_FILE) uv run --group test pytest -n auto --disable-socket --allow-unix-socket $(TEST_FILE)
extended_tests: extended_tests:
poetry run pytest --disable-socket --allow-unix-socket --only-extended tests/unit_tests uv run --group test pytest --disable-socket --allow-unix-socket --only-extended tests/unit_tests
test_watch: test_watch:
poetry run ptw --snapshot-update --now . -- -x --disable-socket --allow-unix-socket --disable-warnings tests/unit_tests uv run --group test ptw --snapshot-update --now . -- -x --disable-socket --allow-unix-socket --disable-warnings tests/unit_tests
test_watch_extended: test_watch_extended:
poetry run ptw --snapshot-update --now . -- -x --disable-socket --allow-unix-socket --only-extended tests/unit_tests uv run --group test ptw --snapshot-update --now . -- -x --disable-socket --allow-unix-socket --only-extended tests/unit_tests
integration_tests: integration_tests:
poetry run pytest tests/integration_tests uv run --group test_integration pytest tests/integration_tests
docker_tests: docker_tests:
docker build -t my-langchain-image:test . docker build -t my-langchain-image:test .
docker run --rm my-langchain-image:test docker run --rm my-langchain-image:test
check_imports: $(shell find langchain -name '*.py') check_imports: $(shell find langchain -name '*.py')
poetry run python ./scripts/check_imports.py $^ uv run python ./scripts/check_imports.py $^
###################### ######################
# LINTING AND FORMATTING # LINTING AND FORMATTING
@ -55,19 +55,19 @@ lint_tests: MYPY_CACHE=.mypy_cache_test
lint lint_diff lint_package lint_tests: lint lint_diff lint_package lint_tests:
./scripts/lint_imports.sh ./scripts/lint_imports.sh
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check $(PYTHON_FILES)
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) --diff [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES) --diff
[ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && poetry run mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE) [ "$(PYTHON_FILES)" = "" ] || mkdir -p $(MYPY_CACHE) && uv run --all-groups mypy $(PYTHON_FILES) --cache-dir $(MYPY_CACHE)
format format_diff: format format_diff:
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff format $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff format $(PYTHON_FILES)
[ "$(PYTHON_FILES)" = "" ] || poetry run ruff check --select I --fix $(PYTHON_FILES) [ "$(PYTHON_FILES)" = "" ] || uv run --all-groups ruff check --select I --fix $(PYTHON_FILES)
spell_check: spell_check:
poetry run codespell --toml pyproject.toml uv run --all-groups codespell --toml pyproject.toml
spell_fix: spell_fix:
poetry run codespell --toml pyproject.toml -w uv run --all-groups codespell --toml pyproject.toml -w
###################### ######################
# HELP # HELP

4389
libs/langchain/uv.lock Normal file

File diff suppressed because it is too large Load Diff