-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
80 lines (69 loc) · 2.46 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
from setuptools import setup, Command
import sys
import os
import subprocess
sys.path.insert(0, 'src')
version_py = os.path.join(os.path.dirname(__file__), 'src', 'AardvarkLibrary',
'version.py')
try:
version = subprocess.check_output(
['git', 'describe', '--tags', '--always', '--dirty'],
stderr=subprocess.STDOUT).rstrip()
with open(version_py, 'w') as f:
f.write('# This file was autogenerated by setup.py\n')
f.write('__version__ = \'%s\'\n' % (version,))
except (IOError, subprocess.CalledProcessError) as e:
try:
with open(version_py, 'r') as f:
d = dict()
exec(f, 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)
# fake pyaardvark module, this way we are able to generate the
# documentation without having the pyaardvark module installed
sys.modules['pyaardvark'] = lambda:None
robot.libdoc.libdoc('AardvarkLibrary', 'docs/AardvarkLibrary.html')
def main():
setup(name = 'robotframework-aardvarklibrary',
version = version,
description = 'Aardvark Library for Robot Framework',
long_description = readme,
author_email = 'michael.walle@kontron.com',
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',
],
packages = [ 'AardvarkLibrary' ],
install_requires = [
'robotframework',
'pyaardvark >= 0.2.1',
],
cmdclass = {
'build_libdoc': run_build_libdoc,
},
)
if __name__ == '__main__':
main()