2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
jsonschema,
|
|
|
|
unittestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
setuptools,
|
2022-11-27 09:42:12 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cvss";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "3.1";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "RedHatProductSecurity";
|
2024-01-25 14:12:00 +00:00
|
|
|
repo = "cvss";
|
2022-11-27 09:42:12 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-e/zwOfbt3YLlRiLFObjps3tFFk6BAWBKdanio6sus8c=";
|
2022-11-27 09:42:12 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-11-27 09:42:12 +00:00
|
|
|
jsonschema
|
2024-01-25 14:12:00 +00:00
|
|
|
unittestCheckHook
|
2022-11-27 09:42:12 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "cvss" ];
|
2022-11-27 09:42:12 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
cd tests
|
|
|
|
'';
|
2022-11-27 09:42:12 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
2024-01-25 14:12:00 +00:00
|
|
|
description = "Library for CVSS2/3/4";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "cvss_calculator";
|
2022-11-27 09:42:12 +00:00
|
|
|
homepage = "https://github.com/RedHatProductSecurity/cvss";
|
|
|
|
changelog = "https://github.com/RedHatProductSecurity/cvss/releases/tag/v${version}";
|
|
|
|
license = with licenses; [ lgpl3Plus ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|