summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/greynoise/default.nix
blob: 1577fafa790a15663a34a05b09c3fe5727760fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  click,
  ansimarkup,
  cachetools,
  colorama,
  click-default-group,
  click-repl,
  dict2xml,
  hatchling,
  jinja2,
  more-itertools,
  requests,
  six,
  pytestCheckHook,
  mock,
  # The REPL depends on click-repl, which is incompatible with our version of
  # click.
  withRepl ? false,
}:

buildPythonPackage rec {
  pname = "greynoise";
  version = "3.0.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "GreyNoise-Intelligence";
    repo = "pygreynoise";
    tag = "v${version}";
    hash = "sha256-wJDO666HC3EohfR+LbG5F0Cp/eL7q4kXniWhJfc7C3s=";
  };

  patches = lib.optionals (!withRepl) [
    ./remove-repl.patch
  ];

  build-system = [
    hatchling
  ];

  pythonRelaxDeps = [
    "click"
  ];

  dependencies = [
    click
    ansimarkup
    cachetools
    colorama
    click-default-group
    dict2xml
    jinja2
    more-itertools
    requests
    six
  ]
  ++ lib.optionals withRepl [
    click-repl
  ];

  nativeCheckInputs = [
    pytestCheckHook
    mock
  ];

  pythonImportsCheck = [ "greynoise" ];

  meta = {
    description = "Python3 library and command line for GreyNoise";
    mainProgram = "greynoise";
    homepage = "https://github.com/GreyNoise-Intelligence/pygreynoise";
    changelog = "https://github.com/GreyNoise-Intelligence/pygreynoise/blob/${src.tag}/CHANGELOG.rst";
    license = lib.licenses.mit;
    maintainers = [ ];
  };
}