python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / tools / security / ioccheck / default.nix
blobfb5c887a8bf913ad6dc1b0b52c9320b026d9e65a
1 { lib
2 , fetchFromGitHub
3 , python3
4 }:
6 let
7   py = python3.override {
8     packageOverrides = self: super: {
9       emoji = super.emoji.overridePythonAttrs (oldAttrs: rec {
10         version = "1.7.0";
12         src = fetchFromGitHub {
13           owner = "carpedm20";
14           repo = "emoji";
15           rev = "v${version}";
16           sha256 = "sha256-vKQ51RP7uy57vP3dOnHZRSp/Wz+YDzeLUR8JnIELE/I=";
17         };
18       });
20       # Support for later tweepy releases is missing
21       # https://github.com/ranguli/ioccheck/issues/70
22       tweepy = super.tweepy.overridePythonAttrs (oldAttrs: rec {
23         version = "3.10.0";
25         src = fetchFromGitHub {
26           owner = "tweepy";
27           repo = "tweepy";
28           rev = "v${version}";
29           sha256 = "0k4bdlwjna6f1k19jki4xqgckrinkkw8b9wihzymr1l04rwd05nw";
30         };
31         doCheck = false;
32       });
33     };
34   };
36 with py.pkgs;
38 buildPythonApplication rec {
39   pname = "ioccheck";
40   version = "unstable-2021-09-29";
41   format = "pyproject";
43   src = fetchFromGitHub {
44     owner = "ranguli";
45     repo = pname;
46     rev = "db02d921e2519b77523a200ca2d78417802463db";
47     sha256 = "0lgqypcd5lzb2yqd5lr02pba24m26ghly4immxgz13svi8f6vzm9";
48   };
50   nativeBuildInputs = with py.pkgs; [
51     poetry-core
52   ];
54   propagatedBuildInputs = with py.pkgs; [
55     backoff
56     click
57     emoji
58     jinja2
59     pyfiglet
60     ratelimit
61     requests
62     shodan
63     tabulate
64     termcolor
65     tweepy
66     vt-py
67   ];
69   checkInputs = with py.pkgs; [
70     pytestCheckHook
71   ];
73   postPatch = ''
74     # Can be removed with the next release
75     substituteInPlace pyproject.toml \
76       --replace '"hurry.filesize" = "^0.9"' "" \
77       --replace 'vt-py = ">=0.6.1,<0.8.0"' 'vt-py = ">=0.6.1"' \
78       --replace 'backoff = "^1.10.0"' 'backoff = ">=1.10.0"' \
79       --replace 'termcolor = "^1.1.0"' 'termcolor = "*"'
80   '';
82   pythonImportsCheck = [
83     "ioccheck"
84   ];
86   meta = with lib; {
87     description = "Tool for researching IOCs";
88     homepage = "https://github.com/ranguli/ioccheck";
89     license = with licenses; [ mit ];
90     maintainers = with maintainers; [ fab ];
91   };