Files
nixpkgs/pkgs/development/python-modules/langchain-community/default.nix
T
Martin Weinelt b9cade67a9 python3Packages.langchain-community: disable failing tests
Marks cannot be applied to fixtures. This is treated as an error with
pytest 9.
2026-02-21 13:35:15 +01:00

145 lines
2.9 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
pythonAtLeast,
# build-system
pdm-backend,
# dependencies
aiohttp,
dataclasses-json,
httpx-sse,
langchain-classic,
langchain-core,
langsmith,
numpy,
pydantic-settings,
pyyaml,
requests,
sqlalchemy,
tenacity,
# tests
blockbuster,
duckdb,
duckdb-engine,
httpx,
langchain-tests,
lark,
pandas,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
requests-mock,
responses,
syrupy,
toml,
# passthru
gitUpdater,
}:
buildPythonPackage rec {
pname = "langchain-community";
version = "0.4.1";
pyproject = true;
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain-community";
tag = "libs/community/v${version}";
hash = "sha256-N92YDmej2shQQlktr0veFOKyGFWemFj0hdJIYu1rYSc=";
};
sourceRoot = "${src.name}/libs/community";
build-system = [ pdm-backend ];
# Only needed for mixed python 3.12/3.13 builds
pythonRelaxDeps = [
"numpy"
];
dependencies = [
aiohttp
dataclasses-json
httpx-sse
langchain-classic
langchain-core
langsmith
numpy
pydantic-settings
pyyaml
requests
sqlalchemy
tenacity
];
pythonImportsCheck = [ "langchain_community" ];
nativeCheckInputs = [
blockbuster
duckdb
duckdb-engine
httpx
langchain-tests
lark
pandas
pytest-asyncio
pytest-mock
pytestCheckHook
requests-mock
responses
syrupy
toml
];
enabledTestPaths = [
"tests/unit_tests"
];
__darwinAllowLocalNetworking = true;
disabledTests = [
# requires bs4, aka BeautifulSoup
"test_importable_all"
# flaky
"test_llm_caching"
"test_llm_caching_async"
# Triggered by https://github.com/Mause/duckdb_engine/issues/1379
"test_table_info"
"test_sql_database_run"
]
++ lib.optionals (pythonAtLeast "3.14") [
# AttributeError: module 'ast' has no attribute 'Str'
# https://github.com/langchain-ai/langchain-community/issues/492
"test_no_dynamic__all__"
];
disabledTestPaths = [
# depends on Pydantic v1 notations, will not load
"tests/unit_tests/document_loaders/test_gitbook.py"
# pytest.PytestRemovedIn9Warning: Marks applied to fixtures have no effect
# https://docs.pytest.org/en/stable/deprecations.html#applying-a-mark-to-a-fixture-function
"tests/unit_tests/document_loaders/test_hugging_face.py"
"tests/unit_tests/indexes/test_sql_record_manager.py"
];
passthru.updateScript = gitUpdater {
rev-prefix = "libs/community/v";
};
meta = {
description = "Community contributed LangChain integrations";
homepage = "https://github.com/langchain-ai/langchain-community";
changelog = "https://github.com/langchain-ai/langchain-community/releases/tag/${src.tag}";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
natsukium
sarahec
];
};
}