a66bca1520
GitOrigin-RevId: 40f79f003b6377bd2f4ed4027dde1f8f922995dd
71 lines
1.4 KiB
Nix
71 lines
1.4 KiB
Nix
{ lib
|
|
, appdirs
|
|
, buildPythonPackage
|
|
, cvss
|
|
, fetchFromGitHub
|
|
, msgpack
|
|
, orjson
|
|
, packageurl-python
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, requests
|
|
, semver
|
|
, tabulate
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "appthreat-vulnerability-db";
|
|
version = "4.1.12";
|
|
format = "setuptools";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "AppThreat";
|
|
repo = "vulnerability-db";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-DHjB8hT9rP1yyeo9I5D8JGIXq+17RYX+e6H7BBuWTw4=";
|
|
};
|
|
|
|
propagatedBuildInputs = [
|
|
appdirs
|
|
cvss
|
|
msgpack
|
|
orjson
|
|
packageurl-python
|
|
requests
|
|
semver
|
|
tabulate
|
|
];
|
|
|
|
checkInputs = [
|
|
pytestCheckHook
|
|
];
|
|
|
|
postPatch = ''
|
|
substituteInPlace pytest.ini \
|
|
--replace " --cov-append --cov-report term --cov vdb" ""
|
|
'';
|
|
|
|
preCheck = ''
|
|
export HOME=$(mktemp -d);
|
|
'';
|
|
|
|
disabledTests = [
|
|
# Tests require network access
|
|
"test_bulk_search"
|
|
"test_download_recent"
|
|
];
|
|
|
|
pythonImportsCheck = [
|
|
"vdb"
|
|
];
|
|
|
|
meta = with lib; {
|
|
description = "Vulnerability database and package search for sources such as OSV, NVD, GitHub and npm";
|
|
homepage = "https://github.com/appthreat/vulnerability-db";
|
|
changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/v${version}";
|
|
license = with licenses; [ mit ];
|
|
maintainers = with maintainers; [ fab ];
|
|
};
|
|
}
|