Handle version for tests (with dunamai, without git)
All checks were successful
ci/woodpecker/tag/test Pipeline was successful
ci/woodpecker/tag/build Pipeline was successful

This commit is contained in:
phil 2025-06-27 00:52:33 +02:00
parent eb1d04dbc3
commit 44596a3e9a

View file

@ -4,7 +4,7 @@ try:
from dunamai import Version, Style
__version__ = Version.from_git().serialize(style=Style.SemVer, dirty=True)
except ImportError:
except (ImportError, RuntimeError):
# __name__ can be used if the package name is the same
# as the directory. Otherwise, specify it explicitely.
__version__ = importlib.metadata.version(__name__)