nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 aiohttp,
4 buildPythonPackage,
5 clarifai-grpc,
6 clarifai-protocol,
7 click,
8 fetchFromGitHub,
9 fsspec,
10 huggingface-hub,
11 inquirerpy,
12 numpy,
13 pillow,
14 pkgs,
15 psutil,
16 pycocotools,
17 pydantic-core,
18 pytest-asyncio,
19 pytestCheckHook,
20 pyyaml,
21 rich,
22 ruff,
23 schema,
24 setuptools,
25 tabulate,
26 tqdm,
27 tritonclient,
28 uv,
29 writableTmpDirAsHomeHook,
30}:
31
32buildPythonPackage rec {
33 pname = "clarifai";
34 version = "12.1.4";
35 pyproject = true;
36
37 src = fetchFromGitHub {
38 owner = "Clarifai";
39 repo = "clarifai-python";
40 tag = version;
41 hash = "sha256-+iIOAji6xDyGTZTE/DgRguYhgWYM1FS8+SIlPcmNpNo=";
42 };
43
44 pythonRelaxDeps = [
45 "clarifai-protocol"
46 "click"
47 "fsspec"
48 "psutil"
49 "ruff"
50 "schema"
51 "uv"
52 ];
53
54 build-system = [ setuptools ];
55
56 dependencies = [
57 aiohttp
58 clarifai-grpc
59 clarifai-protocol
60 click
61 fsspec
62 inquirerpy
63 numpy
64 pillow
65 psutil
66 pydantic-core
67 pyyaml
68 rich
69 ruff
70 schema
71 tabulate
72 tqdm
73 tritonclient
74 uv
75 ];
76
77 optional-dependencies = {
78 all = [ pycocotools ];
79 };
80
81 nativeCheckInputs = [
82 pkgs.gitMinimal
83 huggingface-hub
84 pytest-asyncio
85 pytestCheckHook
86 writableTmpDirAsHomeHook
87 ];
88
89 disabledTests = [
90 # Test requires network access and API key
91 "test_export_workflow_general"
92 "test_validate_invalid_id"
93 "test_validate_invalid_hex_id"
94 ];
95
96 disabledTestPaths = [
97 # Tests require network access and API key
98 "tests/cli/test_compute_orchestration.py"
99 "tests/runners/test_download_checkpoints.py"
100 "tests/runners/test_model_run_locally.py"
101 "tests/runners/test_model_upload.py"
102 "tests/runners/test_num_threads_config.py"
103 "tests/runners/test_runners_proto.py"
104 "tests/runners/test_runners.py"
105 "tests/runners/test_url_fetcher.py"
106 "tests/runners/test_vllm_model_upload.py"
107 "tests/test_app.py"
108 "tests/test_data_upload.py"
109 "tests/test_eval.py"
110 "tests/test_list_models.py"
111 "tests/test_model_predict.py"
112 "tests/test_model_train.py"
113 "tests/test_rag.py"
114 "tests/test_search.py"
115 "tests/workflow/test_create_delete.py"
116 "tests/workflow/test_predict.py"
117 ];
118
119 pythonImportsCheck = [ "clarifai" ];
120
121 meta = {
122 description = "Clarifai Python Utilities";
123 homepage = "https://github.com/Clarifai/clarifai-python";
124 changelog = "https://github.com/Clarifai/clarifai-python/releases/tag/${src.tag}";
125 license = lib.licenses.asl20;
126 maintainers = with lib.maintainers; [ natsukium ];
127 mainProgram = "clarifai";
128 };
129}