This repository has been archived by the owner on Apr 15, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup.py
215 lines (191 loc) · 7.61 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
# Beah - Test harness. Part of Beaker project.
#
# Copyright (C) 2009 Marian Csontos <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
from setuptools import setup, find_packages
from time import strftime
import sys
import os
import os.path
import glob
import fnmatch
def glob_(prefix, *patterns):
if prefix and prefix[-1]!='/':
prefix += '/'
answ = []
for pattern in patterns:
answ += glob.glob(prefix+pattern)
answ = list([file for file in answ if not os.path.isdir(file)])
return answ
def rdglob(prefix, dirs, din=("*"), dex=()):
"""
Glob directories recursively.
prefix - root directory
dirs - directory names relative to root to process
din - include directories matching any of these patterns
dex - exclude directories matching any of these patterns
"""
#print "input:", dirs
if prefix:
if prefix[-1]!='/':
prefix += '/'
dirs = [prefix+dir for dir in dirs]
#print "prefixed:", dirs
dirs = list([dir for dir in dirs if os.path.isdir(dir)])
#print "dirs only:", dirs
ix = 0
l = len(prefix)
def matchf(d):
d = d[l:]
for di in din:
if not fnmatch.fnmatch(d, di):
return False
for de in dex:
if fnmatch.fnmatch(d, de):
return False
return True
while ix < len(dirs):
dir = dirs[ix]
ls = [dir+"/"+d for d in os.listdir(dir) if os.path.isdir(dir+"/"+d)]
#print "ls:", ls
dirs.extend([d for d in ls if matchf(d)])
#print "extended:", dirs
ix += 1
if prefix:
dirs = list([dir[l:] for dir in dirs])
#print "result:", dirs
return dirs
def glob_to(prefix, new_prefix, dirs):
if prefix and prefix[-1]!='/':
prefix += '/'
return list([(new_prefix+'/'+dir, glob_(prefix, dir+'/*')) for dir in dirs])
# edit MANIFEST.in
prefix = sys.path[0]
if prefix and prefix[-1]!='/':
prefix += '/'
more_data_files = glob_to(prefix, 'share/beah', rdglob(prefix, [
'recipes',
'recipesets',
'examples/tasks',
'examples/tests',
'tests', # FIXME: add some tests here!
'doc',
], dex=('*.tmp', '*.wip')))
more_data_files += glob_to(prefix, 'libexec/beah', rdglob(prefix, ['beah-check'], dex=('*.tmp', '*.wip')))
#print "more_data_files:", more_data_files
# FIXME: Find out about real requirements - packages, versions.
if os.environ.get('BEAH_NODEP', ''):
requirements = []
else:
requirements = ['Twisted_Core >= 0',
'Twisted_Web >= 0',
'zope.interface >= 0',
'simplejson >= 0']
requirements = []
version = "0.7.13"
long_version = os.environ.get('BEAH_VER', version) + os.environ.get('BEAH_DEV', strftime(".dev%Y%m%d%H%M"))
setup(
name="beah",
version=long_version,
install_requires=requirements,
# NOTE: these can be downloaded from pypi:
#dependency_links=['http://twistedmatrix.com/trac/wiki/Downloads',
# 'http://pypi.python.org/pypi/Twisted',
# 'http://zope.org/Products/ZopeInterface',
# 'http://pypi.python.org/pypi/zope.interface',
# 'http://pypi.python.org/pypi/simplejson'],
# Other requirements: PyXML, python-fpconst, SOAPpy, python-zope-filesystem
packages=find_packages(),
py_modules=['beahlib'],
#package_dir={'':'.'},
# FIXME: move this to beah.bin(?)
scripts=[
'bin/beat_tap_filter',
'bin/rhts-compat-runner.sh',
'bin/beah-reboot.sh',
'bin/beah-check',
'bin/beah-flush',
'bin/rhts-flush',
'bin/beah-rhts-runner.sh',
'bin/tortilla',
],
#scripts+=['tests/*'],
# FIXME: use `grep -R '#!.*python' examples` to find python scripts
# - this would not work on the well known non-POSIX platform :-/
namespace_packages=['beah'],
data_files=[
('/var/lib/beah/tortilla/wrappers.d', ['wrappers.d/initgroups',
'wrappers.d/unconfined',
'wrappers.d/nice',
'wrappers.d/runtest']),
('/var/lib/beah/tortilla/order.d', ['order.d/rhts']),
('/etc', ['beah.conf', 'beah_beaker.conf', 'beah_watchdog.conf']),
('/etc/init.d', ['init.d/beah-srv', 'init.d/beah-fakelc', 'init.d/beah-beaker-backend', 'init.d/beah-watchdog-backend', 'init.d/beah-fwd-backend', 'init.d/rhts-compat']),
('/usr/lib/systemd/system',['systemd/beah-srv.service', 'systemd/beah-fwd-backend.service', 'systemd/beah-beaker-backend.service']),
('/lib/systemd/system',['systemd/beah-srv.service', 'systemd/beah-fwd-backend.service', 'systemd/beah-beaker-backend.service']),
('share/beah', ['README', 'COPYING', 'LICENSE']),
] + more_data_files,
#package_data={
# '': ['beah.conf', 'beah_beaker.conf'],
# 'init.d': ['beah-srv', 'beah-beaker-backend'],
#},
entry_points={
'console_scripts': (
'beah-srv = beah.bin.srv:main',
'beah = beah.bin.cli:main',
'beah-cmd-backend = beah.bin.cmd_backend:main',
'beah-out-backend = beah.bin.out_backend:main',
'beah-beaker-backend = beah.backends.beakerlc:main',
'beah-watchdog-backend = beah.backends.watchdog:main',
'beah-fwd-backend = beah.backends.forwarder:main',
'beah-fakelc = beah.tools.fakelc:main',
'beah-rhts-task = beah.tasks.rhts_xmlrpc:main',
'beah-root = beah.tools:main_root',
'beah-data-root = beah.tools:main_data_root',
'beah-data-file = beah.tools:main_data_file',
'beah-data-dir = beah.tools:main_data_dir',
'beahsh = beah.tools.beahsh:main',
'json-env = beah.bin.jsonenv:main',
),
},
license="GPLv2+",
keywords="test testing harness beaker twisted qa",
url="http://fedorahosted.org/beah",
author="Marian Csontos",
author_email="[email protected]",
description="Test Harness. Offspring of Beaker project.",
long_description="""\
Beah - Test Harness.
Test Harness with goal to serve any tests and any test schedulers.
Harness consist of a server and two kinds of clients - back ends and tasks.
Back ends issue commands to Server and process events from tasks. Back ends
usually communicate with a Scheduler or interact with an User.
Tasks are events producers. Tasks are wrappers for Tests to produce stream of
events.
Powered by Twisted.
""",
classifiers=[
'Development Status :: 3 - Beta',
'Environment :: Console',
'Environment :: No Input/Output (Daemon)',
'Framework :: Twisted',
'Intended Audience :: Developers',
'License :: OSI Approved :: GNU General Public License (GPL)',
'Operating System :: POSIX :: Linux', # FIXME: Wishing 'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Software Development :: Testing',
],
)