forked from lingpy/lingpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
138 lines (127 loc) · 3.93 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
"""
Setup-Script for LingPy
"""
import distribute_setup
distribute_setup.use_setuptools()
from setuptools import setup, find_packages,Extension
import sys
import os
import os.path
# check for specific features
with_c = False
for i,arg in enumerate(sys.argv):
if arg.lower() == '--with-c':
del sys.argv[i]
with_c = True
break
extra = {}
# setup package name etc as a default
pkgname = 'lingpy'
pkg_dir = {'':'.'}
pkg_location = '.'
if sys.version_info >= (3,):
extra['use_2to3'] = False
# set up extension modules
if 'install' in sys.argv or 'bdist_egg' in sys.argv or 'develop' in sys.argv:
if with_c:
extension_path = ['lingpy','algorithm','cython']
extension_prefix = os.path.join(*extension_path)
extension_modules = [
Extension(
os.path.join('.'.join(extension_path + ['calign'])),
[os.path.join(extension_prefix,'calign.c')]
),
Extension(
os.path.join('.'.join(extension_path + ['malign'])),
[os.path.join(extension_prefix,'malign.c')]
),
Extension(
os.path.join('.'.join(extension_path + ['talign'])),
[os.path.join(extension_prefix,'talign.c')]
),
Extension(
os.path.join('.'.join(extension_path + ['cluster'])),
[os.path.join(extension_prefix,'cluster.c')]
),
Extension(
os.path.join('.'.join(extension_path + ['misc'])),
[os.path.join(extension_prefix,'misc.c')]
),
]
else:
extension_modules = []
else:
extension_modules = []
requires = [
'networkx',
'numpy',
'six',
'appdirs'
]
if sys.version_info < (3, 4):
requires.append('pathlib')
# make global name of this version for convenience of modifying it
thisversion = "2.5"
setup(
name=pkgname,
version=thisversion,
packages=find_packages(pkg_location,
exclude=[
"lingpy._plugins", "_plugins", "*._plugins", "_plugins.*", '*._plugins.*', "build", "private", "lingpy.egg-info",
"dist", "lib"]
),
package_dir=pkg_dir,
install_requires=requires,
tests_require=['nose', 'coverage', 'mock'],
author="Johann-Mattis List and Robert Forkel",
author_email="[email protected]",
entry_points={
'console_scripts' : ['lingpy=lingpy.cli:main'],
},
keywords=[
"historical linguistics",
"sequence alignment",
"computational linguistics",
"dialectology"
],
url="http://lingpy.org",
description="Python library for automatic tasks in historical linguistics",
license="gpl-3.0",
platforms=["unix", "linux", "windows"],
ext_modules=extension_modules,
extras_require={
"borrowing": ["matplotlib", "networkx", "scipy"]
},
include_package_data=True,
exclude_package_data={},
package_data={
'': [
'data/ipa/sampa.csv',
'data/swadesh/swadesh.qlc',
'data/orthography_profiles/*.prf',
'tests/test_data/*.csv',
'tests/test_data/*.qlc',
'tests/test_data/*.msq',
'tests/test_data/*.msa',
'tests/test_data/*.tsv',
'data/conceptlists/*.tsv',
'data/conf/*.rc',
'data/models/*/converter',
'data/models/*/INFO',
'data/models/*/matrix',
'data/models/*/scorer',
'data/models/dvt/diacritics',
'data/models/dvt/vowels',
'data/models/dvt/tones',
'data/models/dvt_el/diacritics',
'data/models/dvt_el/vowels',
'data/models/dvt_el/tones',
'data/templates/*.html',
'data/templates/*.js',
'data/templates/*.css',
'data/templates/*.tex',
'data/swadesh/swadesh.qlc',
]
},
**extra
)