-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (44 loc) · 1.36 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import sys
from setuptools import setup, find_packages
from subprocess import Popen, PIPE
def get_version():
"""
Get version from PKG-INFO file.
"""
try:
# Try to get version from the PKG-INFO file
f = open('PKG-INFO', 'r')
for line in f.readlines():
if line.startswith('Version: '):
return line.split(' ')[1].strip()
except IOError:
# Try to get the version from the latest git tag
p = Popen(['git', 'describe', '--tags'], stdout=PIPE, stderr=PIPE)
p.stderr.close()
lines = p.stdout.readlines()
try:
return lines[0].strip()
except IndexError:
sys.stderr.write('Cannot determine version. Try running "git fetch --tags" first.\n')
sys.exit(1)
setup(name='xbtarbiter',
version=get_version(),
description='BTC arbiter',
long_description='BTC arbiter',
author='Dan Keder',
author_email='[email protected]',
packages=find_packages(),
include_package_data=True,
zip_safe=False,
install_requires=[
'requests',
'python-gnupg',
'docopt',
],
entry_points={
'console_scripts': [
'xbtarbiter= xbtarbiter:main',
]
}
)
# vim: expandtab