forked from fboender/ansible-cmdb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·75 lines (66 loc) · 2.32 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
#!/usr/bin/env python
import os
import sys
import re
from distutils.core import setup
from setuptools import find_packages
def get_long_description():
path = os.path.join(os.path.dirname(__file__), 'README.md')
with open(path) as f:
return f.read()
def get_version():
return open('src/ansiblecmdb/data/VERSION', 'r').read().strip()
def get_data_files(path, strip='', prefix=''):
data_files = []
for dirpath, dirnames, filenames in os.walk(path):
files = [os.path.join(dirpath, filename) for filename in filenames]
data_files.append( [prefix + dirpath[len(strip):], files] )
return data_files
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
print('You should also add a git tag for this version:')
print(' git tag {0}'.format(get_version()))
print(' git push --tags')
sys.exit()
setup(
name='ansible-cmdb',
version=get_version(),
license='GPLv3',
description='Generate host overview from ansible fact gathering output',
long_description=get_long_description(),
url='https://github.com/fboender/ansible-cmdb',
author='Ferry Boender',
author_email='[email protected]',
package_dir={'': 'src'},
packages=find_packages('src'),
include_package_data=True,
data_files=\
get_data_files(
'src/ansiblecmdb/data',
strip='src',
prefix='lib'
) +
[['lib/ansiblecmdb/', ['src/ansible-cmdb.py']]],
zip_safe=False,
install_requires=['mako', 'pyyaml', 'ushlex', 'jsonxs'],
scripts=[
'src/ansible-cmdb',
],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU General Public License v3 (GPLv3)',
'Natural Language :: English',
'Operating System :: POSIX',
'Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Topic :: System :: Installation/Setup',
'Topic :: System :: Systems Administration',
'Topic :: Utilities',
],
)