Unverified Commit 9fdb4435 authored by Shaoshuai Shi's avatar Shaoshuai Shi Committed by GitHub
Browse files

bugfixed: support pcdet.__version__ for recording (#126)

* bugfixed: support pcdet.__version__ for recording
parent b42d7a99
from pathlib import Path
import subprocess
from .version import __version__
__all__ = [
'__version__'
]
def get_git_commit_number():
if not (Path(__file__).parent / '../.git').exists():
return '0000000'
cmd_out = subprocess.run(['git', 'rev-parse', 'HEAD'], stdout=subprocess.PIPE)
git_commit_number = cmd_out.stdout.decode('utf-8')[:7]
return git_commit_number
script_version = get_git_commit_number()
if script_version not in __version__:
__version__ = __version__ + '+py%s' % script_version
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment