forked from tadek-project/tadek-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·96 lines (88 loc) · 4.68 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
#!/usr/bin/env python
################################################################################
## ##
## This file is a part of TADEK. ##
## ##
## TADEK - Test Automation in a Distributed Environment ##
## (http://tadek.comarch.com) ##
## ##
## Copyright (C) 2011,2012 Comarch S.A. ##
## All rights reserved. ##
## ##
## TADEK is free software for non-commercial purposes. For commercial ones ##
## we offer a commercial license. Please check http://tadek.comarch.com for ##
## details or write to [email protected] ##
## ##
## 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 3 of the License, or (at your option) any later version. ##
## ##
## TADEK 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 TADEK bundled with this file in the file LICENSE. ##
## If not, see http://www.gnu.org/licenses/. ##
## ##
## Please notice that Contributor Agreement applies to any contribution ##
## you make to TADEK. The Agreement must be completed, signed and sent ##
## to Comarch before any contribution is made. You should have received ##
## a copy of Contribution Agreement along with TADEK bundled with this file ##
## in the file CONTRIBUTION_AGREEMENT.pdf or see http://tadek.comarch.com ##
## or write to [email protected] ##
## ##
################################################################################
import os
import sys
from glob import glob
from distutils.core import setup
from distutils.util import convert_path
from distutils.command.install import install as _install
from distutils.command.build_scripts import build_scripts as _build_scripts
try:
from tadek.core.config import DATA_DIR, VERSION
except ImportError:
print >> sys.stderr, "Required tadek-common package is not installed"
exit(1)
DATA_FILES = [
(os.path.join(DATA_DIR, "tools"), glob(os.path.join("src", "*.py"))),
]
class build_scripts(_build_scripts):
def run(self):
_build_scripts.run(self)
if self.scripts and os.name == "nt":
# Make sure that all installed scripts have .py extension
for file in self.scripts:
file = convert_path(file)
file = os.path.join(self.build_dir, os.path.basename(file))
root, ext = os.path.splitext(file)
path = root + ".py"
if os.path.exists(path):
os.remove(file)
else:
self.move_file(file, path)
class install(_install):
sub_commands = []
# Skip the install_egg_info sub-command
for name, method in _install.sub_commands:
if name != "install_egg_info":
sub_commands.append((name, method))
del name, method
setup(
name="tadek-tools",
version=VERSION,
description="TADEK command-line clients: tadek-runner, "
"tadek-explorer and tadek-conf",
long_description=''.join(['\n', open("README").read()]),
author="Comarch TADEK Team",
author_email="[email protected]",
license="http://tadek.comarch.com/licensing",
url="http://tadek.comarch.com/",
cmdclass={"build_scripts": build_scripts, "install": install},
scripts=["scripts/tadek-conf",
"scripts/tadek-explorer",
"scripts/tadek-runner"],
data_files=DATA_FILES,
)