holoviz / param

Param: Make your Python code clearer and more reliable by declaring Parameters
https://param.holoviz.org
BSD 3-Clause "New" or "Revised" License
410 stars 69 forks source link

Fix building with setuptools-scm<7 #903

Closed maximlt closed 5 months ago

maximlt commented 5 months ago

Fixes #897

I think importlib.metadata import version; __version__ = version('<package_name>') is now the recommended way to get the version of an installed package. Except that I guess it makes things a bit slower and I don't know how stable that is. So I chose to still rely on trying first to get the version from _version.py (automatically created by hatch-vcs/setuptools-scm) and only then, if it fails like in #897, to try to get it using importlib.