Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 buildPythonPackage, 4 click, 5 fetchPypi, 6 magika, 7 numpy, 8 onnxruntime, 9 poetry-core, 10 python-dotenv, 11 pythonOlder, 12 stdenv, 13 tabulate, 14 testers, 15 tqdm, 16}: 17 18buildPythonPackage rec { 19 pname = "magika"; 20 version = "0.5.1"; 21 pyproject = true; 22 disabled = pythonOlder "3.9"; 23 24 src = fetchPypi { 25 inherit pname version; 26 hash = "sha256-Q9wRU6FjcyciWmJqFVDAo5Wh1F6jPsH11GubCAI4vuA="; 27 }; 28 29 nativeBuildInputs = [ poetry-core ]; 30 31 propagatedBuildInputs = [ 32 click 33 numpy 34 onnxruntime 35 python-dotenv 36 tabulate 37 tqdm 38 ]; 39 40 pythonImportsCheck = [ "magika" ]; 41 42 passthru.tests.version = testers.testVersion { package = magika; }; 43 44 meta = with lib; { 45 description = "Magika: Detect file content types with deep learning"; 46 homepage = "https://github.com/google/magika"; 47 license = licenses.asl20; 48 maintainers = with maintainers; [ mihaimaruseac ]; 49 mainProgram = "magika"; 50 # Currently, disabling on AArch64 as it onnx runtime crashes on ofborg 51 broken = stdenv.isAarch64 && stdenv.isLinux; 52 }; 53}