From 73d8bde834009e0f222e3fa165e4e99560fbbc89 Mon Sep 17 00:00:00 2001 From: Erik Jaegervall Date: Mon, 16 Sep 2024 16:40:09 +0200 Subject: [PATCH] Updating CHANGELOG and minor chnage in UUID handling Signed-off-by: Erik Jaegervall --- CHANGELOG.md | 145 ++++++++++-------- src/vss_tools/vspec/main.py | 1 + tests/vspec/test_types_with_uuid/test_uuid.py | 6 +- 3 files changed, 87 insertions(+), 65 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48ae0b3e..4475760d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,52 +7,74 @@ It includes changes that are included in released version, but also changes plan *This document only contain changes introduced in VSS-Tools 3.0 or later!* +## Planned changes for VSS-Tools 6.0 -## VSS-Tools 3.0 - -[Complete release notes including VSS-Tools changes](https://github.com/COVESA/vehicle_signal_specification/releases/tag/v3.0) +### Change in UUID handling. -### Overlay Support +As the tool [vspec2id](docs/id.md) has been added the VSS-project has agreed that there no longer is a need to support +the legacy uuid functionality. -Overlays introduced to allow customization of VSS. See [documentation](https://covesa.github.io/vehicle_signal_specification/rule_set/overlay/). -See [vss-tools documentation](https://github.com/COVESA/vss-tools/blob/master/docs/vspec.md) on how to include overlays when transforming VSS. +* The parameters `--uuid`/`--no-uuid` are now removed. -## VSS-Tools 3.1 (Latest Release) -[Complete release notes including VSS-Tools changes](https://github.com/COVESA/vehicle_signal_specification/releases/tag/v3.1) +## VSS-Tools 5.0 -### Struct Support +### Major restructure of repository structure and CLI -Support for defining signals with struct type added. -For VSS 3.1 as experimental feature only supported by JSON exporter. +The vss-tools repository content structure and CLI has changed significantly For more information see [vspec documentation](docs/vspec.md) ### Change in UUID handling. -As of today most tools in this repository add UUIDs to generated output by default. An parameter `--no-uuid` exists to suppress output of UUIDs. -It has been decided in VSS-project to change default behavior so that default is to not generate UUIDs. -The change will be gradually introduced over multiple releases. +As the tool [vspec2id](docs/id.md) has been added the VSS-project has agreed that there no longer is a need to support +the legacy uuid functionality. -For VSS-Tools 3.1 the following behavior is implemented: +* The parameter `--uuid` is now deprecated and a warning is given if used. -* Generation of UUIDs is still default. -* A new parameter `--uuid` has been introduced to explicitly request that UUIDs shall be generated. -* If neither `--uuid` nor `--no-uuid` is used a warning will be given informing that default behavior will change in the future. -* If both `--uuid` and `--no-uuid` is used an error will be given. +*No warning given any longer if `--no-uuid` is used due to refactored cli interface* -### The tools vspec2c and vspec2ocf are now obsolete +### Tools installed as binaries without `.py` extension -The tools vspec2c and vspec2ocf in the contrib folder has been moved to the obsolete folder. -The background is that they have been broken for a long period and no one has volunteered to fix them. +The project has been switched to poetry and all tools are available in your PATH once vss-tools is installed via pip. -### Support for specifying unit files +### Logging arguments + +General args have been extended with logging arguments `--log-level` and `--log-file`. + +## SAMM Exporter added + +See [documentation](https://github.com/COVESA/vss-tools/blob/master/docs/samm.md) + +## APIGEAR Exporter added + +See [documentation](https://github.com/COVESA/vss-tools/blob/master/docs/apigear.md) + +## VSS-Tools 4.2 + +No significant changes in vss-tools + + +## VSS-Tools 4.1 + +### Struct support in vspec2ddsidl + +The vspec2ddsidl tool now supports structs + +### Jsonschema tool added + +A new tool vspec2jsonschema has been added + +### Id generator tool added + +A new tool vspec2id has been added. It can be used to generate and maintain unique identifiers for signals. + +### Unit files and quantity files + +A new syntax has been introduced for unit files. The old syntax is still supported. +Domains have now been renamed to Quantities. +In addition to this a quantity file format has been defined, and the tool will inform +if units refer to a quantity that has not been defined an information message will be printed. -Add new parameter `-u` has been introduced, see [documentation](https://github.com/COVESA/vss-tools/blob/master/docs/vspec.md#handling-of-units). -Use of default unit file deprecated. -At the same time a unit file has been added to [VSS](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/units.yaml), -allowing VSS tooling to control their own units rather than relying on units in VSS-tools. -Default behavior for units have changed, if there is a file `units.yaml` in the same directory as the `*.vspec` -file it will be used, only if not existing `config.yaml` in vss-tools will be used. ## VSS-Tools 4.0 @@ -88,53 +110,48 @@ From now on, if new units are needed for the VSS catalog they shall be added to [VSS catalog file](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/units.yaml). -## Implemented changes, to be released as part of VSS-Tools 5.0 - -### Major restructure of repository structure and CLI - -The vss-tools repository content structure and CLI has changed significantly -For more information see [vspec documentation](docs/vspec.md) - -### Struct support in vspec2ddsidl - -The vspec2ddsidl tool now supports structs - -### Jsonschema tool added - -A new tool vspec2jsonschema has been added - -### Id generator tool added +## VSS-Tools 3.1 -A new tool vspec2id has been added. It can be used to generate and maintain unique identifiers for signals. +[Complete release notes including VSS-Tools changes](https://github.com/COVESA/vehicle_signal_specification/releases/tag/v3.1) -### Unit files and quantity files +### Struct Support -A new syntax has been introduced for unit files. The old syntax is still supported. -Domains have now been renamed to Quantities. -In addition to this a quantity file format has been defined, and the tool will inform -if units refer to a quantity that has not been defined an information message will be printed. +Support for defining signals with struct type added. +For VSS 3.1 as experimental feature only supported by JSON exporter. +For more information see [vspec documentation](docs/vspec.md) ### Change in UUID handling. -As the tool [vspec2id](docs/id.md) has been added the VSS-project has agreed that there no longer is a need to support -the legacy uuid functionality. +As of today most tools in this repository add UUIDs to generated output by default. An parameter `--no-uuid` exists to suppress output of UUIDs. +It has been decided in VSS-project to change default behavior so that default is to not generate UUIDs. +The change will be gradually introduced over multiple releases. -* The parameter `--no-uuid` is now removed, and an error is given if `--no-uuid` is used. -* The parameter `--uuid` is now deprecated. +For VSS-Tools 3.1 the following behavior is implemented: -## Planned changes for VSS-Tools 6.0 +* Generation of UUIDs is still default. +* A new parameter `--uuid` has been introduced to explicitly request that UUIDs shall be generated. +* If neither `--uuid` nor `--no-uuid` is used a warning will be given informing that default behavior will change in the future. +* If both `--uuid` and `--no-uuid` is used an error will be given. -### Change in UUID handling. +### The tools vspec2c and vspec2ocf are now obsolete -As the tool [vspec2id](docs/id.md) has been added the VSS-project has agreed that there no longer is a need to support -the legacy uuid functionality. +The tools vspec2c and vspec2ocf in the contrib folder has been moved to the obsolete folder. +The background is that they have been broken for a long period and no one has volunteered to fix them. + +### Support for specifying unit files -* The parameter `--uuid` is now removed. +Add new parameter `-u` has been introduced, see [documentation](https://github.com/COVESA/vss-tools/blob/master/docs/vspec.md#handling-of-units). +Use of default unit file deprecated. +At the same time a unit file has been added to [VSS](https://github.com/COVESA/vehicle_signal_specification/blob/master/spec/units.yaml), +allowing VSS tooling to control their own units rather than relying on units in VSS-tools. +Default behavior for units have changed, if there is a file `units.yaml` in the same directory as the `*.vspec` +file it will be used, only if not existing `config.yaml` in vss-tools will be used. -### Tools installed as binaries without `.py` extension +## VSS-Tools 3.0 -The project has been switched to poetry and all tools are available in your PATH once vss-tools is installed via pip. +[Complete release notes including VSS-Tools changes](https://github.com/COVESA/vehicle_signal_specification/releases/tag/v3.0) -### Logging arguments +### Overlay Support -General args have been extended with logging arguments `--log-level` and `--log-file`. +Overlays introduced to allow customization of VSS. See [documentation](https://covesa.github.io/vehicle_signal_specification/rule_set/overlay/). +See [vss-tools documentation](https://github.com/COVESA/vss-tools/blob/master/docs/vspec.md) on how to include overlays when transforming VSS. diff --git a/src/vss_tools/vspec/main.py b/src/vss_tools/vspec/main.py index 3b5b8a4d..71945a61 100644 --- a/src/vss_tools/vspec/main.py +++ b/src/vss_tools/vspec/main.py @@ -229,6 +229,7 @@ def get_trees( root.expand_instances() if uuid: + log.warning("UUID support is deprecated and will be removed in VSS-tools 6.0") root.add_uuids() try: diff --git a/tests/vspec/test_types_with_uuid/test_uuid.py b/tests/vspec/test_types_with_uuid/test_uuid.py index 8cacfb68..16fb7195 100644 --- a/tests/vspec/test_types_with_uuid/test_uuid.py +++ b/tests/vspec/test_types_with_uuid/test_uuid.py @@ -19,9 +19,11 @@ def run_exporter(exporter, argument, compare_suffix, tmp_path): vspec = HERE / "test.vspec" out = tmp_path / f"out.{exporter}" cmd = f"vspec export {exporter}{argument} -u {TEST_UNITS} -q {TEST_QUANT} --vspec {vspec} --output {out}" - subprocess.run(cmd.split(), check=True) + process = subprocess.run(cmd.split(), check=True) expected = HERE / f"expected_{compare_suffix}.{exporter}" assert filecmp.cmp(out, expected) + if argument == "--uuid": + assert "UUID support is deprecated" in process.stderr def test_uuid(tmp_path): @@ -31,6 +33,7 @@ def test_uuid(tmp_path): exporters = ["json", "ddsidl", "csv", "yaml", "franca"] for exporter in exporters: run_exporter(exporter, " --uuid", "uuid", tmp_path) + run_exporter(exporter, " --no-uuid", "no_uuid", tmp_path) run_exporter(exporter, "", "no_uuid", tmp_path) @@ -46,6 +49,7 @@ def run_error_test(tool, argument, arg_error_expected: bool, tmp_path): assert process.returncode == 0 +# At the moment you do not get warning if using --no-uuid def test_obsolete_arg(tmp_path): """ Check that obsolete argument --no-uuid results in error