nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 click,
6 ansimarkup,
7 cachetools,
8 colorama,
9 click-default-group,
10 click-repl,
11 dict2xml,
12 hatchling,
13 jinja2,
14 more-itertools,
15 requests,
16 six,
17 pytestCheckHook,
18 mock,
19 # The REPL depends on click-repl, which is incompatible with our version of
20 # click.
21 withRepl ? false,
22}:
23
24buildPythonPackage rec {
25 pname = "greynoise";
26 version = "3.0.1";
27 pyproject = true;
28
29 src = fetchFromGitHub {
30 owner = "GreyNoise-Intelligence";
31 repo = "pygreynoise";
32 tag = "v${version}";
33 hash = "sha256-wJDO666HC3EohfR+LbG5F0Cp/eL7q4kXniWhJfc7C3s=";
34 };
35
36 patches = lib.optionals (!withRepl) [
37 ./remove-repl.patch
38 ];
39
40 build-system = [
41 hatchling
42 ];
43
44 pythonRelaxDeps = [
45 "click"
46 ];
47
48 dependencies = [
49 click
50 ansimarkup
51 cachetools
52 colorama
53 click-default-group
54 dict2xml
55 jinja2
56 more-itertools
57 requests
58 six
59 ]
60 ++ lib.optionals withRepl [
61 click-repl
62 ];
63
64 nativeCheckInputs = [
65 pytestCheckHook
66 mock
67 ];
68
69 pythonImportsCheck = [ "greynoise" ];
70
71 meta = {
72 description = "Python3 library and command line for GreyNoise";
73 mainProgram = "greynoise";
74 homepage = "https://github.com/GreyNoise-Intelligence/pygreynoise";
75 changelog = "https://github.com/GreyNoise-Intelligence/pygreynoise/blob/${src.tag}/CHANGELOG.rst";
76 license = lib.licenses.mit;
77 maintainers = [ ];
78 };
79}