1{
2 lib,
3 buildPythonPackage,
4 defusedxml,
5 fetchFromGitHub,
6 pytestCheckHook,
7 pythonOlder,
8 pyyaml,
9 semantic-version,
10 setuptools,
11}:
12
13buildPythonPackage rec {
14 pname = "lib4sbom";
15 version = "0.8.4";
16 pyproject = true;
17
18 disabled = pythonOlder "3.7";
19
20 src = fetchFromGitHub {
21 owner = "anthonyharrison";
22 repo = "lib4sbom";
23 tag = "v${version}";
24 hash = "sha256-QTYtaEo5LdDPfv8KgQ3IUJgKphQl2xyQXrcSn19IeKo=";
25 };
26
27 build-system = [ setuptools ];
28
29 dependencies = [
30 defusedxml
31 pyyaml
32 semantic-version
33 ];
34
35 nativeCheckInputs = [ pytestCheckHook ];
36
37 disabledTests = [
38 # stub tests that always fail
39 "TestCycloneDXGenerator"
40 "TestCcycloneDX_parser"
41 "TestGenerator"
42 "TestOutput"
43 "TestParser"
44 "TestSPDX_Generator"
45 "TestSPDX_Parser"
46 # tests with missing getters
47 "test_set_downloadlocation"
48 "test_set_homepage"
49 "test_set_checksum"
50 "test_set_externalreference"
51 # checks for invalid return type
52 "test_set_type"
53 # wrong capilatization
54 "test_set_supplier"
55 "test_set_originator"
56 ];
57
58 pythonImportsCheck = [ "lib4sbom" ];
59
60 meta = with lib; {
61 description = "Library to ingest and generate SBOMs";
62 homepage = "https://github.com/anthonyharrison/lib4sbom";
63 changelog = "https://github.com/anthonyharrison/lib4sbom/releases/tag/${src.tag}";
64 license = licenses.asl20;
65 maintainers = with maintainers; [ teatwig ];
66 };
67}