summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/clarifai/default.nix
blob: ccd597174f1c61beaf5d5a2e52ac93d66a7587c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
{
  lib,
  aiohttp,
  buildPythonPackage,
  clarifai-grpc,
  clarifai-protocol,
  click,
  fetchFromGitHub,
  fsspec,
  huggingface-hub,
  inquirerpy,
  numpy,
  pillow,
  pkgs,
  psutil,
  pycocotools,
  pydantic-core,
  pytest-asyncio,
  pytestCheckHook,
  pyyaml,
  rich,
  ruff,
  schema,
  setuptools,
  tabulate,
  tqdm,
  tritonclient,
  uv,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "clarifai";
  version = "11.9.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "Clarifai";
    repo = "clarifai-python";
    tag = version;
    hash = "sha256-LTBAexfexeZ/Woe2GMaIArGy/ufFkgPdkstzSKCkYIU=";
  };

  pythonRelaxDeps = [
    "clarifai-protocol"
    "click"
    "fsspec"
    "psutil"
    "ruff"
    "schema"
    "uv"
  ];

  build-system = [ setuptools ];

  dependencies = [
    aiohttp
    clarifai-grpc
    clarifai-protocol
    click
    fsspec
    inquirerpy
    numpy
    pillow
    psutil
    pydantic-core
    pyyaml
    rich
    ruff
    schema
    tabulate
    tqdm
    tritonclient
    uv
  ];

  optional-dependencies = {
    all = [ pycocotools ];
  };

  nativeCheckInputs = [
    pkgs.gitMinimal
    huggingface-hub
    pytest-asyncio
    pytestCheckHook
    writableTmpDirAsHomeHook
  ];

  disabledTests = [
    # Test requires network access and API key
    "test_export_workflow_general"
    "test_validate_invalid_id"
    "test_validate_invalid_hex_id"
  ];

  disabledTestPaths = [
    # Tests require network access and API key
    "tests/cli/test_compute_orchestration.py"
    "tests/runners/test_download_checkpoints.py"
    "tests/runners/test_model_run_locally.py"
    "tests/runners/test_model_upload.py"
    "tests/runners/test_num_threads_config.py"
    "tests/runners/test_runners_proto.py"
    "tests/runners/test_runners.py"
    "tests/runners/test_url_fetcher.py"
    "tests/runners/test_vllm_model_upload.py"
    "tests/test_app.py"
    "tests/test_data_upload.py"
    "tests/test_eval.py"
    "tests/test_list_models.py"
    "tests/test_model_predict.py"
    "tests/test_model_train.py"
    "tests/test_rag.py"
    "tests/test_search.py"
    "tests/workflow/test_create_delete.py"
    "tests/workflow/test_predict.py"
  ];

  pythonImportsCheck = [ "clarifai" ];

  meta = {
    description = "Clarifai Python Utilities";
    homepage = "https://github.com/Clarifai/clarifai-python";
    changelog = "https://github.com/Clarifai/clarifai-python/releases/tag/${src.tag}";
    license = lib.licenses.asl20;
    maintainers = with lib.maintainers; [ natsukium ];
    mainProgram = "clarifai";
  };
}