Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 47 lines 999 B view raw
1{ lib 2, buildPythonPackage 3, chardet 4, fetchFromGitHub 5, karton-core 6, python 7, python_magic 8}: 9 10buildPythonPackage rec { 11 pname = "karton-classifier"; 12 version = "1.1.0"; 13 14 src = fetchFromGitHub { 15 owner = "CERT-Polska"; 16 repo = pname; 17 rev = "v${version}"; 18 sha256 = "0s09mzsw546klnvm59wzj9vdwd2hyzgxvapi20k86q3prs9ncds6"; 19 }; 20 21 propagatedBuildInputs = [ 22 chardet 23 karton-core 24 python_magic 25 ]; 26 27 postPatch = '' 28 substituteInPlace requirements.txt \ 29 --replace "chardet==3.0.4" "chardet" \ 30 --replace "python-magic==0.4.18" "python-magic" 31 ''; 32 33 checkPhase = '' 34 runHook preCheck 35 ${python.interpreter} -m unittest discover 36 runHook postCheck 37 ''; 38 39 pythonImportsCheck = [ "karton.classifier" ]; 40 41 meta = with lib; { 42 description = "File type classifier for the Karton framework"; 43 homepage = "https://github.com/CERT-Polska/karton-classifier"; 44 license = with licenses; [ bsd3 ]; 45 maintainers = with maintainers; [ fab ]; 46 }; 47}