2022-02-10 20:34:41 +00:00
|
|
|
{ lib
|
2022-11-27 09:42:12 +00:00
|
|
|
, appdirs
|
2022-02-10 20:34:41 +00:00
|
|
|
, buildPythonPackage
|
2022-11-27 09:42:12 +00:00
|
|
|
, cvss
|
2022-02-10 20:34:41 +00:00
|
|
|
, fetchFromGitHub
|
2022-12-28 21:21:41 +00:00
|
|
|
, httpx
|
2022-02-10 20:34:41 +00:00
|
|
|
, msgpack
|
|
|
|
, orjson
|
|
|
|
, packageurl-python
|
|
|
|
, pytestCheckHook
|
2022-11-27 09:42:12 +00:00
|
|
|
, pythonOlder
|
2023-05-24 13:37:59 +00:00
|
|
|
, pythonRelaxDepsHook
|
2022-11-27 09:42:12 +00:00
|
|
|
, semver
|
2023-07-15 17:15:38 +00:00
|
|
|
, setuptools
|
2022-11-27 09:42:12 +00:00
|
|
|
, tabulate
|
2022-02-10 20:34:41 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "appthreat-vulnerability-db";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "5.6.4";
|
2024-01-02 11:29:13 +00:00
|
|
|
pyproject = true;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-02-07 01:22:34 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2022-02-10 20:34:41 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AppThreat";
|
|
|
|
repo = "vulnerability-db";
|
2022-04-15 01:41:22 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-Uq0DXrNQRVhQaPXXGNjbnPhOYoPpa8H3WuDdotCKS8c=";
|
2022-02-10 20:34:41 +00:00
|
|
|
};
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
postPatch = ''
|
2024-02-07 01:22:34 +00:00
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace-warn " --cov-report=term-missing --no-cov-on-fail --cov vdb" ""
|
2023-05-24 13:37:59 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
2024-01-13 08:15:51 +00:00
|
|
|
"msgpack"
|
2023-05-24 13:37:59 +00:00
|
|
|
"semver"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
pythonRelaxDepsHook
|
2023-07-15 17:15:38 +00:00
|
|
|
setuptools
|
2023-05-24 13:37:59 +00:00
|
|
|
];
|
|
|
|
|
2022-02-10 20:34:41 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
appdirs
|
2022-11-27 09:42:12 +00:00
|
|
|
cvss
|
2022-12-28 21:21:41 +00:00
|
|
|
httpx
|
2022-02-10 20:34:41 +00:00
|
|
|
msgpack
|
|
|
|
orjson
|
|
|
|
packageurl-python
|
2022-11-27 09:42:12 +00:00
|
|
|
semver
|
|
|
|
tabulate
|
2022-12-28 21:21:41 +00:00
|
|
|
] ++ httpx.optional-dependencies.http2;
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-02-10 20:34:41 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
|
|
|
|
|
|
|
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";
|
2022-11-27 09:42:12 +00:00
|
|
|
changelog = "https://github.com/AppThreat/vulnerability-db/releases/tag/v${version}";
|
2022-02-10 20:34:41 +00:00
|
|
|
license = with licenses; [ mit ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|