Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 6 # build-system 7 pdm-backend, 8 9 # dependencies 10 langchain-core, 11 12 # tests 13 httpx, 14 pytest-asyncio, 15 pytestCheckHook, 16 17 # passthru 18 gitUpdater, 19}: 20 21buildPythonPackage rec { 22 pname = "langchain-text-splitters"; 23 version = "0.3.72"; 24 pyproject = true; 25 26 src = fetchFromGitHub { 27 owner = "langchain-ai"; 28 repo = "langchain"; 29 tag = "langchain-core==${version}"; 30 hash = "sha256-Q2uGMiODUtwkPdOyuSqp8vqjlLjiXk75QjXp7rr20tc="; 31 }; 32 33 sourceRoot = "${src.name}/libs/text-splitters"; 34 35 build-system = [ pdm-backend ]; 36 37 pythonRelaxDeps = [ 38 # Each component release requests the exact latest core. 39 # That prevents us from updating individual components. 40 "langchain-core" 41 ]; 42 43 dependencies = [ langchain-core ]; 44 45 pythonImportsCheck = [ "langchain_text_splitters" ]; 46 47 nativeCheckInputs = [ 48 httpx 49 pytest-asyncio 50 pytestCheckHook 51 ]; 52 53 enabledTestPaths = [ "tests/unit_tests" ]; 54 55 passthru.updateScript = gitUpdater { 56 rev-prefix = "langchain-text-splitters=="; 57 }; 58 59 meta = { 60 changelog = "https://github.com/langchain-ai/langchain/releases/tag/${src.tag}"; 61 description = "LangChain utilities for splitting into chunks a wide variety of text documents"; 62 homepage = "https://github.com/langchain-ai/langchain/tree/master/libs/text-splitters"; 63 license = lib.licenses.mit; 64 maintainers = with lib.maintainers; [ 65 fab 66 sarahec 67 ]; 68 }; 69}