Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / guidance / default.nix
blob732a107f2a399c19a6aff9778efae862e441edc6
1 { lib
2 , buildPythonPackage
3 , fetchFromGitHub
4 , pytestCheckHook
5 , pythonOlder
6 , pybind11
7 , setuptools
8 , wheel
9 , aiohttp
10 , diskcache
11 , fastapi
12 , gptcache
13 , msal
14 , numpy
15 , openai
16 , ordered-set
17 , platformdirs
18 , protobuf
19 , pyformlang
20 , requests
21 , tiktoken
22 , torch
23 , uvicorn
26 buildPythonPackage rec {
27   pname = "guidance";
28   version = "0.1.11";
29   pyproject = true;
31   disabled = pythonOlder "3.8";
33   src = fetchFromGitHub {
34     owner = "guidance-ai";
35     repo = "guidance";
36     rev = "refs/tags/${version}";
37     hash = "sha256-dvIJeSur3DdNBhrEPNPghxqmDEEig59Iz83LWksim6U=";
38   };
40   nativeBuildInputs = [
41     pybind11
42   ];
44   build-system = [
45     setuptools
46     wheel
47   ];
49   dependencies = [
50     aiohttp
51     diskcache
52     fastapi
53     gptcache
54     msal
55     numpy
56     openai
57     ordered-set
58     platformdirs
59     protobuf
60     pyformlang
61     requests
62     tiktoken
63     uvicorn
64   ];
66   nativeCheckInputs = [
67     pytestCheckHook
68     torch
69   ];
71   disabledTests = [
72     # require network access
73     "test_select_simple"
74     "test_commit_point"
75     "test_token_healing"
76     "test_fstring"
77     "test_fstring_custom"
78     "test_token_count"
79     "test_gpt2"
80     "test_recursion_error"
81     "test_openai_class_detection"
82     "test_openai_chat_without_roles"
83   ];
85   disabledTestPaths = [
86     # require network access
87     "tests/library/test_gen.py"
88   ];
90   preCheck = ''
91     export HOME=$TMPDIR
92   '';
94   pythonImportsCheck = [ "guidance" ];
96   __darwinAllowLocalNetworking = true;
98   meta = with lib; {
99     description = "A guidance language for controlling large language models";
100     homepage = "https://github.com/guidance-ai/guidance";
101     changelog = "https://github.com/guidance-ai/guidance/releases/tag/${src.rev}";
102     license = licenses.mit;
103     maintainers = with maintainers; [ natsukium ];
104   };