rasbt/watermark

version unknown

sbonaretti opened this issue · 4 comments

Hi! Thanks for developing watermark, it is indeed fundamental to make my workflows reproducible! However, it seems like it cannot read the version of some packages - see attachment. Is there a way to read the version of these packages? Where does watermark get the version from? Thanks!

ScreenShot

rasbt commented

I think multiprocessing won't have a version number because it's already included in Python. Hence, it's version number would be whatever your Python's version is.

Regarding SimpleITK and itk, it looks like they don't support the common __version__ attribute. Do you know by chance how you would get the version from within the package after importing it? It seems like there is nothing within that package that lists the version. Hm.

At the end i solved my issue using:

import pkg_resources
pkg_resources.get_distribution("SimpleITK").version

as suggested here. Not the cleanest way, but it works for now.

Thanks!

rasbt commented

That's good to know, thanks! This means we could add an exception (if-clause) for this particular case. This could actually be extended to all packages that don't have a __version__ attribute -- very useful to know, thanks!

rasbt commented

Should be fixed now via #54