Skip to content

Commit a0bfc3d

Browse files
authored
Merge pull request CycloneDX#3 from CycloneDX/main
sync
2 parents f4ac55d + 90e2578 commit a0bfc3d

20 files changed

+1753
-1167
lines changed

CHANGELOG.md

Lines changed: 1195 additions & 1159 deletions
Large diffs are not rendered by default.

cyclonedx/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@
2020

2121
# !! version is managed by semantic_release
2222
# do not use typing here, or else `semantic_release` might have issues finding the variable
23-
__version__ = "7.4.0" # noqa:Q000
23+
__version__ = "7.4.1" # noqa:Q000

cyclonedx/model/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ class Property:
845845
Specifies an individual property with a name and value.
846846
"""
847847

848-
def __init__(self, *, name: str, value: str) -> None:
848+
def __init__(self, *, name: str, value: Optional[str] = None) -> None:
849849
self.name = name
850850
self.value = value
851851

@@ -868,7 +868,7 @@ def name(self, name: str) -> None:
868868

869869
@property
870870
@serializable.xml_name('.')
871-
def value(self) -> str:
871+
def value(self) -> Optional[str]:
872872
"""
873873
Value of this Property.
874874
@@ -878,7 +878,7 @@ def value(self) -> str:
878878
return self._value
879879

880880
@value.setter
881-
def value(self, value: str) -> None:
881+
def value(self, value: Optional[str]) -> None:
882882
self._value = value
883883

884884
def __eq__(self, other: object) -> bool:

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020

2121
# The full version, including alpha/beta/rc tags
2222
# !! version is managed by semantic_release
23-
release = '7.4.0'
23+
release = '7.4.1'
2424

2525
# -- General configuration ---------------------------------------------------
2626

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
55
[tool.poetry]
66
name = "cyclonedx-python-lib"
77
# !! version is managed by semantic_release
8-
version = "7.4.0"
8+
version = "7.4.1"
99
description = "Python library for CycloneDX"
1010
authors = [
1111
"Paul Horton <[email protected]>",
@@ -95,7 +95,7 @@ autopep8 = "2.2.0"
9595
mypy = "1.10.0"
9696
tox = "4.15.1"
9797
xmldiff = "2.7.0"
98-
bandit = "1.7.8"
98+
bandit = "1.7.9"
9999

100100
[tool.semantic_release]
101101
# see https://python-semantic-release.readthedocs.io/en/latest/configuration.html

tests/_data/models.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,6 +1108,20 @@ def bom_all_same_bomref() -> Tuple[Bom, int]:
11081108
return bom, nr_bomrefs
11091109

11101110

1111+
def get_bom_for_issue_630_empty_property() -> Bom:
1112+
"""regression test for issue #630
1113+
see https://github.com/CycloneDX/cyclonedx-python-lib/issues/630
1114+
"""
1115+
return _make_bom(components={
1116+
Component(
1117+
bom_ref='[email protected]',
1118+
type=ComponentType.LIBRARY,
1119+
name='example',
1120+
version='15.8.0',
1121+
properties=[Property(name='cdx:npm:package:path')]
1122+
)
1123+
})
1124+
11111125
# ---
11121126

11131127

@@ -1147,4 +1161,5 @@ def bom_all_same_bomref() -> Tuple[Bom, int]:
11471161
get_bom_for_issue_497_urls,
11481162
get_bom_for_issue_598_multiple_components_with_purl_qualifiers,
11491163
get_bom_with_component_setuptools_with_v16_fields,
1164+
get_bom_for_issue_630_empty_property,
11501165
}

tests/_data/own/xml/1.6/regression_issue630.xml

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.0" version="1">
3+
<components>
4+
<component type="library">
5+
<name>example</name>
6+
<version>15.8.0</version>
7+
<modified>false</modified>
8+
</component>
9+
</components>
10+
</bom>
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<?xml version="1.0" ?>
2+
<bom xmlns="http://cyclonedx.org/schema/bom/1.1" serialNumber="urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac" version="1">
3+
<components>
4+
<component type="library" bom-ref="[email protected]">
5+
<name>example</name>
6+
<version>15.8.0</version>
7+
</component>
8+
</components>
9+
</bom>
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{
2+
"components": [
3+
{
4+
"bom-ref": "[email protected]",
5+
"name": "example",
6+
"type": "library",
7+
"version": "15.8.0"
8+
}
9+
],
10+
"dependencies": [
11+
{
12+
13+
}
14+
],
15+
"metadata": {
16+
"timestamp": "2023-01-07T13:44:32.312678+00:00",
17+
"tools": [
18+
{
19+
"name": "cyclonedx-python-lib",
20+
"vendor": "CycloneDX",
21+
"version": "TESTING"
22+
}
23+
]
24+
},
25+
"serialNumber": "urn:uuid:1441d33a-e0fc-45b5-af3b-61ee52a88bac",
26+
"version": 1,
27+
"$schema": "http://cyclonedx.org/schema/bom-1.2b.schema.json",
28+
"bomFormat": "CycloneDX",
29+
"specVersion": "1.2"
30+
}

0 commit comments

Comments
 (0)