15
15
16
16
"""Representation of this very python library."""
17
17
18
- __all__ = ['this_tool' , 'this_component' ]
19
-
20
- from typing import Iterable
18
+ __all__ = ['this_component' , 'this_tool' , ]
21
19
22
20
from .. import __version__ as __ThisVersion # noqa: N812
23
21
from ..model import ExternalReference , ExternalReferenceType , XsUri
27
25
28
26
# !!! keep this file in sync with `pyproject.toml`
29
27
30
- # !!!
31
- # things in here are built on demand, rather than using prepared frozen constants.
32
- # this is currently a draft and may change in the future.
33
- # !!!
34
-
35
-
36
- def __ext_refs () -> Iterable [ExternalReference ]:
37
- return (
38
- ExternalReference (
39
- type = ExternalReferenceType .BUILD_SYSTEM ,
40
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/actions' )
41
- ),
42
- ExternalReference (
43
- type = ExternalReferenceType .DISTRIBUTION ,
44
- url = XsUri ('https://pypi.org/project/cyclonedx-python-lib/' )
45
- ),
46
- ExternalReference (
47
- type = ExternalReferenceType .DOCUMENTATION ,
48
- url = XsUri ('https://cyclonedx-python-library.readthedocs.io/' )
49
- ),
50
- ExternalReference (
51
- type = ExternalReferenceType .ISSUE_TRACKER ,
52
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/issues' )
53
- ),
54
- ExternalReference (
55
- type = ExternalReferenceType .LICENSE ,
56
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE' )
57
- ),
58
- ExternalReference (
59
- type = ExternalReferenceType .RELEASE_NOTES ,
60
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md' )
61
- ),
62
- ExternalReference (
63
- type = ExternalReferenceType .VCS ,
64
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib' )
65
- ),
66
- ExternalReference (
67
- type = ExternalReferenceType .WEBSITE ,
68
- url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/#readme' )
69
- ),
70
- )
71
-
72
-
73
- def this_tool () -> Tool :
74
- """Representation of this very python library as a :class:`Tool`."""
75
-
76
- return Tool (
77
- vendor = 'CycloneDX' ,
78
- name = 'cyclonedx-python-lib' ,
79
- version = __ThisVersion or 'UNKNOWN' ,
80
- external_references = __ext_refs (),
81
- )
82
-
83
28
84
29
def this_component () -> Component :
85
30
"""Representation of this very python library as a :class:`Component`."""
86
-
87
31
return Component (
88
32
type = ComponentType .LIBRARY ,
89
33
group = 'CycloneDX' ,
@@ -92,6 +36,44 @@ def this_component() -> Component:
92
36
description = 'Python library for CycloneDX' ,
93
37
licenses = (DisjunctiveLicense (id = 'Apache-2.0' ,
94
38
acknowledgement = LicenseAcknowledgement .DECLARED ),),
95
- external_references = __ext_refs (),
96
- # to be expanded ...
39
+ external_references = (
40
+ ExternalReference (
41
+ type = ExternalReferenceType .BUILD_SYSTEM ,
42
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/actions' )
43
+ ),
44
+ ExternalReference (
45
+ type = ExternalReferenceType .DISTRIBUTION ,
46
+ url = XsUri ('https://pypi.org/project/cyclonedx-python-lib/' )
47
+ ),
48
+ ExternalReference (
49
+ type = ExternalReferenceType .DOCUMENTATION ,
50
+ url = XsUri ('https://cyclonedx-python-library.readthedocs.io/' )
51
+ ),
52
+ ExternalReference (
53
+ type = ExternalReferenceType .ISSUE_TRACKER ,
54
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/issues' )
55
+ ),
56
+ ExternalReference (
57
+ type = ExternalReferenceType .LICENSE ,
58
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/LICENSE' )
59
+ ),
60
+ ExternalReference (
61
+ type = ExternalReferenceType .RELEASE_NOTES ,
62
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/blob/main/CHANGELOG.md' )
63
+ ),
64
+ ExternalReference (
65
+ type = ExternalReferenceType .VCS ,
66
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib' )
67
+ ),
68
+ ExternalReference (
69
+ type = ExternalReferenceType .WEBSITE ,
70
+ url = XsUri ('https://github.com/CycloneDX/cyclonedx-python-lib/#readme' )
71
+ ),
72
+ ),
73
+ # to be extended...
97
74
)
75
+
76
+
77
+ def this_tool () -> Tool :
78
+ """Representation of this very python library as a :class:`Tool`."""
79
+ return Tool .from_component (this_component ())
0 commit comments