forked from cloud-bulldozer/orion
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathversion.py
More file actions
23 lines (22 loc) · 770 Bytes
/
version.py
File metadata and controls
23 lines (22 loc) · 770 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# orion/version.py
"""
Dynamic version retrieval using setuptools_scm.
The version is determined at runtime from git tags.
"""
try:
from setuptools_scm import get_version
from pathlib import Path
# Get version from git repo root (parent of version.py location)
repo_root = Path(__file__).parent
__version__ = get_version(root=str(repo_root))
except (ImportError, LookupError):
# Fallback if setuptools_scm is not available or not in a git repo
try:
from importlib.metadata import version
__version__ = version('orion')
except ImportError:
try:
from importlib_metadata import version
__version__ = version('orion')
except ImportError:
__version__ = "0.0.0.dev0+unknown"