-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
executable file
·103 lines (91 loc) · 3.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
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import os
import sys
import warnings
from setuptools import setup, Extension
from Cython.Distutils import build_ext
dist_dir = os.path.dirname(os.path.abspath(__file__))
os.system("gunzip -kf %s/irtrans/models/* 2> /dev/null" %dist_dir)
try:
import py2exe
except ImportError:
if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
print("Cannot import py2exe", file=sys.stderr)
exit(1)
py2exe_options = {
"bundle_files": 1,
"compressed": 1,
"optimize": 2,
"dist_dir": '.',
"dll_excludes": ['w9xpopen.exe'],
}
py2exe_console = [{
"script": "./irtrans/__main__.py",
"dest_base": "irtrans",
}]
py2exe_params = {
'console': py2exe_console,
'options': {"py2exe": py2exe_options},
'zipfile': None
}
if len(sys.argv) >= 2 and sys.argv[1] == 'py2exe':
params = py2exe_params
else:
files_spec = [
('share/doc/irtrans', ['README.rst'])
]
root = os.path.dirname(os.path.abspath(__file__))
data_files = []
for dirname, files in files_spec:
resfiles = []
for fn in files:
if not os.path.exists(fn):
warnings.warn('Skipping file %s since it is not present. Type make to build all automatically generated files.' % fn)
else:
resfiles.append(fn)
data_files.append((dirname, resfiles))
params = {
'data_files': data_files,
}
params['entry_points'] = {'console_scripts': ['irtrans = irtrans:main']}
# Get the package version
exec(compile(open('irtrans/version.py').read(),
'irtrans/version.py', 'exec'))
setup(
name = "irtrans",
version = __version__,
description="Transliteration Tool: Hindi to Urdu transliterator and vice-versa",
long_description = open('README.rst', 'rb').read().decode('utf8'),
keywords = ['Language Transliteration', 'Computational Linguistics',
'Indic', 'Roman'],
author=['Riyaz Ahmad', 'Irshad Ahmad'],
author_email='[email protected]',
maintainer='Irshad Ahmad',
maintainer_email='[email protected]',
license = "MIT",
url="https://github.com/irshadbhat/irtrans",
package_dir={"irtrans":"irtrans"},
packages=['irtrans', 'irtrans._utils', 'irtrans._decode'],
package_data={'irtrans': ['models/*.npy']},
classifiers=[
"Topic :: Text Processing :: Linguistic",
"Topic :: Software Development :: Libraries :: Python Modules",
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Operating System :: Unix"
],
cmdclass={'build_ext': build_ext},
ext_modules=[
Extension("irtrans._decode.viterbi", ["irtrans/_decode/viterbi.pyx"]),
],
install_requires=["cython", "numpy", "scipy"],
#requires=["cython", "numpy", "scipy"],
**params
)