1{
2 lib,
3 buildPythonPackage,
4 clarifai-grpc,
5 fetchFromGitHub,
6 inquirerpy,
7 llama-index-core,
8 numpy,
9 opencv4,
10 pandas,
11 pillow,
12 pycocotools,
13 pypdf,
14 pytestCheckHook,
15 pythonOlder,
16 pythonRelaxDepsHook,
17 pyyaml,
18 rich,
19 schema,
20 setuptools,
21 tabulate,
22 tqdm,
23 tritonclient,
24}:
25
26buildPythonPackage rec {
27 pname = "clarifai";
28 version = "10.3.3";
29 pyproject = true;
30
31 disabled = pythonOlder "3.8";
32
33 src = fetchFromGitHub {
34 owner = "Clarifai";
35 repo = "clarifai-python";
36 rev = "refs/tags/${version}";
37 hash = "sha256-M0OrBqjNjrpxVM/A7NVqarcP8S+VqunYGI4C+Wis6UI=";
38 };
39
40 pythonRelaxDeps = [ "clarifai-grpc" ];
41
42 pythonRemoveDeps = [ "opencv-python" ];
43
44 build-system = [ setuptools ];
45
46 nativeBuildInputs = [ pythonRelaxDepsHook ];
47
48 dependencies = [
49 clarifai-grpc
50 inquirerpy
51 llama-index-core
52 numpy
53 opencv4
54 pandas
55 pillow
56 pypdf
57 pyyaml
58 rich
59 schema
60 tabulate
61 tqdm
62 tritonclient
63 ];
64
65 passthru.optional-dependencies = {
66 all = [ pycocotools ];
67 };
68
69 nativeCheckInputs = [ pytestCheckHook ];
70
71 preCheck = ''
72 export HOME=$(mktemp -d)
73 '';
74
75 disabledTests = [
76 # Test requires network access and API key
77 "test_export_workflow_general"
78 ];
79
80 disabledTestPaths = [
81 # Tests require network access and API key
82 "tests/test_app.py"
83 "tests/test_data_upload.py"
84 "tests/test_eval.py"
85 "tests/test_model_predict.py"
86 "tests/test_model_train.py"
87 "tests/test_search.py"
88 "tests/workflow/test_create_delete.py"
89 "tests/workflow/test_predict.py"
90 "tests/test_rag.py"
91 "clarifai/models/model_serving/repo_build/static_files/base_test.py"
92 ];
93
94 pythonImportsCheck = [ "clarifai" ];
95
96 meta = with lib; {
97 description = "Clarifai Python Utilities";
98 homepage = "https://github.com/Clarifai/clarifai-python";
99 changelog = "https://github.com/Clarifai/clarifai-python/releases/tag/${version}";
100 license = licenses.asl20;
101 maintainers = with maintainers; [ natsukium ];
102 mainProgram = "clarifai";
103 };
104}