publiccode.yml icon indicating copy to clipboard operation
publiccode.yml copied to clipboard

Specify or document a way to retrieve `softwareVersion` from elsewhere

Open christophehenry opened this issue 1 year ago • 3 comments

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.

christophehenry avatar Sep 05 '24 08:09 christophehenry

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.

loicguilmard avatar Dec 19 '24 21:12 loicguilmard

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 avatar Aug 26 '25 18:08 jy95

@jy95 There are also 2 other tools available for handling this:

  • a GHA which basically updates the softwareVersion and the releaseDate keys - 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.2 so 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

libremente avatar Aug 27 '25 07:08 libremente