-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathsetup.py
80 lines (64 loc) · 2.38 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, Command
import sys
import os
import subprocess
sys.path.insert(0, 'src')
name = 'robotframework-ipmilibrary'
version_py = os.path.join(os.path.dirname(__file__), 'src', 'IpmiLibrary',
'version.py')
try:
version = subprocess.check_output(
['git', 'describe', '--tags', '--always', '--dirty'],
stderr=subprocess.STDOUT).rstrip().decode('ascii')
with open(version_py, 'w') as f:
f.write('# This file was autogenerated by setup.py\n')
f.write('__version__ = \'%s\'\n' % (version,))
except (OSError, IOError, subprocess.CalledProcessError) as e:
try:
with open(version_py, 'r') as f:
d = dict()
exec(f.read(), d)
version = d['__version__']
except IOError:
version = 'unknown'
with open('README.rst') as f:
readme = f.read()
class run_build_libdoc(Command):
description = "Build Robot Framework library documentation"
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
try:
import robot.libdoc
except ImportError:
print("build_libdoc requires the Robot Framework package.")
sys.exit(-1)
robot.libdoc.libdoc('IpmiLibrary', 'docs/IpmiLibrary.html')
def main():
setup(name = name,
version = version,
description = 'IPMI Library for Robot Framework',
long_description = readme,
author = 'Michael Walle, Heiko Thiery',
author_email = '[email protected], [email protected]',
url = 'https://github.com/kontron/robotframework-ipmilibrary',
download_url = 'https://pypi.python.org/pypi/robotframework-ipmilibrary',
package_dir = { '' : 'src' },
license = 'Apache License 2.0',
classifiers = [
'Development Status :: 4 - Beta',
'Framework :: Robot Framework',
'License :: OSI Approved :: Apache Software License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Testing',
],
install_requires = [ 'robotframework', 'python-ipmi' ]
)
if __name__ == '__main__':
main()