Skip to content

Commit 5bdc59d

Browse files
committed
Merge remote-tracking branch 'upstream/main' into feat/691-uzair-provides
Signed-off-by: Uzair Chhapra <[email protected]>
2 parents bd370af + d6a87c5 commit 5bdc59d

File tree

188 files changed

+4001
-1395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

188 files changed

+4001
-1395
lines changed

.flake8

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ copyright-text =
4141
'#'
4242
'# SPDX-License-Identifier: Apache-2.0'
4343
'# Copyright (c) OWASP Foundation. All Rights Reserved.'
44+
lines-to-exclude =
45+
## shebang
46+
'#!'

.gitattributes

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/python.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,10 @@ jobs:
115115
strategy:
116116
fail-fast: false
117117
matrix:
118-
os: ['ubuntu-latest', 'windows-latest', 'macos-13']
118+
os:
119+
- ubuntu-latest
120+
- macos-13 # macos-latest might be incompatible to py38 - see https://github.com/CycloneDX/cyclonedx-python-lib/pull/599#issuecomment-2077462142
121+
- windows-latest
119122
python-version:
120123
- "3.13" # highest supported
121124
- "3.12"

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ jobs:
122122

123123
- name: Publish package distributions to GitHub Releases
124124
if: steps.release.outputs.released == 'true'
125-
# see https://github.com/python-semantic-release/upload-to-gh-release
126-
uses: python-semantic-release/upload-to-gh-release@main
125+
# see https://python-semantic-release.readthedocs.io/en/latest/automatic-releases/github-actions.html#python-semantic-release-publish-action
126+
uses: python-semantic-release/publish-action@v9
127127
with:
128128
github_token: ${{ secrets.GITHUB_TOKEN }}
129129
tag: ${{ steps.release.outputs.tag }}

CHANGELOG.md

Lines changed: 186 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,192 @@
22

33

44

