Skip to content

Commit add27ec

Browse files
authored
Merge branch 'main' into feat/validator_error_useful
Signed-off-by: Jan Kowalleck <[email protected]>
2 parents cfbdd30 + ea0a3d5 commit add27ec

File tree

16 files changed

+238
-219
lines changed

16 files changed

+238
-219
lines changed

.github/workflows/python.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,30 @@ jobs:
5050
- name: Run tox
5151
run: poetry run tox run -e pyupgrade -s false
5252

53+
deptry:
54+
name: test dependencies
55+
runs-on: ubuntu-latest
56+
timeout-minutes: 10
57+
steps:
58+
- name: Checkout
59+
# see https://github.com/actions/checkout
60+
uses: actions/checkout@v4
61+
- name: Setup Python Environment
62+
# see https://github.com/actions/setup-python
63+
uses: actions/setup-python@v5
64+
with:
65+
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
66+
architecture: 'x64'
67+
- name: Install poetry
68+
# see https://github.com/marketplace/actions/setup-poetry
69+
uses: Gr1N/setup-poetry@v9
70+
with:
71+
poetry-version: ${{ env.POETRY_VERSION }}
72+
- name: Install dependencies
73+
run: poetry install --no-root
74+
- name: Run tox
75+
run: poetry run tox run -e deptry -s false
76+
5377
coding-standards:
5478
name: Linting & CodingStandards
5579
runs-on: ubuntu-latest

.github/workflows/release.yml

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ on:
66
release_force:
77
# see https://python-semantic-release.readthedocs.io/en/latest/github-action.html#command-line-options
88
description: |
9-
Force release be one of: [major | minor | patch]
9+
Force release be one of: [major | minor | patch | prerelease]
1010
Leave empty for auto-detect based on commit messages.
1111
type: choice
1212
options:
13-
- "" # auto - no force
14-
- major # force major
15-
- minor # force minor
16-
- patch # force patch
13+
- "" # auto - no force
14+
- major # force major
15+
- minor # force minor
16+
- patch # force patch
17+
- prerelease # force prerelease
1718
default: ""
1819
required: false
1920
prerelease_token:
@@ -64,9 +65,32 @@ jobs:
6465
- name: Run tox
6566
run: poetry run tox run -e py -s false
6667

68+
deptry:
69+
runs-on: ubuntu-latest
70+
steps:
71+
- name: Checkout code
72+
# see https://github.com/actions/checkout
73+
uses: actions/checkout@v4
74+
- name: Setup Python Environment
75+
# see https://github.com/actions/setup-python
76+
uses: actions/setup-python@v5
77+
with:
78+
python-version: ${{ env.PYTHON_VERSION_DEFAULT }}
79+
architecture: 'x64'
80+
- name: Install poetry
81+
# see https://github.com/marketplace/actions/setup-poetry
82+
uses: Gr1N/setup-poetry@v9
83+
with:
84+
poetry-version: ${{ env.POETRY_VERSION }}
85+
- name: Install dependencies
86+
run: poetry install --no-root
87+
- name: Run tox
88+
run: poetry run tox run -e deptry -s false
89+
6790
release:
6891
needs:
6992
- quicktest
93+
- deptry
7094
# https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482
7195
# limit this to being run on regular commits, not the commits that semantic-release will create
7296
# but also allow manual workflow dispatch

CHANGELOG.md

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

33
<!-- version list -->
44

