1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 poetry-core,
6 pysigma,
7 pysigma-backend-elasticsearch,
8 pytestCheckHook,
9 pythonOlder,
10 pythonRelaxDepsHook,
11 requests,
12}:
13
14buildPythonPackage rec {
15 pname = "pysigma-backend-opensearch";
16 version = "1.0.2";
17 pyproject = true;
18
19 disabled = pythonOlder "3.8";
20
21 src = fetchFromGitHub {
22 owner = "SigmaHQ";
23 repo = "pySigma-backend-opensearch";
24 rev = "refs/tags/v${version}";
25 hash = "sha256-VEMt9CKbhPRj1182WcLOqF9JOEzorrz9Yyqp0+FAA88=";
26 };
27
28 postPatch = ''
29 substituteInPlace pyproject.toml \
30 --replace-fail " --cov=sigma --cov-report term --cov-report xml:cov.xml" ""
31 '';
32
33 pythonRelaxDeps = [ "pysigma" ];
34
35 build-system = [ poetry-core ];
36
37 nativeBuildInputs = [ pythonRelaxDepsHook ];
38
39 dependencies = [
40 pysigma
41 pysigma-backend-elasticsearch
42 ];
43
44 nativeCheckInputs = [
45 pytestCheckHook
46 requests
47 ];
48
49 pythonImportsCheck = [ "sigma.backends.opensearch" ];
50
51 disabledTests = [
52 # Tests requires network access
53 "test_connect_lucene"
54 ];
55
56 meta = with lib; {
57 description = "Library to support OpenSearch for pySigma";
58 homepage = "https://github.com/SigmaHQ/pySigma-backend-opensearch";
59 changelog = "https://github.com/SigmaHQ/pySigma-backend-opensearch/releases/tag/v${version}";
60 license = with licenses; [ lgpl21Only ];
61 maintainers = with maintainers; [ fab ];
62 };
63}