Files
nixpkgs/pkgs/development/python-modules/langchain-tests/default.nix

89 lines
1.5 KiB
Nix

{
lib,
buildPythonPackage,
fetchFromGitHub,
# build-system
pdm-backend,
# dependencies
httpx,
langchain-core,
syrupy,
pytest-benchmark,
pytest-codspeed,
pytest-recording,
vcrpy,
# buildInputs
pytest,
# tests
numpy,
pytest-asyncio,
pytest-socket,
pytestCheckHook,
# passthru
gitUpdater,
}:
buildPythonPackage rec {
pname = "langchain-tests";
version = "0.3.20";
pyproject = true;
src = fetchFromGitHub {
owner = "langchain-ai";
repo = "langchain";
tag = "langchain-tests==${version}";
hash = "sha256-RMuxWA/n8d71FReFKO3Y/5P0MYk4aZ5WU2/TRxf9UuE=";
};
sourceRoot = "${src.name}/libs/standard-tests";
build-system = [ pdm-backend ];
pythonRelaxDeps = [
# Each component release requests the exact latest core.
# That prevents us from updating individual components.
"langchain-core"
"numpy"
];
dependencies = [
httpx
langchain-core
pytest-asyncio
pytest-benchmark
pytest-codspeed
pytest-recording
pytest-socket
syrupy
vcrpy
];
buildInputs = [ pytest ];
pythonImportsCheck = [ "langchain_tests" ];
nativeBuildInputs = [
numpy
pytestCheckHook
];
passthru.updateScript = gitUpdater {
rev-prefix = "langchain-tests==";
};
meta = {
description = "Build context-aware reasoning applications";
homepage = "https://github.com/langchain-ai/langchain";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [
natsukium
sarahec
];
};
}