Add commit number to pip version for easy identification.
This commit is contained in:
parent
aa41101237
commit
c4c17351c6
@ -15,7 +15,7 @@ __title__ = 'discord'
|
||||
__author__ = 'Rapptz'
|
||||
__license__ = 'MIT'
|
||||
__copyright__ = 'Copyright 2015-2017 Rapptz'
|
||||
__version__ = '1.0.0a0'
|
||||
__version__ = '1.0.0a'
|
||||
|
||||
from .client import Client, AppInfo
|
||||
from .user import User, ClientUser, Profile
|
||||
|
12
setup.py
12
setup.py
@ -17,6 +17,18 @@ with open('discord/__init__.py') as f:
|
||||
if not version:
|
||||
raise RuntimeError('version is not set')
|
||||
|
||||
if version.endswith(('a', 'b', 'rc')):
|
||||
# append version identifier based on commit count
|
||||
try:
|
||||
import subprocess
|
||||
p = subprocess.Popen(['git', 'rev-list', '--count', 'HEAD'],
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
out, err = p.communicate()
|
||||
if out:
|
||||
version = version + out.decode('utf-8').strip()
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
readme = ''
|
||||
with open('README.md') as f:
|
||||
readme = f.read()
|
||||
|
Loading…
x
Reference in New Issue
Block a user