PyEllips / pyElli

An open source ellipsometry analysis tool for reproducible and comprehensible building of optical models.
https://pyelli.readthedocs.io
GNU General Public License v3.0
17 stars 6 forks source link

pyElli version #164

Closed rugfri closed 5 months ago

rugfri commented 5 months ago

pyElli's, is there a way implemented to get the pyElli version? elli.version seems to be not implemented, and I would like to avoid using pip since I need to embed the call into a code.

Thanks!

domna commented 5 months ago

We use setuptools-scm for versioning. So you can just use importlib.metadata to retrieve the version info.

This is an example (for python<3.8 you need to use the importlib_metadata backport):

from importlib.metadata import version, PackageNotFoundError

try:
    __version__ = version("package-name")
except PackageNotFoundError:
    # package is not installed
    pass

(from https://setuptools-scm.readthedocs.io/en/latest/usage/#version-at-runtime)

rugfri commented 5 months ago

thanks!