Files
nixpkgs/pkgs/development/python-modules/magika/default.nix
Ihar Hrachyshka cca3b04b44 treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 19:01:23 +01:00

55 lines
1.2 KiB
Nix

{
lib,
buildPythonPackage,
click,
fetchPypi,
magika,
numpy,
onnxruntime,
hatchling,
python-dotenv,
pythonOlder,
stdenv,
tabulate,
testers,
tqdm,
}:
buildPythonPackage rec {
pname = "magika";
version = "1.0.1";
pyproject = true;
disabled = pythonOlder "3.9";
src = fetchPypi {
inherit pname version;
hash = "sha256-MT+Mv83Jp+VcJChicyMKJzK4mCXlipPeK1dlMTk7g5g=";
};
nativeBuildInputs = [ hatchling ];
propagatedBuildInputs = [
click
numpy
onnxruntime
python-dotenv
tabulate
tqdm
];
pythonImportsCheck = [ "magika" ];
passthru.tests.version = testers.testVersion { package = magika; };
meta = {
description = "Detect file content types with deep learning";
homepage = "https://github.com/google/magika";
changelog = "https://github.com/google/magika/blob/python-v${version}/python/CHANGELOG.md";
license = lib.licenses.asl20;
maintainers = with lib.maintainers; [ mihaimaruseac ];
mainProgram = "magika-python-client";
# Currently, disabling on AArch64 as it onnx runtime crashes on ofborg
broken = stdenv.hostPlatform.isAarch64 && stdenv.hostPlatform.isLinux;
};
}