From ca006ec64ea6be4577351800316224e15dcd2a32 Mon Sep 17 00:00:00 2001 From: Hakan Dilek Date: Mon, 19 Oct 2026 12:44:50 +0200 Subject: [PATCH] chore: update Python to v3.15 in config and tests --- .github/workflows/build-and-test.yml | 8 ++--- AGENTS.md | 45 ++++++++++++++-------------- pyproject.toml | 1 + tox.toml | 2 +- 4 files changed, 29 insertions(+), 27 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index c9c7ebc..d1ebbc1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -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.10", "3.11", "3.12", "3.13", "3.14", "3.15" ] steps: - name: Checkout uses: actions/checkout@v7 @@ -34,7 +34,7 @@ jobs: contents: write strategy: matrix: - python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14" ] + python-version: [ "3.10", "3.11", "3.12", "3.13", "3.14", "3.15" ] steps: - name: Checkout uses: actions/checkout@v7 @@ -64,7 +64,7 @@ jobs: - name: Download coverage artifact uses: actions/download-artifact@v8 with: - name: coverage-results-3.14 + name: coverage-results-3.15 - name: Run coverage badge run: | sudo apt-get install xq @@ -87,7 +87,7 @@ jobs: - name: Set up Poetry project uses: ./.github/actions/setup-poetry-project with: - python-version: '3.14' + python-version: '3.15' - name: Run the linting run: | poetry run tox run -e lint,type diff --git a/AGENTS.md b/AGENTS.md index 658d705..c0f591f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,53 +1,54 @@ # AGENTS.md -Library wrapping [`cyclonedx-python-lib`](https://github.com/CycloneDX/cyclonedx-python-lib) to -read/write Siemens [Standard BOM](https://sbom.siemens.io/latest/format.html) +Library wrapping [`cyclonedx-python-lib`](https://github.com/CycloneDX/cyclonedx-python-lib) to +read/write Siemens [Standard BOM](https://sbom.siemens.io/latest/format.html) (a CycloneDX-compatible SBOM format). Source in [`siemens_standard_bom/`](siemens_standard_bom/). ## 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.10-3.15): `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` -Config: -- [`tox.toml`](tox.toml), -- [`pyproject.toml`](pyproject.toml), -- [`.flake8`](.flake8), +Configuration: + +- [`tox.toml`](tox.toml), +- [`pyproject.toml`](pyproject.toml), +- [`.flake8`](.flake8), - [`.mypy.ini`](.mypy.ini). ## Testing -- Uses stdlib [`unittest`](https://docs.python.org/3/library/unittest.html) (via `unittest discover`), +- Uses stdlib [`unittest`](https://docs.python.org/3/library/unittest.html) (via `unittest discover`), NOT [pytest](https://docs.pytest.org/). -- Run from repo root only: tests read fixtures by relative path ([`tests/v2/`](tests/v2/), +- Run from repo root only: tests read fixtures by relative path ([`tests/v2/`](tests/v2/), [`tests/v3/`](tests/v3/)) and write to `output/` at repo root (gitignored, auto-created). -- Comparison tests use [`deepdiff`](https://github.com/seperman/deepdiff) and intentionally exclude +- Comparison tests use [`deepdiff`](https://github.com/seperman/deepdiff) and intentionally exclude `bom_ref` values from diffs ([`tests/abstract_sbom_compare.py`](tests/abstract_sbom_compare.py)). ## Architecture - Thin wrapper: `StandardBom` wraps `cyclonedx.model.bom.Bom`; `SbomComponent`/`SourceArtifact` - /`ExternalComponent` wrap CycloneDX models. Reach the underlying object via `.bom` / `.component`. + /`ExternalComponent` wrap CycloneDX models. Reach the underlying object via `.bom` / `.component`. See [`model.py`](siemens_standard_bom/model.py). -- Siemens-specific fields are NOT native CycloneDX: they're stored as `Property` entries keyed - `siemens:*` (constants at top of [`model.py`](siemens_standard_bom/model.py)) or as typed - `ExternalReference`s. Add a field by adding a constant + property getter/setter following existing +- Siemens-specific fields are NOT native CycloneDX: they're stored as `Property` entries keyed + `siemens:*` (constants at top of [`model.py`](siemens_standard_bom/model.py)) or as typed + `ExternalReference`s. Add a field by adding a constant + property getter/setter following existing patterns. -- Reader supports BOTH v2 and v3 Standard BOM (see backward-compat branches in the `tools`/`authors` +- Reader supports BOTH v2 and v3 Standard BOM (see backward-compat branches in the `tools`/`authors` getters); keep both working. -- Output is always CycloneDX JSON v1.6 (`JsonV1Dot6`). - [`StandardBomParser.save(..., with_dependencies=False)`](siemens_standard_bom/parser.py) re-reads - and strips `dependencies` from the file (prohibited in the +- Output is always CycloneDX JSON v1.6 (`JsonV1Dot6`). + [`StandardBomParser.save(..., with_dependencies=False)`](siemens_standard_bom/parser.py) re-reads + and strips `dependencies` from the file (prohibited in the [`external` profile](https://sbom.siemens.io/v3/profiles.html)). ## Conventions -- [mypy](https://mypy.readthedocs.io/en/stable/) `strict = True`, `implicit_reexport = False`; +- [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. -- 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` +- 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` the package for it to report correctly. diff --git a/pyproject.toml b/pyproject.toml index df5f0bd..efc8e30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,6 +22,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] 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" } diff --git a/tox.toml b/tox.toml index 1a2de04..e9e4fc4 100644 --- a/tox.toml +++ b/tox.toml @@ -1,5 +1,5 @@ requires = ["tox>=4"] -env_list = ["lint", "type", "3.10", "3.11", "3.12", "3.13", "3.14"] +env_list = ["lint", "type", "3.10", "3.11", "3.12", "3.13", "3.14", "3.15"] [env_run_base] description = "Run unit tests"