about summary refs log tree commit diff
path: root/pkgs/development/python-modules/sarif-tools/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/python-modules/sarif-tools/default.nix')
-rw-r--r--pkgs/development/python-modules/sarif-tools/default.nix64
1 files changed, 64 insertions, 0 deletions
diff --git a/pkgs/development/python-modules/sarif-tools/default.nix b/pkgs/development/python-modules/sarif-tools/default.nix
new file mode 100644
index 0000000000000..20fdc0343457d
--- /dev/null
+++ b/pkgs/development/python-modules/sarif-tools/default.nix
@@ -0,0 +1,64 @@
+{
+  lib,
+  fetchFromGitHub,
+  buildPythonPackage,
+  poetry-core,
+  jsonpath-ng,
+  jinja2,
+  python,
+  python-docx,
+  matplotlib,
+  pyyaml,
+  pytestCheckHook,
+  pythonOlder,
+  pythonRelaxDepsHook,
+}:
+
+buildPythonPackage rec {
+  pname = "sarif-tools";
+  version = "2.0.0";
+  pyproject = true;
+
+  src = fetchFromGitHub {
+    owner = "microsoft";
+    repo = "sarif-tools";
+    rev = "v${version}";
+    hash = "sha256-80amYGnf7xZdpxzTjBGwgg39YN/jJsEkTm0uAlVbH0w=";
+  };
+
+  disabled = pythonOlder "3.8";
+
+  nativeBuildInputs = [
+    poetry-core
+    pythonRelaxDepsHook
+  ];
+
+  propagatedBuildInputs = [
+    jsonpath-ng
+    jinja2
+    python
+    python-docx
+    matplotlib
+    pyyaml
+  ];
+
+  nativeCheckInputs = [ pytestCheckHook ];
+
+  pythonRelaxDeps = [ "python-docx" ];
+
+  disabledTests = [
+    # Broken, re-enable once https://github.com/microsoft/sarif-tools/pull/41 is merged
+    "test_version"
+  ];
+
+  pythonImportsCheck = [ "sarif" ];
+
+  meta = {
+    description = "Set of command line tools and Python library for working with SARIF files";
+    homepage = "https://github.com/microsoft/sarif-tools";
+    changelog = "https://github.com/microsoft/sarif-tools/releases/tag/v${version}";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ puzzlewolf ];
+    mainProgram = "sarif";
+  };
+}