You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
424 B
Python

1 month ago
"""Define version."""
import pathlib
import subprocess
from .VERSION import __version__
here = pathlib.Path(__file__).resolve().parent
__all__ = ["__version__", "__branch__"]
try:
__branch__ = (
subprocess.run(["git", "branch", "--show-current"], capture_output=True, cwd=here)
.stdout.strip()
.decode()
)
except:
__branch__ = ""
if __branch__:
__version__ += "+" + __branch__