Skip to content

Commit 3494250

Browse files
committed
Add fallback for __version__ using importlib.metadata
If _version import fails, use importlib.metadata to set __version__. This improves compatibility for development installs where _version may not be present.
1 parent 8352d05 commit 3494250

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/track_linearization/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@
1111
try:
1212
from ._version import __version__
1313
except ImportError:
14-
pass
14+
# Fallback for development installs
15+
from importlib.metadata import version
16+
17+
__version__ = version("track_linearization")

0 commit comments

Comments
 (0)