Expose pynxtools version#738
Conversation
… writer used, useful cuz knowing only which commit of the NeXus definitions was used does not necessarily pin that pynxtools and in which version it was used. Admittedly, yes the dev strategy has been that a specific pynxtools version always uses one specific NeXus version but there could be development version which use the same NeXus version so concluding backwards is not uniquely possible
There was a problem hiding this comment.
The same applies here as in FAIRmat-NFDI/pynxtools-plugin-template#25 (review): why do we not rather determine the pynxtools version runtime using importlib.metadata (a part of the standard lib) rather than relying on a version determined at build time?
Here's my reasoning in a longer form:
When writing the NeXus file, the goal should be to record the version of the pynxtools (and its plugin) that actually produced the data. Retrieving the version via importlib.metadata achieves this by reading the version information from the installed distribution metadata, independent of the presence of a Git repository or build environment. In contrast, the setuptools_scm configuration derives the version from the state of the source repository at build time and relies on Git metadata being available. While this is appropriate for generating package versions during packaging, it can become unreliable once the package is installed from a wheel or source distribution, executed in containerized or deployed environments without Git, or run outside the original repository. Using importlib.metadata therefore ensures that the recorded version always corresponds to the installed pynxtools package that generated the output.
Again, I support to record this information, the question is rather how we obtain it.
|
Ho about in init.py? |
Yes, that would probably a clean solution. Then again, we don't even need that, we can just call For a discussion around this, see https://discuss.python.org/t/please-make-package-version-go-away/58501 |
|
Pipeline failures related exclusively to ref logs of plugins not having creator |
lukaspie
left a comment
There was a problem hiding this comment.
For the failing plugin tests, we should do this in FAIRmat-NFDI/pynxtools-plugin-template#25 and then on cruft update, we have to regenerate the example files.
Please, before merging, could you append to this test as well? https://github.com/FAIRmat-NFDI/pynxtools/blob/master/tests/dataconverter/test_helpers.py#L155
Test and documentation was added, feature complete. |
Thanks, but can you please add to the specific tests (i.e. |
lukaspie
left a comment
There was a problem hiding this comment.
LGTM, assuming the other test is added. Thanks!
Add creator, and creator_version to root and allow other modules to get pynxtools version, using scm