linkml / linkml

Linked Open Data Modeling Language
https://linkml.io/linkml
Other
312 stars 98 forks source link

Add `--version` flag #378

Closed cmungall closed 1 year ago

cmungall commented 3 years ago

As per https://clig.dev/ we should have a --version flag on generator and other commands. This should display the linkml version - perhaps also runtime.

not sure how to implement this:

>>> import linkml
RDFLib Version: 5.0.0
>>> linkml.__version__
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'linkml' has no attribute '__version__'
rosdyana commented 2 years ago

@cmungall I think we can use versionner (https://github.com/python-versioneer/python-versioneer/blob/master/INSTALL.md).

cmungall commented 1 year ago

We need to solve this problem generally:

The general blocker here is that we use github releases to handle all aspects of releases, including assigning version tags. This means the versions in all out pyproject.yaml files is 0.0.0, making introspection hard.

dalito commented 1 year ago

For automatic versioning with poetry, you may use https://github.com/mtkennerly/poetry-dynamic-versioning - It solved poetry`s automatic versioning problem for me. The version can be derived from a git-tag and temporarily injected to files you want. Can this not solve the 0.0.0 problem? You inject into the released files but not into the versioned code.

cmungall commented 1 year ago

oooh this may be just what we need!! thank you @dalito!