depot/third_party/nixpkgs/pkgs/development/python-modules/langchain-community/default.nix
Default email 7e47f3658e Project import generated by Copybara.
GitOrigin-RevId: 1925c603f17fc89f4c8f6bf6f631a802ad85d784
2024-09-26 11:04:55 +00:00

116 lines
2.2 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
poetry-core,
# dependencies
aiohttp,
dataclasses-json,
langchain-core,
langchain,
langsmith,
pydantic-settings,
pyyaml,
requests,
sqlalchemy,
tenacity,
# optional-dependencies
typer,
numpy,
# tests
httpx,
langchain-standard-tests,
lark,
pandas,
pytest-asyncio,
pytest-mock,
pytestCheckHook,
requests-mock,
responses,
syrupy,
toml,
}:
buildPythonPackage rec {
pname = "langchain-community";
version = "0.3.0";
pyproject = true;
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
rev = "refs/tags/langchain-community==${version}";
hash = "sha256-8kF7KlXcWbquRtp8EumkFYhGd0onxifVZsts0SU1dzE=";
};
sourceRoot = "${src.name}/libs/community";
build-system = [ poetry-core ];
pythonRelaxDeps = [ "pydantic-settings" ];
dependencies = [
aiohttp
dataclasses-json
langchain-core
langchain
langsmith
pydantic-settings
pyyaml
requests
sqlalchemy
tenacity
];
optional-dependencies = {
cli = [ typer ];
numpy = [ numpy ];
};
pythonImportsCheck = [ "langchain_community" ];
nativeCheckInputs = [
httpx
langchain-standard-tests
lark
pandas
pytest-asyncio
pytest-mock
pytestCheckHook
requests-mock
responses
syrupy
toml
];
pytestFlagsArray = [ "tests/unit_tests" ];
passthru = {
inherit (langchain-core) updateScript;
};
__darwinAllowLocalNetworking = true;
disabledTests = [
# Test require network access
"test_ovhcloud_embed_documents"
"test_yandex"
# duckdb-engine needs python-wasmer which is not yet available in Python 3.12
# See https://github.com/NixOS/nixpkgs/pull/326337 and https://github.com/wasmerio/wasmer-python/issues/778
"test_table_info"
"test_sql_database_run"
];
meta = {
changelog = "https://github.com/langchain-ai/langchain/releases/tag/langchain-community==${version}";
description = "Community contributed LangChain integrations";
homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/community";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ natsukium ];
};
}