Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at gcc-offload 107 lines 1.9 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 pytestCheckHook, 6 pythonOlder, 7 pybind11, 8 setuptools, 9 wheel, 10 aiohttp, 11 diskcache, 12 fastapi, 13 gptcache, 14 msal, 15 numpy, 16 openai, 17 ordered-set, 18 platformdirs, 19 protobuf, 20 pyformlang, 21 requests, 22 tiktoken, 23 torch, 24 uvicorn, 25}: 26 27buildPythonPackage rec { 28 pname = "guidance"; 29 version = "0.1.16"; 30 pyproject = true; 31 32 disabled = pythonOlder "3.8"; 33 34 src = fetchFromGitHub { 35 owner = "guidance-ai"; 36 repo = "guidance"; 37 rev = "refs/tags/${version}"; 38 hash = "sha256-dPakdT97cuLv4OwdaUFncopD5X6uXGyUjwzqn9fxnhU="; 39 }; 40 41 nativeBuildInputs = [ pybind11 ]; 42 43 build-system = [ 44 setuptools 45 wheel 46 ]; 47 48 dependencies = [ 49 aiohttp 50 diskcache 51 fastapi 52 gptcache 53 msal 54 numpy 55 openai 56 ordered-set 57 platformdirs 58 protobuf 59 pyformlang 60 requests 61 tiktoken 62 uvicorn 63 ]; 64 65 nativeCheckInputs = [ 66 pytestCheckHook 67 torch 68 ]; 69 70 disabledTests = [ 71 # require network access 72 "test_select_simple" 73 "test_commit_point" 74 "test_token_healing" 75 "test_fstring" 76 "test_fstring_custom" 77 "test_token_count" 78 "test_gpt2" 79 "test_recursion_error" 80 "test_openai_class_detection" 81 "test_openai_chat_without_roles" 82 83 # flaky tests 84 "test_remote_mock_gen" # frequently fails when building packages in parallel 85 ]; 86 87 disabledTestPaths = [ 88 # require network access 89 "tests/library/test_gen.py" 90 ]; 91 92 preCheck = '' 93 export HOME=$TMPDIR 94 ''; 95 96 pythonImportsCheck = [ "guidance" ]; 97 98 __darwinAllowLocalNetworking = true; 99 100 meta = with lib; { 101 description = "Guidance language for controlling large language models"; 102 homepage = "https://github.com/guidance-ai/guidance"; 103 changelog = "https://github.com/guidance-ai/guidance/releases/tag/${lib.removePrefix "refs/tags/" src.rev}"; 104 license = licenses.mit; 105 maintainers = with maintainers; [ natsukium ]; 106 }; 107}