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

Add version printout #347

Closed erikbosch closed 2 months ago

erikbosch commented 3 months ago

We have sometimes experienced problems that you run the "wrong" VSS-tools version due to faulty paths. This should hopefully help that somewhat by printing version number.

Current strategy is to use version from setup.py. There we have a hardcoded version. (In the past I did some attempts to get version from github tag but that did not work that well)

erik@debian4:~/vss-tools$ ./vspec2csv.py --version
5.0.dev0
erik@debian4:~/vss-tools$ cd ~/vehicle_signal_specification/
erik@debian4:~/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 5.0.dev0
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.
erikbosch commented 3 months ago

PR updated to use version from https://github.com/COVESA/vss-tools/blob/master/setup.py

erikbosch commented 3 months ago

MoM:

erikbosch commented 2 months ago

I saw a comment from previous VSS meeting on automatic versioning, we could possibly do that with setuptools. What we need to do then (for vss-tools) is to change tag format slightly as it need to comply with pypi rules. You will also if running locally built versions get somewhat odd results like in the example below showing that you use something based on tag 4.4.4, plus 0 extra commits, plus some dirty (changed) code¨. Versions are also sometimes cached

erik@debian6:~/vehicle_signal_specification$ make csv
./vss-tools/vspec2csv.py -u ./spec/units.yaml ./spec/VehicleSignalSpecification.vspec vss_rel_$(cat VERSION).csv
INFO     VSS-tools version 4.4.4.post0+git.c7fe8e4c.dirty
INFO     Added 29 quantities from /home/erik/vehicle_signal_specification/spec/quantities.yaml
INFO     Added 61 units from ./spec/units.yaml
erikbosch commented 2 months ago

Updated to use git version. I did a test locally by tagging my last commit with 5.0.0.dev0and creating https://pypi.org/project/vss-tools/5.0.0.dev0/ . Then installing it from pypi and verifying that correct version is used. Works well.

Some notes:

erikbosch commented 2 months ago

MoM: