1{ lib
2, buildPythonPackage
3, ddt
4, fetchFromGitHub
5, importlib-metadata
6, jsonschema
7, license-expression
8, lxml
9, packageurl-python
10, py-serializable
11, pythonRelaxDepsHook
12, poetry-core
13, pytestCheckHook
14, pythonOlder
15, requirements-parser
16, sortedcontainers
17, setuptools
18, toml
19, types-setuptools
20, types-toml
21, xmldiff
22}:
23
24buildPythonPackage rec {
25 pname = "cyclonedx-python-lib";
26 version = "5.1.1";
27 format = "pyproject";
28
29 disabled = pythonOlder "3.9";
30
31 src = fetchFromGitHub {
32 owner = "CycloneDX";
33 repo = "cyclonedx-python-lib";
34 rev = "refs/tags/v${version}";
35 hash = "sha256-M3aR3lCNtPIve1o16QLSnxrULhtXkuOXNYtOv2FmPMQ=";
36 };
37
38 nativeBuildInputs = [
39 poetry-core
40 pythonRelaxDepsHook
41 ];
42
43 propagatedBuildInputs = [
44 importlib-metadata
45 license-expression
46 packageurl-python
47 requirements-parser
48 setuptools
49 sortedcontainers
50 toml
51 py-serializable
52 types-setuptools
53 types-toml
54 ];
55
56 nativeCheckInputs = [
57 ddt
58 jsonschema
59 lxml
60 pytestCheckHook
61 xmldiff
62 ];
63
64 pythonImportsCheck = [
65 "cyclonedx"
66 ];
67
68 pythonRelaxDeps = [
69 "py-serializable"
70 ];
71
72 preCheck = ''
73 export PYTHONPATH=tests''${PYTHONPATH+:$PYTHONPATH}
74 '';
75
76 pytestFlagsArray = [
77 "tests/"
78 ];
79
80 disabledTests = [
81 # These tests require network access
82 "test_bom_v1_3_with_metadata_component"
83 "test_bom_v1_4_with_metadata_component"
84 # AssertionError: <ValidationError: "{'algorithm': 'ES256', ...
85 "TestJson"
86 ];
87
88 disabledTestPaths = [
89 # Test failures seem py-serializable related
90 "tests/test_output_xml.py"
91 ];
92
93 meta = with lib; {
94 description = "Python library for generating CycloneDX SBOMs";
95 homepage = "https://github.com/CycloneDX/cyclonedx-python-lib";
96 changelog = "https://github.com/CycloneDX/cyclonedx-python-lib/releases/tag/v${version}";
97 license = with licenses; [ asl20 ];
98 maintainers = with maintainers; [ fab ];
99 };
100}