-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
74 lines (66 loc) · 2.2 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
#!/usr/bin/env python
import setuptools
import os, shutil
def copytree(src, dst):
os.makedirs(dst, exist_ok=True)
for item in os.listdir(src):
s = os.path.join(src, item)
d = os.path.join(dst, item)
if os.path.isdir(s):
copytree(s, d)
else:
shutil.copy(s, d)
def reqs_from_file(src):
requirements = []
with open(src) as f:
for line in f:
line = line.strip()
if not line.startswith("-r"):
requirements.append(line)
else:
add_src = line.split(' ')[1]
add_req = reqs_from_file(add_src)
requirements.extend(add_req)
return requirements
if __name__ == "__main__":
with open("docs/README.md", "r") as fh:
long_description = fh.read()
requirements=[]
wd = os.path.dirname(os.path.abspath(__file__))
copytree("third_party/preprocess/moses", os.path.join(wd, "monotextor/data/moses"))
requirements = reqs_from_file("requirements.txt")
setuptools.setup(
name="monotextor",
version="1.1.0",
install_requires=requirements,
license="GNU General Public License v3.0",
#author=,
#author_email=,
#maintainer=,
#maintainer_email,
description="Bitextor generates translation memories from multilingual websites",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/bitextor/monotextor",
packages=["monotextor", "monotextor.utils"],
#classifiers=[],
#project_urls={},
package_data={
"monotextor": [
"Snakefile",
"rules/*",
"utils/clean-corpus-n.perl",
"data/*",
"data/model/*",
"data/moses/ems/support/*",
"data/moses/tokenizer/*",
"data/moses/share/nonbreaking_prefixes/*",
]
},
entry_points={
"console_scripts": [
"monotextor = monotextor.monotextor_cli:main",
"monotextor-full = monotextor.monotextor_cli:main_full"
]
}
)