Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
steps:
- name: Checkout
uses: actions/checkout@v7
Expand All @@ -34,7 +34,7 @@ jobs:
contents: write
strategy:
matrix:
python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ]
python-version: [ "3.11", "3.12", "3.13", "3.14" ]
steps:
- name: Checkout
uses: actions/checkout@v7
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Set up Poetry project
uses: ./.github/actions/setup-poetry-project
with:
python-version: '3.10'
python-version: '3.11'
install-args: --sync --no-interaction
- name: Package project
run: |
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ read/write Siemens [Standard BOM](https://sbom.siemens.io/latest/format.html)

## Commands (run from repo root)

- Full check (lint + type + tests, Python 3.10-3.14): `poetry run tox run`
- Full check (lint + type + tests, Python 3.11-3.14): `poetry run tox run`
- Lint + types only: `poetry run tox run -e lint,type`
- Tests on one interpreter: `poetry run tox run -e 3.12`
- Single test: `poetry run python -m unittest tests.test_v3_parser.SbomV3ParserTestCase.test_read_sunny_day`
Expand Down Expand Up @@ -46,7 +46,7 @@ Config:

- [mypy](https://mypy.readthedocs.io/en/stable/) `strict = True`, `implicit_reexport = False`;
- [flake8](https://flake8.pycqa.org/) max line length 140, max complexity 8, doctests checked.
- Requires Python >=3.10,<4.0 and [Poetry](https://python-poetry.org/) >= 2.0.
- Requires Python >=3.11,<4.0 and [Poetry](https://python-poetry.org/) >= 2.0.
- Release: bump `version` in [`pyproject.toml`](pyproject.toml); pushing a `vX.Y.Z` tag publishes
to [PyPI](https://pypi.org/p/siemens-standard-bom) (see [`release.yml`](.github/workflows/release.yml)).
- The self tool-entry version reads from installed package metadata, so `poetry install`
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ component.licenses = licenses

In order to build this library on your local PC, and/or contribute to this library, mind the following prerequisites:

- [Python](https://www.python.org/doc/versions/) >=3.10, <4.0
- [Python](https://www.python.org/doc/versions/) >=3.11, <4.0
- [Poetry](https://python-poetry.org/) >= v2.0

---
Expand Down
105 changes: 2 additions & 103 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 2 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "siemens-standard-bom"
version = "4.3.0"
version = "5.0.0"
description = "Standard BOM Format Library"
keywords = ["sbom", "software-bill-of-materials", "cyclonedx", "cdx"]
authors = [
Expand All @@ -17,17 +17,15 @@ classifiers = [
"Operating System :: OS Independent",
"Topic :: Software Development",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
urls = { homepage = "https://sbom.siemens.io/", repository = "https://github.com/siemens/standard-bom-python", "Bug Tracker" = "https://github.com/siemens/standard-bom-python/issues", documentation = "https://github.com/siemens/standard-bom-python/blob/main/README.md" }

requires-python = ">=3.10,<4.0"
requires-python = ">=3.11,<4.0"
dependencies = [
"python-dateutil (>=2.9.0.post0,<3.0.0)",
"cyclonedx-python-lib(>=11.12.0,<12.0.0)",
]
[build-system]
Expand All @@ -46,6 +44,5 @@ coverage = "7.15.4"
flake8 = "7.3.0"
deepdiff = "9.1.0"
mypy = "2.3.1"
types-python-dateutil = "2.9.0.20260807"
tox = "4.60.0"
sortedcontainers-stubs = "2.4.3"
14 changes: 1 addition & 13 deletions tests/abstract_sbom_compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@

import unittest
from abc import ABC
from datetime import datetime
from pathlib import Path
from typing import Optional, Tuple
from typing import Tuple

from cyclonedx.model.bom_ref import BomRef
from dateutil import parser as dateparser
from deepdiff import DeepDiff

from siemens_standard_bom.model import StandardBom
Expand Down Expand Up @@ -49,13 +47,3 @@ def write_read_compare(self, input_filename: str, output_filename: str) -> Tuple
self.assertEqual({}, DeepDiff(expected_bom.bom, actual_bom.bom, exclude_regex_paths=exclude_regex_paths))
self.assertEqual({}, DeepDiff(expected_bom, actual_bom, exclude_regex_paths=exclude_regex_paths))
return actual_bom, expected_bom


def read_timestamp(param: str | None) -> Optional[datetime]:
if param is None:
return None
try:
timestamp = dateparser.isoparse(param)
return timestamp
except ValueError:
return None
20 changes: 2 additions & 18 deletions tests/test_v2_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
# SPDX-License-Identifier: MIT
#

from datetime import datetime, timedelta, timezone
from datetime import datetime

from packageurl import PackageURL

from siemens_standard_bom.model import SbomNature
from siemens_standard_bom.parser import StandardBomParser
from tests.abstract_sbom_compare import AbstractSbomComparingTestCase, read_timestamp
from tests.abstract_sbom_compare import AbstractSbomComparingTestCase


class SbomV2ParserTestCase(AbstractSbomComparingTestCase):
Expand Down Expand Up @@ -91,22 +91,6 @@ def test_serial_number(self) -> None:
actual_bom, expected_bom = self.write_read_compare(input_filename, output_filename)
self.assertEqual(actual_bom.serial_number, expected_bom.serial_number)

def test_timestamps(self) -> None:
self.assertEqual(datetime(2009, 8, 7, 6, 5, 0, 0, timezone.utc), read_timestamp("2009-08-07T06:05Z"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone.utc), read_timestamp("2009-08-07T06:05:04Z"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone(timedelta(hours=1))),
read_timestamp("2009-08-07T06:05:04+01:00"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone(timedelta(hours=0))),
read_timestamp("2009-08-07T06:05:04+00:00"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone(timedelta(hours=0))),
read_timestamp("2009-08-07T06:05:04+00"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone(timedelta(hours=1))),
read_timestamp("2009-08-07T06:05:04+01"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 4, 0, timezone(timedelta(hours=4, minutes=30))),
read_timestamp("2009-08-07T06:05:04+04:30"))
self.assertEqual(datetime(2009, 8, 7, 6, 5, 0, 0, timezone(timedelta(hours=4))),
read_timestamp("2009-08-07T06:05+04:00"))

def test_multiple_dependencies(self) -> None:
input_filename = "tests/v2/multiple-dependencies.cdx.json"
output_filename = "output/v2/multiple-dependencies.cdx.json"
Expand Down
Loading
Loading