mirror of
https://github.com/internetarchive/brozzler.git
synced 2025-02-24 08:39:59 -05:00
pep440 compliant versioning
This commit is contained in:
parent
40522ef5a5
commit
245078284d
8
setup.py
8
setup.py
@ -8,12 +8,8 @@ VERSION_BYTES = b'1.0'
|
|||||||
def full_version_bytes():
|
def full_version_bytes():
|
||||||
import subprocess, time
|
import subprocess, time
|
||||||
try:
|
try:
|
||||||
commit_bytes = subprocess.check_output(['git', 'log', '-1', '--pretty=format:%h'])
|
commit_num_bytes = subprocess.check_output(['git', 'rev-list', '--count', 'HEAD'])
|
||||||
t_bytes = subprocess.check_output(['git', 'log', '-1', '--pretty=format:%ct'])
|
return VERSION_BYTES + b'.dev' + commit_num_bytes.strip()
|
||||||
t = int(t_bytes.strip().decode('utf-8'))
|
|
||||||
tm = time.gmtime(t)
|
|
||||||
timestamp_utc = time.strftime("%Y%m%d%H%M%S", time.gmtime(t))
|
|
||||||
return VERSION_BYTES + b'-' + timestamp_utc.encode('utf-8') + b'-' + commit_bytes.strip()
|
|
||||||
except subprocess.CalledProcessError:
|
except subprocess.CalledProcessError:
|
||||||
return VERSION_BYTES
|
return VERSION_BYTES
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user