2021-10-19 23:54:15 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2022-09-20 22:32:12 +02:00
|
|
|
, ddt
|
2021-10-19 23:54:15 +02:00
|
|
|
, fetchFromGitHub
|
|
|
|
, importlib-metadata
|
2022-01-13 12:17:21 +01:00
|
|
|
, jsonschema
|
|
|
|
, lxml
|
2021-10-19 23:54:15 +02:00
|
|
|
, packageurl-python
|
|
|
|
, poetry-core
|
2022-09-16 09:50:47 -07:00
|
|
|
, pytestCheckHook
|
2022-04-14 22:40:13 +02:00
|
|
|
, python
|
2021-10-19 23:54:15 +02:00
|
|
|
, pythonOlder
|
|
|
|
, requirements-parser
|
2022-06-12 00:43:49 +02:00
|
|
|
, sortedcontainers
|
2021-10-19 23:54:15 +02:00
|
|
|
, setuptools
|
|
|
|
, toml
|
2021-11-10 15:41:21 +01:00
|
|
|
, types-setuptools
|
|
|
|
, types-toml
|
2022-04-14 22:40:13 +02:00
|
|
|
, xmldiff
|
2021-10-19 23:54:15 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "cyclonedx-python-lib";
|
2022-11-29 13:52:30 +00:00
|
|
|
version = "3.1.1";
|
2021-10-19 23:54:15 +02:00
|
|
|
format = "pyproject";
|
|
|
|
|
2022-04-14 22:40:13 +02:00
|
|
|
disabled = pythonOlder "3.9";
|
2021-10-19 23:54:15 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "CycloneDX";
|
|
|
|
repo = pname;
|
2022-04-20 12:37:33 +00:00
|
|
|
rev = "refs/tags/v${version}";
|
2022-11-29 13:52:30 +00:00
|
|
|
hash = "sha256-DajXu8aZAZyr7o0fGH9do9i/z+UqMMkcMXjbETtWa1g=";
|
2021-10-19 23:54:15 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
poetry-core
|
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
importlib-metadata
|
|
|
|
packageurl-python
|
|
|
|
requirements-parser
|
|
|
|
setuptools
|
2022-06-12 00:43:49 +02:00
|
|
|
sortedcontainers
|
2021-10-19 23:54:15 +02:00
|
|
|
toml
|
2021-11-10 15:41:21 +01:00
|
|
|
types-setuptools
|
|
|
|
types-toml
|
2021-10-19 23:54:15 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2022-09-20 22:32:12 +02:00
|
|
|
ddt
|
2022-01-13 12:17:21 +01:00
|
|
|
jsonschema
|
|
|
|
lxml
|
2022-09-20 22:32:12 +02:00
|
|
|
pytestCheckHook
|
2022-04-14 22:40:13 +02:00
|
|
|
xmldiff
|
2021-10-19 23:54:15 +02:00
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"cyclonedx"
|
|
|
|
];
|
|
|
|
|
2022-08-06 12:32:04 -04:00
|
|
|
preCheck = ''
|
2022-09-16 09:50:47 -07:00
|
|
|
export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
|
2022-08-06 12:32:04 -04:00
|
|
|
'';
|
2022-04-14 22:40:13 +02:00
|
|
|
|
2022-09-16 09:50:47 -07:00
|
|
|
pytestFlagsArray = [ "tests/" ];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# These tests require network access.
|
|
|
|
"test_bom_v1_3_with_metadata_component"
|
|
|
|
"test_bom_v1_4_with_metadata_component"
|
|
|
|
];
|
|
|
|
|
2021-10-19 23:54:15 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Python library for generating CycloneDX SBOMs";
|
|
|
|
homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";
|
|
|
|
license = with licenses; [ asl20 ];
|
|
|
|
maintainers = with maintainers; [ fab ];
|
|
|
|
};
|
|
|
|
}
|