ff1a94e523
The nixpkgs-unstable channel's programs.sqlite was used to identify packages producing exactly one binary, and these automatically added to their package definitions wherever possible.
85 lines
1.6 KiB
Nix
85 lines
1.6 KiB
Nix
{ lib
|
|
, appdirs
|
|
, buildPythonPackage
|
|
, cvss
|
|
, fetchFromGitHub
|
|
, httpx
|
|
, msgpack
|
|
, orjson
|
|
, packageurl-python
|
|
, pytestCheckHook
|
|
, pythonOlder
|
|
, pythonRelaxDepsHook
|
|
, semver
|
|
, setuptools
|
|
, tabulate
|
|
}:
|
|
|
|
buildPythonPackage rec {
|
|
pname = "appthreat-vulnerability-db";
|
|
version = "5.6.4";
|
|
pyproject = true;
|
|
|
|
disabled = pythonOlder "3.8";
|
|
|
|
src = fetchFromGitHub {
|
|
owner = "AppThreat";
|
|
repo = "vulnerability-db";
|
|
rev = "refs/tags/v${version}";
|
|
hash = "sha256-Uq0DXrNQRVhQaPXXGNjbnPhOYoPpa8H3WuDdotCKS8c=";
|
|
};
|
|
|
|
postPatch = ''
|
|
substituteInPlace pyproject.toml \
|
|
--replace-warn " --cov-report=term-missing --no-cov-on-fail --cov vdb" ""
|
|
'';
|
|
|
|
pythonRelaxDeps = [
|
|
"msgpack"
|
|
"semver"
|
|
];
|
|
|
|
nativeBuildInputs = [
|
|
pythonRelaxDepsHook
|
|
setuptools
|
|
];
|
|
|
|
propagatedBuildInputs = [
|
|
appdirs
|
|
cvss
|
|
httpx
|
|
msgpack
|
|
orjson
|
|
packageurl-python
|
|
semver
|
|
tabulate
|
|
] ++ httpx.optional-dependencies.http2;
|
|
|
|
nativeCheckInputs = [
|
|
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";
|
|
mainProgram = "vdb";
|
|
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 ];
|
|
};
|
|
}
|