5+
## v10.4.1 (2025-07-08)
6+
7+
### Bug Fixes
8+
9+
- Add runtime dependnecy `typing_extensions>=4.6; python_version<"3.13"`
10+
([#845](https://github.com/CycloneDX/cyclonedx-python-lib/pull/845),
11+
[`95b560a`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/95b560a6730bc8bb43c41768a33ad221ba9ca283))
12+
13+
- Added runtime dependnecy `referencing>=0.28.4"`
14+
([#846](https://github.com/CycloneDX/cyclonedx-python-lib/pull/846),
15+
[`4d01e87`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/4d01e87dcf7a118d7f0011b669809d5df9bfd9d5))
16+
17+
18+
## v10.4.0 (2025-07-08)
19+
20+
### Bug Fixes
21+
22+
- Issue `DeprecationWarnings` for deprecated properties properly
23+
([#838](https://github.com/CycloneDX/cyclonedx-python-lib/pull/838),
24+
[`34a11aa`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/34a11aacf65a3be7766304e7ec3a009d2d8720d1))
25+
26+
- Removed meaningless pattern checks for CycloneDX 1.2 JSON schema
27+
([#843](https://github.com/CycloneDX/cyclonedx-python-lib/pull/843),
28+
[`6e8083a`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/6e8083a7adc626b6e420518c4919807574ad5f50))
29+
30+
### Features
31+
32+
- Decorate deprecated symbols ([#839](https://github.com/CycloneDX/cyclonedx-python-lib/pull/839),
33+
[`33daaf1`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/33daaf1e93b0993cc5076874e1894d8c9fcd4df9))
34+
35+
- Validators return specific error classes
36+
([#840](https://github.com/CycloneDX/cyclonedx-python-lib/pull/840),
37+
[`23a0f72`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/23a0f72ef29428e712917efa3b083c858e60dc04))
38+
39+
540
## v10.3.0 (2025-06-30)
641

742
### Documentation

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__ = "10.3.0" # noqa:Q000
25+
__version__ = "10.4.1" # noqa:Q000

cyclonedx/model/bom.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,8 @@ def __init__(
8787
self.properties = properties or []
8888
self.manufacturer = manufacturer
8989
self.lifecycles = lifecycles or []
90-
90+
# deprecated properties below
9191
self.manufacture = manufacture
92-
if manufacture:
93-
warn(
94-
'`bom.metadata.manufacture` is deprecated from CycloneDX v1.6 onwards. '
95-
'Please use `bom.metadata.component.manufacturer` instead.',
96-
DeprecationWarning)
9792

9893
@property
9994
@serializable.type_mapping(serializable.helpers.XsdDateTime)
@@ -214,6 +209,11 @@ def manufacture(self, manufacture: Optional[OrganizationalEntity]) -> None:
214209
@todo Based on https://github.com/CycloneDX/specification/issues/346,
215210
we should set this data on `.component.manufacturer`.
216211
"""
212+
if manufacture is not None:
213+
warn(
214+
'`bom.metadata.manufacture` is deprecated from CycloneDX v1.6 onwards. '
215+
'Please use `bom.metadata.component.manufacturer` instead.',
216+
DeprecationWarning)
217217
self._manufacture = manufacture
218218

219219
@property

cyclonedx/model/component.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1010,11 +1010,9 @@ def __init__(
10101010
self.supplier = supplier
10111011
self.manufacturer = manufacturer
10121012
self.authors = authors or []
1013-
self.author = author
10141013
self.publisher = publisher
10151014
self.group = group
10161015
self.name = name
1017-
self.version = version
10181016
self.description = description
10191017
self.scope = scope
10201018
self.hashes = hashes or []
@@ -1025,7 +1023,6 @@ def __init__(
10251023
self.omnibor_ids = omnibor_ids or []
10261024
self.swhids = swhids or []
10271025
self.swid = swid
1028-
self.modified = modified
10291026
self.pedigree = pedigree
10301027
self.external_references = external_references or []
10311028
self.properties = properties or []
@@ -1034,13 +1031,10 @@ def __init__(
10341031
self.release_notes = release_notes
10351032
self.crypto_properties = crypto_properties
10361033
self.tags = tags or []
1037-
1038-
if modified:
1039-
warn('`.component.modified` is deprecated from CycloneDX v1.3 onwards. '
1040-
'Please use `@.pedigree` instead.', DeprecationWarning)
1041-
if author:
1042-
warn('`.component.author` is deprecated from CycloneDX v1.6 onwards. '
1043-
'Please use `@.authors` or `@.manufacturer` instead.', DeprecationWarning)
1034+
# spec-deprecated properties below
1035+
self.author = author
1036+
self.modified = modified
1037+
self.version = version
10441038

10451039
@property
10461040
@serializable.type_mapping(_ComponentTypeSerializationHelper)
@@ -1175,6 +1169,9 @@ def author(self) -> Optional[str]:
11751169

11761170
@author.setter
11771171
def author(self, author: Optional[str]) -> None:
1172+
if author is not None:
1173+
warn('`@.author` is deprecated from CycloneDX v1.6 onwards. '
1174+
'Please use `@.authors` or `@.manufacturer` instead.', DeprecationWarning)
11781175
self._author = author
11791176

11801177
@property
@@ -1255,7 +1252,7 @@ def version(self) -> Optional[str]:
12551252
@version.setter
12561253
def version(self, version: Optional[str]) -> None:
12571254
if version and len(version) > 1024:
1258-
warn('`.component.version`has a maximum length of 1024 from CycloneDX v1.6 onwards.', UserWarning)
1255+
warn('`@.version`has a maximum length of 1024 from CycloneDX v1.6 onwards.', UserWarning)
12591256
self._version = version
12601257

12611258
@property
@@ -1450,6 +1447,9 @@ def modified(self) -> bool:
14501447

14511448
@modified.setter
14521449
def modified(self, modified: bool) -> None:
1450+
if modified:
1451+
warn('`@.modified` is deprecated from CycloneDX v1.3 onwards. '
1452+
'Please use `@.pedigree` instead.', DeprecationWarning)
14531453
self._modified = modified
14541454

14551455
@property

cyclonedx/model/tool.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,9 @@ def __init__(
203203
# Deprecated since v1.5
204204
tools: Optional[Iterable[Tool]] = None
205205
) -> None:
206-
if tools:
207-
warn('`@.tools` is deprecated from CycloneDX v1.5 onwards. '
208-
'Please use `@.components` and `@.services` instead.',
209-
DeprecationWarning)
210206
self.components = components or ()
211207
self.services = services or ()
208+
# spec-deprecated properties below
212209
self.tools = tools or ()
213210

214211
@property
@@ -241,6 +238,10 @@ def tools(self) -> 'SortedSet[Tool]':
241238

242239
@tools.setter
243240
def tools(self, tools: Iterable[Tool]) -> None:
241+
if tools:
242+
warn('`@.tools` is deprecated from CycloneDX v1.5 onwards. '
243+
'Please use `@.components` and `@.services` instead.',
244+
DeprecationWarning)
244245
self._tools = SortedSet(tools)
245246

246247
def __len__(self) -> int:

cyclonedx/schema/_res/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ Currently using version
1515
| [`bom-1.4.SNAPSHOT.xsd`](bom-1.4.SNAPSHOT.xsd) | applied changes: 1 |
1616
| [`bom-1.5.SNAPSHOT.xsd`](bom-1.5.SNAPSHOT.xsd) | applied changes: 1 |
1717
| [`bom-1.6.SNAPSHOT.xsd`](bom-1.6.SNAPSHOT.xsd) | applied changes: 1 |
18-
| [`bom-1.2.SNAPSHOT.schema.json`](bom-1.2.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
19-
| [`bom-1.3.SNAPSHOT.schema.json`](bom-1.3.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
20-
| [`bom-1.4.SNAPSHOT.schema.json`](bom-1.4.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
21-
| [`bom-1.5.SNAPSHOT.schema.json`](bom-1.5.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
22-
| [`bom-1.6.SNAPSHOT.schema.json`](bom-1.6.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
23-
| [`bom-1.2-strict.SNAPSHOT.schema.json`](bom-1.2-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
24-
| [`bom-1.3-strict.SNAPSHOT.schema.json`](bom-1.3-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5 |
18+
| [`bom-1.2.SNAPSHOT.schema.json`](bom-1.2.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
19+
| [`bom-1.3.SNAPSHOT.schema.json`](bom-1.3.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
20+
| [`bom-1.4.SNAPSHOT.schema.json`](bom-1.4.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
21+
| [`bom-1.5.SNAPSHOT.schema.json`](bom-1.5.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
22+
| [`bom-1.6.SNAPSHOT.schema.json`](bom-1.6.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
23+
| [`bom-1.2-strict.SNAPSHOT.schema.json`](bom-1.2-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
24+
| [`bom-1.3-strict.SNAPSHOT.schema.json`](bom-1.3-strict.SNAPSHOT.schema.json) | applied changes: 2,3,4,5,6 |
2525
| [`spdx.SNAPSHOT.xsd`](spdx.SNAPSHOT.xsd) | |
2626
| [`spdx.SNAPSHOT.schema.json`](spdx.SNAPSHOT.schema.json) | |
2727
| [`jsf-0.82.SNAPSHOT.schema.json`](jsf-0.82.SNAPSHOT.schema.json) | |
@@ -32,3 +32,4 @@ changes:
3232
3. `jsf-0.82.schema.json` was replaced with `jsf-0.82.SNAPSHOT.schema.json`
3333
4. `properties.$schema.enum` was removed
3434
5. `required.version` removed, as it is actually optional with default value
35+
6. `"pattern": "^(.*)$"` removed as it has no meaning

0 commit comments

Comments
 (0)