2024-04-21 15:54:59 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
clarifai-grpc,
|
|
|
|
fetchFromGitHub,
|
|
|
|
inquirerpy,
|
|
|
|
llama-index-core,
|
|
|
|
numpy,
|
|
|
|
opencv4,
|
|
|
|
pandas,
|
|
|
|
pillow,
|
|
|
|
pycocotools,
|
|
|
|
pypdf,
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
pyyaml,
|
|
|
|
rich,
|
|
|
|
schema,
|
|
|
|
setuptools,
|
|
|
|
tabulate,
|
|
|
|
tqdm,
|
|
|
|
tritonclient,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "clarifai";
|
2024-07-27 06:49:29 +00:00
|
|
|
version = "10.5.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "Clarifai";
|
2024-01-02 11:29:13 +00:00
|
|
|
repo = "clarifai-python";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-07-27 06:49:29 +00:00
|
|
|
hash = "sha256-C/ZmU1RRV4gJsgTgBGnhsJ7JUasHdKgoIro+fpjH4Ss=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
pythonRelaxDeps = [
|
|
|
|
"clarifai-grpc"
|
|
|
|
"schema"
|
|
|
|
];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
build-system = [ setuptools ];
|
2024-01-02 11:29:13 +00:00
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
dependencies = [
|
2023-07-15 17:15:38 +00:00
|
|
|
clarifai-grpc
|
2024-02-29 20:09:43 +00:00
|
|
|
inquirerpy
|
2024-01-02 11:29:13 +00:00
|
|
|
numpy
|
|
|
|
pillow
|
|
|
|
pyyaml
|
2024-02-29 20:09:43 +00:00
|
|
|
rich
|
|
|
|
schema
|
2024-04-21 15:54:59 +00:00
|
|
|
tabulate
|
2024-02-29 20:09:43 +00:00
|
|
|
tqdm
|
|
|
|
tritonclient
|
2023-07-15 17:15:38 +00:00
|
|
|
];
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-04-21 15:54:59 +00:00
|
|
|
all = [ pycocotools ];
|
2024-02-29 20:09:43 +00:00
|
|
|
};
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
disabledTests = [
|
2024-02-29 20:09:43 +00:00
|
|
|
# Test requires network access and API key
|
2024-01-02 11:29:13 +00:00
|
|
|
"test_export_workflow_general"
|
2024-07-27 06:49:29 +00:00
|
|
|
"test_validate_invalid_id"
|
|
|
|
"test_validate_invalid_hex_id"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2024-02-29 20:09:43 +00:00
|
|
|
# Tests require network access and API key
|
2024-01-02 11:29:13 +00:00
|
|
|
"tests/test_app.py"
|
|
|
|
"tests/test_data_upload.py"
|
2024-04-21 15:54:59 +00:00
|
|
|
"tests/test_eval.py"
|
2024-01-02 11:29:13 +00:00
|
|
|
"tests/test_model_predict.py"
|
|
|
|
"tests/test_model_train.py"
|
|
|
|
"tests/test_search.py"
|
|
|
|
"tests/workflow/test_create_delete.py"
|
|
|
|
"tests/workflow/test_predict.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_rag.py"
|
|
|
|
"clarifai/models/model_serving/repo_build/static_files/base_test.py"
|
2024-01-02 11:29:13 +00:00
|
|
|
];
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
pythonImportsCheck = [ "clarifai" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Clarifai Python Utilities";
|
2024-01-02 11:29:13 +00:00
|
|
|
homepage = "https://github.com/Clarifai/clarifai-python";
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/Clarifai/clarifai-python/releases/tag/${version}";
|
2023-07-15 17:15:38 +00:00
|
|
|
license = licenses.asl20;
|
|
|
|
maintainers = with maintainers; [ natsukium ];
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "clarifai";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|