summary refs log tree commit diff
path: root/pkgs/development/python-modules/reptor/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/reptor/default.nix')
-rw-r--r--pkgs/development/python-modules/reptor/default.nix99
1 files changed, 99 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/reptor/default.nix b/pkgs/development/python-modules/reptor/default.nix
new file mode 100644
index 00000000000..eafb5dd66a8
--- /dev/null
+++ b/pkgs/development/python-modules/reptor/default.nix
@@ -0,0 +1,99 @@
+{ lib
+, asgiref
+, buildPythonPackage
+, certifi
+, charset-normalizer
+, deepl
+, django
+, fetchFromGitHub
+, gql
+, idna
+, markdown-it-py
+, mdurl
+, pygments
+, pytest
+, pytestCheckHook
+, pythonOlder
+, pyyaml
+, reptor
+, requests
+, rich
+, setuptools
+, sqlparse
+, termcolor
+, toml
+, urllib3
+, xmltodict
+}:
+
+buildPythonPackage rec {
+  pname = "reptor";
+  version = "0.2";
+  format = "pyproject";
+
+  disabled = pythonOlder "3.8";
+
+  src = fetchFromGitHub {
+    owner = "Syslifters";
+    repo = "reptor";
+    rev = "refs/tags/${version}";
+    hash = "sha256-Pkz0snlYMd+xn7fJKVdO8M8wA7ABSq8R6i6UN+bwx6Y=";
+  };
+
+  nativeBuildInputs = [
+    setuptools
+  ];
+
+  propagatedBuildInputs = [
+    asgiref
+    certifi
+    charset-normalizer
+    django
+    idna
+    markdown-it-py
+    mdurl
+    pygments
+    pyyaml
+    requests
+    rich
+    sqlparse
+    termcolor
+    toml
+    urllib3
+    xmltodict
+  ];
+
+  passthru.optional-dependencies = {
+    ghostwriter = [
+      gql
+    ];
+    translate = [
+      deepl
+    ];
+  };
+
+  nativeCheckInputs = [
+    pytestCheckHook
+  ] ++ lib.flatten (builtins.attrValues passthru.optional-dependencies);
+
+  preCheck = ''
+    export HOME=$(mktemp -d)
+  '';
+
+  pythonImportsCheck = [
+    "reptor"
+  ];
+
+  disabledTestPaths = [
+    # Tests want to use pip install dependencies
+    "reptor/plugins/importers/GhostWriter/tests/test_ghostwriter.py"
+  ];
+
+  meta = with lib; {
+    description = "Module to do automated pentest reporting with SysReptor";
+    homepage = "https://github.com/Syslifters/reptor";
+    changelog = "https://github.com/Syslifters/reptor/releases/tag/${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+  };
+}