5+
## v9.1.1-rc.1 (2025-03-03)
6+
7+
8+
## v9.1.0 (2025-02-27)
9+
10+
### Feature
11+
12+
* feat: `model.VulnerabilityAnalysis` properties for issued/updated datetime (#794)
13+
14+
15+
16+
Signed-off-by: Indivar Mishra &lt;[email protected]&gt; ([`4a3955a`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/4a3955a610bad97550e11c426c61c1295b76f804))
17+
18+
### Fix
19+
20+
* fix: improved comparison functionality of `model.VulnerabilityAnalysis` (#795)
21+
22+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`7d57c73`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/7d57c73ef63bfb016099f4c0312b6702da488efc))
23+
24+
25+
## v9.0.2 (2025-02-26)
26+
27+
28+
## v9.0.0 (2025-02-26)
29+
30+
### Breaking
31+
32+
* feat!: 9.0.1 (#777)
33+
34+
35+
### BREAKING Changes
36+
37+
* Fix: `model.vulnerability.VulnerabilityReference`&#39;s properties are all
38+
mandatory
39+
([#790](https://github.com/CycloneDX/cyclonedx-python-lib/issues/790)
40+
via [#792](https://github.com/CycloneDX/cyclonedx-python-lib/pull/792))
41+
* Refactor: Rename `spdx.is_compund_expression` -&gt; `spdx.is_expression`
42+
([#779](https://github.com/CycloneDX/cyclonedx-python-lib/pull/779))
43+
* Behavior: `BomRef` affects comparison/hashing
44+
([#754](https://github.com/CycloneDX/cyclonedx-python-lib/pull/754) &amp;
45+
[#780](https://github.com/CycloneDX/cyclonedx-python-lib/pull/780))
46+
This is only a breaking change if you relied on ordering of elements.
47+
* Behavior: streamline comparison/hashing functions
48+
([#755](https://github.com/CycloneDX/cyclonedx-python-lib/pull/755))
49+
This is only a breaking change if you relied on ordering of elements.
50+
* Dependency: bump dependency `py-serializable &gt;=2 &lt;3`, was `&gt;=1.1.1 &lt;2`
51+
([#775](https://github.com/CycloneDX/cyclonedx-python-lib/pull/775))
52+
This is only a breaking change if you have other packages depend on that
53+
specific version.
54+
55+
---------
56+
57+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt;
58+
Signed-off-by: wkoot &lt;[email protected]&gt;
59+
Signed-off-by: semantic-release &lt;[email protected]&gt;
60+
Co-authored-by: wkoot &lt;[email protected]&gt;
61+
Co-authored-by: semantic-release &lt;[email protected]&gt; ([`e6f91fa`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/e6f91fa98cbb02cda62fd0bc5b1f1b9bf19902ee))
62+
63+
64+
## v8.9.0 (2025-02-25)
65+
66+
### Documentation
67+
68+
* docs: extended instructions for &#34;contributing&#34; (#783)
69+
70+
supersedes
71+
https://github.com/CycloneDX/cyclonedx-python-lib/pull/773/files#r1954324461
72+
73+
---------
74+
75+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`e2a4ed3`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/e2a4ed3608253b65a0f902f225fe7b7dd29ab864))
76+
77+
### Feature
78+
79+
* feat: avoid raising `NoPropertiesProvidedException` for optional parameters (#786)
80+
81+
the following classes&#39; init no longer raise `NoPropertiesProvidedException`:
82+
* `cyclonedx.model.IdentifiableAction`
83+
* `cyclonedx.model.component.Commit`
84+
* `cyclonedx.model.component.ComponentEvidence`
85+
* `cyclonedx.model.component.Diff`
86+
* `cyclonedx.model.component.Pedigree`
87+
* `cyclonedx.model.issue.IssueTypeSource`
88+
* `cyclonedx.model.vulnerability.VulnerabilityAnalysis`
89+
* `cyclonedx.model.vulnerability.VulnerabilityCredits`
90+
* `cyclonedx.model.vulnerability.VulnerabilityRating`
91+
* `cyclonedx.model.vulnerability.VulnerabilitySource`
92+
93+
---------
94+
95+
Signed-off-by: Indivar Mishra &lt;[email protected]&gt; ([`845b8d5`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/845b8d538d2f0fcadb3a3257a066ad58e3640c97))
96+
97+
98+
## v8.8.0 (2025-02-12)
99+
100+
### Feature
101+
102+
* feat: add `cyclonedx.model.crypto.ProtocolProperties.crypto_refs` (#767)
103+
104+
105+
Signed-off-by: Indivar Mishra &lt;[email protected]&gt; ([`beb35f5`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/beb35f55e3e75d625db45e4ff084dee02e919ef6))
106+
107+
108+
## v8.7.0 (2025-02-06)
109+
110+
### Feature
111+
112+
* feat: allow empty `OrganizationalContact` object (#772)
113+
114+
fixes https://github.com/CycloneDX/cyclonedx-python-lib/issues/771
115+
116+
---------
117+
118+
Signed-off-by: Johannes Feichtner &lt;[email protected]&gt;
119+
Signed-off-by: Johannes Feichtner &lt;[email protected]&gt; ([`03b35f4`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/03b35f4293ab3b4c402c7bb8ff458831e492cb8b))
120+
121+
122+
## v8.6.0 (2025-02-04)
123+
124+
### Feature
125+
126+
* feat: expand the capabilities of `models.definition.Standard` (#713)
127+
128+
129+
---------
130+
131+
Signed-off-by: Hakan Dilek &lt;[email protected]&gt;
132+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt;
133+
Co-authored-by: Jan Kowalleck &lt;[email protected]&gt; ([`901dcdc`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/901dcdc60a8a46d30878764d7b8bda69c6ba8b80))
134+
135+
* feat: allow empty `OrganizationalEntity` object (#768)
136+
137+
fixes https://github.com/CycloneDX/cyclonedx-python-lib/issues/764
138+
139+
Signed-off-by: Johannes Feichtner &lt;[email protected]&gt; ([`472bded`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/472bded38cd480ba6885d44c798e015b63c89190))
140+
141+
142+
## v8.5.1 (2025-01-28)
143+
144+
### Documentation
145+
146+
* docs: responsibilities &amp; capabilities (#763)
147+
148+
149+
150+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`ab4ae45`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/ab4ae4578555f010914d7e904133dd478d7c80c1))
151+
152+
* docs: Fix typos in in conda-forge.md and remove unused reference in README (#762)
153+
154+
- Fix few typos in conda-forge.md
155+
- Removed unused PEP-508 ref in README.md
156+
157+
Signed-off-by: Arthit Suriyawongkul &lt;[email protected]&gt; ([`66ece7a`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/66ece7ae0042740a541ceed3048b89c4f2b24145))
158+
159+
* docs: modernize docstrings for CDX1.6 (#759)
160+
161+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`fb9a42e`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/fb9a42ef9bda6407ddf4c49e75d10aa0fc91e46d))
162+
163+
### Feature
164+
165+
* feat: couple classes and their serializes (#757)
166+
167+
Deprecates `.serialization.BomRefHelper` and
168+
`.serialization.LicenseRepositoryHelper`
169+
170+
fixes #756
171+
172+
---------
173+
174+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`6003feb`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/6003febaa032969732ee246deb739d1e13bae581))
175+
176+
177+
## v8.5.0 (2024-11-18)
178+
179+
### Documentation
180+
181+
* docs: remove invalid docsting note about auto-assigned `bom-ref` values (#733) ([`5aa5787`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/5aa5787767c60dc23fd09f6cf14e54e5b0efceb4))
182+
183+
### Feature
184+
185+
* feat: support CycloneDX 1.6.1 (#742)
186+
187+
188+
Signed-off-by: Jan Kowalleck &lt;[email protected]&gt; ([`55eafed`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/55eafedf50d395911a697bd9c85eeab5820934ff))
189+
190+
5191
## v8.4.0 (2024-10-29)
6192

7193
### Feature

CONTRIBUTING.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
# Contributing
22

3-
Pull requests are welcome.
4-
But please read the
5-
[CycloneDX contributing guidelines](https://github.com/CycloneDX/.github/blob/master/CONTRIBUTING.md)
6-
first.
3+
Any contribution is welcome.
4+
Please read the [CycloneDX contributing guidelines](https://github.com/CycloneDX/.github/blob/master/CONTRIBUTING.md) first.
5+
6+
Pull-requests from forks are welcome.
7+
We love to see your purposed changes, but we also like to discuss things first. Please open a ticket and explain your intended changes to the community. And don't forget to mention that discussion in your pull-request later.
8+
Find the needed basics here:
9+
* [how to fork a repository](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo)
10+
* [how create a pull request from a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
711

812
## Setup
913

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,22 @@
1717
OWASP [CycloneDX][link_website] is a full-stack Bill of Materials (BOM) standard
1818
that provides advanced supply chain capabilities for cyber risk reduction.
1919

20-
This Python package provides data models, validators and more,
20+
This Python package provides data models, validators and more,
2121
to help you create/render/read CycloneDX documents.
2222

23-
**This package is not designed for standalone use. It is a software library.**
24-
25-
As of version `3.0.0`, the internal data model was adjusted to allow CycloneDX VEX documents to be produced as per
26-
[official examples](https://cyclonedx.org/capabilities/bomlink/#linking-external-vex-to-bom-inventory) linking VEX to a separate CycloneDX document.
27-
28-
If you're looking for a CycloneDX tool to run to generate (SBOM) software bill-of-materials documents, why not checkout
29-
[CycloneDX Python][cyclonedx-python] or [Jake][jake].
23+
> [!NOTE]
24+
> This package is a software library not intended for standalone use.
25+
> For generating Software Bill of Materials (SBOM), check out [CycloneDX Python][cyclonedx-python] or [Jake][jake].
3026
3127
## Documentation
3228

33-
View the documentation [here](https://cyclonedx-python-library.readthedocs.io/).
29+
Complete documentation is available on [Read the Docs][link_rtfd]. This includes:
30+
- Responsibilities & Capabilities
31+
- Install Instructions
32+
- API Reference
33+
- Usage Examples
34+
- Integration Guides
35+
- Best Practices
3436

3537
## Python Support
3638

@@ -81,5 +83,3 @@ See the [LICENSE][license_file] file for the full license.
8183
[link_slack]: https://cyclonedx.org/slack/invite
8284
[link_discussion]: https://groups.io/g/CycloneDX
8385
[link_twitter]: https://twitter.com/CycloneDX_Spec
84-
85-
[PEP-508]: https://www.python.org/dev/peps/pep-0508/

bandit.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
exclude_dirs:
55
- docs
66
- .venv
7+
- .tox
78

89
skips:
910
- B101

cyclonedx/__init__.py

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

2323
# !! version is managed by semantic_release
2424
# do not use typing here, or else `semantic_release` might have issues finding the variable
25-
__version__ = "8.4.0" # noqa:Q000
25+
__version__ = "9.1.1-rc.1" # noqa:Q000

cyclonedx/_internal/compare.py

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def __lt__(self, other: Any) -> bool:
4242
return False
4343
if o is None:
4444
return True
45-
return True if s < o else False
45+
return bool(s < o)
4646
return False
4747

4848
def __gt__(self, other: Any) -> bool:
@@ -54,44 +54,29 @@ def __gt__(self, other: Any) -> bool:
5454
return True
5555
if o is None:
5656
return False
57-
return True if s > o else False
57+
return bool(s > o)
5858
return False
5959

6060

61-
class ComparableDict:
61+
class ComparableDict(ComparableTuple):
6262
"""
6363
Allows comparison of dictionaries, allowing for missing/None values.
6464
"""
6565

66-
def __init__(self, dict_: Dict[Any, Any]) -> None:
67-
self._dict = dict_
68-
69-
def __lt__(self, other: Any) -> bool:
70-
if not isinstance(other, ComparableDict):
71-
return True
72-
keys = sorted(self._dict.keys() | other._dict.keys())
73-
return ComparableTuple(self._dict.get(k) for k in keys) \
74-
< ComparableTuple(other._dict.get(k) for k in keys)
75-
76-
def __gt__(self, other: Any) -> bool:
77-
if not isinstance(other, ComparableDict):
78-
return False
79-
keys = sorted(self._dict.keys() | other._dict.keys())
80-
return ComparableTuple(self._dict.get(k) for k in keys) \
81-
> ComparableTuple(other._dict.get(k) for k in keys)
66+
def __new__(cls, d: Dict[Any, Any]) -> 'ComparableDict':
67+
return super(ComparableDict, cls).__new__(cls, sorted(d.items()))
8268

8369

8470
class ComparablePackageURL(ComparableTuple):
8571
"""
8672
Allows comparison of PackageURL, allowing for qualifiers.
8773
"""
8874

89-
def __new__(cls, purl: 'PackageURL') -> 'ComparablePackageURL':
90-
return super().__new__(
91-
ComparablePackageURL, (
92-
purl.type,
93-
purl.namespace,
94-
purl.version,
95-
ComparableDict(purl.qualifiers) if isinstance(purl.qualifiers, dict) else purl.qualifiers,
96-
purl.subpath
97-
))
75+
def __new__(cls, p: 'PackageURL') -> 'ComparablePackageURL':
76+
return super(ComparablePackageURL, cls).__new__(cls, (
77+
p.type,
78+
p.namespace,
79+
p.version,
80+
ComparableDict(p.qualifiers) if isinstance(p.qualifiers, dict) else p.qualifiers,
81+
p.subpath
82+
))

0 commit comments

Comments
 (0)