COVESA / vss-tools

Software for working with VSS (https://github.com/COVESA/vehicle_signal_specification)
Mozilla Public License 2.0
49 stars 51 forks source link

Improving version printout #362

Closed erikbosch closed 1 month ago

erikbosch commented 1 month ago

It was detected by @UlfBj that our new automatic version printout gives error if not having installed vss-tools. This fixes that by printing localinstead of giving an exception

erik@debian6:~/vehicle_signal_specification$ make csv
./vss-tools/vspec2csv.py -u ./spec/units.yaml --strict ./spec/VehicleSignalSpecification.vspec vss_rel_$(cat VERSION).csv
INFO     VSS-tools version local
INFO     Added 29 quantities from /home/erik/vehicle_signal_specification/spec/quantities.yaml
INFO     Added 61 units from ./spec/units.yaml
INFO     Loading vspec from ./spec/VehicleSignalSpecification.vspec...
INFO     Calling exporter...
INFO     Generating CSV output...
INFO     All done.

One can argue that the "importlib" solution we have can give misleading info if you are working on vss-tools source but have vss-tools installed with pip (pip install vss-tools). if you work with local source of vss-tools you could do pip install -e . to get a pip install that corresponds to your source code.

erikbosch commented 1 month ago

@UlfBj - you could try this change in your local env.

One could think of more advanced approaches, like first checking if we find a git tag in current location, and as second option use installed version, but that makes it difficult if we first need to heck if git is installed and so on.

erikbosch commented 1 month ago

Merging this one as I intend to include it in VSS 4.2