Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / python-modules / karton-classifier / default.nix
blob9f19e1ab6b9ed0b211729946f0b7d8d15df7a9f3
1 { lib
2 , buildPythonPackage
3 , chardet
4 , fetchFromGitHub
5 , karton-core
6 , pytestCheckHook
7 , python-magic
8 , pythonOlder
9 }:
11 buildPythonPackage rec {
12   pname = "karton-classifier";
13   version = "2.0.0";
14   format = "setuptools";
16   disabled = pythonOlder "3.7";
18   src = fetchFromGitHub {
19     owner = "CERT-Polska";
20     repo = pname;
21     rev = "refs/tags/v${version}";
22     hash = "sha256-DH8I4Lbbs2TVMvYlvh/P2I/7O4+VechP2JDDVHNsTSg=";
23   };
25   propagatedBuildInputs = [
26     chardet
27     karton-core
28     python-magic
29   ];
31   nativeCheckInputs = [
32     pytestCheckHook
33   ];
35   postPatch = ''
36     substituteInPlace requirements.txt \
37       --replace "chardet==3.0.4" "chardet" \
38       --replace "python-magic==0.4.18" "python-magic"
39   '';
41   pythonImportsCheck = [
42     "karton.classifier"
43   ];
45   disabledTests = [
46     # Tests expecting results from a different version of libmagic
47     "test_process_archive_ace"
48     "test_process_runnable_win32_lnk"
49     "test_process_misc_csv"
50   ];
52   meta = with lib; {
53     description = "File type classifier for the Karton framework";
54     homepage = "https://github.com/CERT-Polska/karton-classifier";
55     changelog = "https://github.com/CERT-Polska/karton-classifier/releases/tag/v${version}";
56     license = with licenses; [ bsd3 ];
57     maintainers = with maintainers; [ fab ];
58   };