I believe it is good practice to expose the version of python libraries at runtime in the top-level __version__ attribute.
Depending on how the package was installed, it might be possible to grab the version setup.py used during installation, using importlib, but this is not always the case.
I believe it is good practice to expose the version of python libraries at runtime in the top-level
__version__
attribute. Depending on how the package was installed, it might be possible to grab the version setup.py used during installation, using importlib, but this is not always the case.For reference: