Specify or document a way to retrieve `softwareVersion` from elsewhere
Project version is often already specified in somewhere in a a project file. For python projects, for instance, it may be setup.py, setup.cfg, pyproject.toml or version.py. The pyproject.toml standard, offers the attr: package.__version__ syntax for sourcing from a python file.
publiccodeyml should offer a similar feature. softwareVersion could be extended to be used like this:
softwareVersion:
file: pyproject.toml
search: 'version\s+=\s+"(?P<version>[^"]+)"'
Maybe something simpler that regexes can be found, IDK.
A lot of project have dynamic versioning from git tag too or _version.py Any way it's done would be nice to not have to manually manage different versions file/items for different tools.
I have a Java project with similar concern.
In order to always keep up the most recent version in softwareVersion, I had to rely on a CI script to update it.
@jy95 There are also 2 other tools available for handling this:
- a GHA which basically updates the
softwareVersionand thereleaseDatekeys - developed by the Italian Government (@astagi). This is already working in several repositories without major issues so far. You have to use it in your CI. - A community tool based on the previous one that does something more -> it creates a publiccode.yml file based on the repository metadata. I like the idea but I am not aware of the project's status, you may check it out if you wish. It looks like they are still on version
0.2so this probably needs a bit of work.
Should we add a simple section in the README listing all the "community" tools existing around the standard? Or maybe work a bit on this https://github.com/publiccodeyml/publiccode.tools, WDYT? / cc @bfabio