-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
44 lines (38 loc) · 1.39 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
#!/usr/bin/env python
from setuptools import setup, find_packages
from subprocess import Popen, PIPE
def get_git_version():
try:
# Somehow git describe is confused if fakeroot is used. The command
# below seems to work around that. I really don't have any clue :(
Popen(['git', 'diff'], stdout=PIPE, stderr=PIPE).wait()
p = Popen(['git', 'describe', '--tags', '--always', '--dirty'],
stdout=PIPE, stderr=PIPE)
p.stderr.close()
if p.wait() == 0:
return p.stdout.readlines()[0].strip()
except:
pass
raise AssertionError('Could not find the version number')
def main():
version = get_git_version()
with open('pyvxi11/version.py', 'w') as f:
f.write('# This file was autogenerated by setup.py\n')
f.write('__version__ = \'%s\'\n' % (version,))
setup(name = 'pyvxi11',
version = version,
description = 'Pure python VXI-11 library',
author = 'Michael Walle',
author_email = '[email protected]',
license = 'GPL 3+',
url = 'http://github.com/mwalle/pyvxi11',
packages = find_packages(exclude=['tests']),
entry_points = {
'console_scripts': [
'vxi11-cli = pyvxi11.vxi11_cli:main',
]
},
test_suite = 'tests',
)
if __name__ == '__main__':
main()