aboutsummaryrefslogtreecommitdiff
path: root/setup.py
diff options
context:
space:
mode:
authorRapptz <[email protected]>2017-03-04 20:43:05 -0500
committerRapptz <[email protected]>2017-03-04 20:43:05 -0500
commitc4c17351c671145d8ea26233feae67c7179fe564 (patch)
tree05bdba932d49513cbd7ccff51f652ed51303b196 /setup.py
parentRemove Client.accept_invite (diff)
downloaddiscord.py-c4c17351c671145d8ea26233feae67c7179fe564.tar.xz
discord.py-c4c17351c671145d8ea26233feae67c7179fe564.zip
Add commit number to pip version for easy identification.
Diffstat (limited to 'setup.py')
-rw-r--r--setup.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/setup.py b/setup.py
index 15b7769f..677ecadb 100644
--- a/setup.py
+++ b/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()