Skip to content
This repository was archived by the owner on Mar 31, 2025. It is now read-only.

Commit ff21250

Browse files
Fixed last commit date format not readable
1 parent 58a7800 commit ff21250

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

setup.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,17 @@
99

1010
try:
1111
git_release_tag = subprocess.check_output(['git', 'describe', '--tags']).decode('utf-8').strip()
12-
git_commit_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('utf-8').strip()
13-
git_commit_date = subprocess.check_output(['git', 'show', '-s', '--format=%ci', 'HEAD']).decode('utf-8').strip()
14-
except subprocess.CalledProcessError:
12+
except subprocess.CalledProcessError as e:
1513
git_release_tag = "latest"
14+
15+
try:
16+
git_commit_hash = subprocess.check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('utf-8').strip()
17+
except subprocess.CalledProcessError as e:
1618
git_commit_hash = "latest"
19+
20+
try:
21+
git_commit_date = subprocess.check_output(['git', 'show', '-s', '--format=%cd', '--date=format:"%b %e %Y, %H:%M:%S"', 'HEAD']).decode('utf-8').strip()
22+
except subprocess.CalledProcessError as e:
1723
git_commit_date = None
1824

1925
content = content.replace('git_release_tag = "latest"\ngit_commit_hash = "latest"\ngit_commit_date = None', f'git_release_tag = {repr(git_release_tag)}\ngit_commit_hash = {repr(git_commit_hash)}\ngit_commit_date = {repr(git_commit_date)}')

shell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
git_release_tag = "latest"
2-
git_commit_hash = "latest"
1+
git_release_tag = 'latest'
2+
git_commit_hash = 'latest'
33
git_commit_date = None
44

55
import platform

0 commit comments

Comments
 (0)