forked from zanata/zanata-python-client
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·78 lines (68 loc) · 2.08 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
#!/usr/bin/env python
"""
Build script for zanata-python-client
"""
from setuptools import setup, find_packages
import os
import subprocess
def get_client_version():
number = ""
path = os.path.dirname(os.path.realpath(__file__))
version_file = os.path.join(path, 'zanataclient/VERSION-FILE')
version_gen = os.path.join(path, 'VERSION-GEN')
p = subprocess.Popen(version_gen, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, close_fds=True)
output = p.stdout.readline()
number = output.rstrip()[len('version: '):]
subprocess.Popen("""
cat << EOF > MANIFEST.in
include zanataclient/VERSION-FILE
include CHANGELOG
include COPYING
include COPYING.LESSER
include zanata.ini
EOF
""", shell=True)
if number=='UKNOWN':
try:
file = open(version_file, 'rb')
client_version = file.read()
file.close()
number = client_version[:-1][len('version: '):]
except IOError:
file = open(version_file, 'w')
file.write("version: UKNOWN")
file.close
return number
setup (name = "zanata-python-client",
version = get_client_version(),
packages = find_packages(),
include_package_data = True,
install_requires=[
'polib' ,
'httplib2'
],
description = "Zanata Python Client.",
author = 'Jian Ni, Ding-Yi Chen',
author_email = '[email protected], [email protected]',
license = 'LGPLv2+',
platforms=["Linux"],
scripts = ["zanata","flies"],
url='https://github.com/zanata/zanata-python-client',
#entry_points = {
#'console_scripts': [
# 'zanata = zanataclient.zanata:main',
#]
#},
package_data = {
'': ['VERSION-FILE']
},
data_files = [
('share/doc/zanata-python-client',
['CHANGELOG', 'COPYING', 'COPYING.LESSER', 'zanata.ini']
)
],
classifiers=['License :: OSI Approved :: GNU Lesser General Public License (LGPL)',
'Operating System :: Unix',
'Programming Language :: Python',
],
)