-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
58 lines (49 loc) · 1.84 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
import os
import re
import setuptools
def read_file(filename):
"""Open and a file, read it and return its contents."""
path = os.path.join(os.path.dirname(__file__), filename)
with open(path) as f:
return f.read()
def get_version():
"""Extract and return version number from the packages '__init__.py'."""
init_path = os.path.join('thot_utils', '__init__.py')
content = read_file(init_path)
match = re.search(r"__version__ = '([^']+)'", content, re.M)
version = match.group(1)
return version
metadata = dict(
name='thot-utils',
version=get_version(),
description='Thot utils used in pre and post processing',
install_requires=read_file('requirements.txt'),
packages=setuptools.find_packages(
include=['thot_utils', 'thot_utils.*'],
),
include_package_data=True,
zip_safe=True,
package_data={
'': ['requirements.txt'],
'thot_utils.confs': ['*.ini'],
},
entry_points={
'console_scripts': [
'thot_categorize = thot_utils.bin.thot_categorize:main',
'thot_decategorize = thot_utils.bin.thot_decategorize:main',
'thot_clean_corpus_ln = thot_utils.bin.thot_clean_corpus_ln:main',
'thot_lowercase = thot_utils.bin.thot_lowercase:main',
'thot_recase = thot_utils.bin.thot_recase:main',
'thot_recase_precalculate = thot_utils.bin.thot_recase_precalculate:main',
'thot_tokenize = thot_utils.bin.thot_tokenize:main',
'thot_detokenize = thot_utils.bin.thot_detokenize:main',
'thot_detokenize_precalculate = thot_utils.bin.thot_detokenize_precalculate:main',
],
},
classifiers=[
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
],
)
if __name__ == '__main__':
setuptools.setup(**metadata)