From 5ee1f6334e7ca24cd89c7e18a4f2abe4e7eb7e16 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 22 Jan 2022 12:19:00 +0100 Subject: [PATCH] appthreat-depscan: init at 2.1.0 --- .../tools/appthreat-depscan/default.nix | 52 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 2 files changed, 54 insertions(+) create mode 100644 pkgs/development/tools/appthreat-depscan/default.nix diff --git a/pkgs/development/tools/appthreat-depscan/default.nix b/pkgs/development/tools/appthreat-depscan/default.nix new file mode 100644 index 000000000000..2177c20a972b --- /dev/null +++ b/pkgs/development/tools/appthreat-depscan/default.nix @@ -0,0 +1,52 @@ +{ lib +, fetchFromGitHub +, python3 +}: + +python3.pkgs.buildPythonApplication rec { + pname = "appthreat-depscan"; + version = "2.1.0"; + + src = fetchFromGitHub { + owner = "AppThreat"; + repo = "dep-scan"; + rev = "v${version}"; + hash = "sha256-HCOS8/jn7BOzDwSpenVGo6QpI/1ey6L1zBucTyqsSY4="; + }; + + propagatedBuildInputs = with python3.pkgs; [ + appthreat-vulnerability-db + defusedxml + pyyaml + rich + ]; + + checkInputs = with python3.pkgs; [ + pytestCheckHook + ]; + + postPatch = '' + substituteInPlace pytest.ini \ + --replace " --cov-append --cov-report term --cov depscan" "" + ''; + + preCheck = '' + export HOME=$(mktemp -d); + ''; + + disabledTests = [ + # Assertion Error + "test_query_metadata2" + ]; + + pythonImportsCheck = [ + "depscan" + ]; + + meta = with lib; { + description = "Tool to audit dependencies based on known vulnerabilities and advisories"; + homepage = "https://github.com/AppThreat/dep-scan"; + license = with licenses; [ mit ]; + maintainers = with maintainers; [ fab ]; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9c387d041fdf..51bed5c6964f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -200,6 +200,8 @@ with pkgs; fission = callPackage ../development/tools/fission { }; + appthreat-depscan = callPackage ../development/tools/appthreat-depscan { }; + authy = callPackage ../applications/misc/authy { }; avro-tools = callPackage ../development/tools/avro-tools { };