1{
2 lib,
3 aiohttp,
4 anyio,
5 buildPythonPackage,
6 click,
7 dirty-equals,
8 distro,
9 fetchPypi,
10 fire,
11 hatch-fancy-pypi-readme,
12 hatchling,
13 httpx-aiohttp,
14 httpx,
15 nest-asyncio,
16 pandas,
17 prompt-toolkit,
18 pyaml,
19 pydantic,
20 pytest-asyncio,
21 pytest-xdist,
22 pytestCheckHook,
23 requests,
24 respx,
25 rich,
26 sniffio,
27 termcolor,
28 tqdm,
29 typing-extensions,
30}:
31
32buildPythonPackage rec {
33 pname = "llama-stack-client";
34 version = "0.2.23";
35 pyproject = true;
36
37 src = fetchPypi {
38 pname = "llama_stack_client";
39 inherit version;
40 hash = "sha256-aPNOisjupqc+2dSXfYSZkrLYvYNYBNdwoRhDQxzVv3Q=";
41 };
42
43 postPatch = ''
44 substituteInPlace pyproject.toml \
45 --replace-fail "hatchling==1.26.3" "hatchling"
46 '';
47
48 build-system = [
49 hatch-fancy-pypi-readme
50 hatchling
51 ];
52
53 dependencies = [
54 anyio
55 click
56 distro
57 fire
58 httpx
59 pandas
60 prompt-toolkit
61 pyaml
62 pydantic
63 requests
64 rich
65 sniffio
66 termcolor
67 tqdm
68 typing-extensions
69 ];
70
71 optional-dependencies = {
72 aiohttp = [
73 aiohttp
74 httpx-aiohttp
75 ];
76 };
77
78 nativeCheckInputs = [
79 dirty-equals
80 nest-asyncio
81 pytest-asyncio
82 pytest-xdist
83 pytestCheckHook
84 respx
85 ]
86 ++ lib.flatten (builtins.attrValues optional-dependencies);
87
88 pythonImportsCheck = [ "llama_stack_client" ];
89
90 disabledTestPaths = [
91 # Tests require network access
92 "tests/api_resources/"
93 "tests/test_client.py"
94 ];
95
96 meta = {
97 description = "Library for the llama-stack-client API";
98 homepage = "https://github.com/llamastack/llama-stack-client-python";
99 changelog = "https://github.com/llamastack/llama-stack-client-python/releases/tag/v${version}";
100 license = lib.licenses.mit;
101 maintainers = with lib.maintainers; [ fab ];
102 };
103}