nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 buildPythonPackage,
4 diskcache-stubs,
5 diskcache,
6 fetchFromGitHub,
7 jinja2,
8 packaging,
9 poetry-core,
10 pyparsing,
11 pytestCheckHook,
12 pyyaml,
13 requests,
14 types-pyyaml,
15 typing-extensions,
16 writableTmpDirAsHomeHook,
17}:
18
19buildPythonPackage (finalAttrs: {
20 pname = "pysigma";
21 version = "1.1.1";
22 pyproject = true;
23
24 src = fetchFromGitHub {
25 owner = "SigmaHQ";
26 repo = "pySigma";
27 tag = "v${finalAttrs.version}";
28 hash = "sha256-WAW6TD+cAdtHGxpCHvgaoIAWiKZD7jVztx1vr69lzxI=";
29 };
30
31 pythonRelaxDeps = [
32 "diskcache-stubs"
33 "jinja2"
34 "packaging"
35 "pyparsing"
36 "types-pyyaml"
37 ];
38
39 build-system = [ poetry-core ];
40
41 dependencies = [
42 diskcache
43 diskcache-stubs
44 jinja2
45 packaging
46 pyparsing
47 pyyaml
48 requests
49 types-pyyaml
50 typing-extensions
51 ];
52
53 nativeCheckInputs = [
54 pytestCheckHook
55 writableTmpDirAsHomeHook
56 ];
57
58 disabledTests = [
59 # Tests require network connection
60 "test_sigma_plugin_directory_default"
61 "test_sigma_plugin_directory_get_plugins_compatible"
62 "test_sigma_plugin_find_compatible_version"
63 "test_sigma_plugin_installation"
64 "test_sigma_plugin_pysigma_version_from_pypi"
65 "test_sigma_plugin_version_compatible"
66 "test_validator_valid_attack_tags_online"
67 "test_validator_valid_d3fend_tags_online"
68 ];
69
70 pythonImportsCheck = [ "sigma" ];
71
72 meta = {
73 description = "Library to parse and convert Sigma rules into queries";
74 homepage = "https://github.com/SigmaHQ/pySigma";
75 changelog = "https://github.com/SigmaHQ/pySigma/releases/tag/${finalAttrs.src.tag}";
76 license = lib.licenses.lgpl21Only;
77 maintainers = with lib.maintainers; [ fab ];
78 };
79})