-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
36 lines (29 loc) · 788 Bytes
/
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
import os
import re
from setuptools import setup
def get_version():
with open(os.path.join("src", "nlpertools", "__init__.py"), "r", encoding="utf-8") as f:
file_content = f.read()
pattern = r"{}\W*=\W*\'([^\"]+)\'".format("__version__")
(version,) = re.findall(pattern, file_content)
return version
def main():
setup(
# https://juejin.cn/post/7369349560421040128
install_requires=[
"numpy",
"pandas",
"psutil"
],
extras_require={
"torch": ["torch"],
},
version=get_version(),
entry_points={
"console_scripts": [
"ncli=nlpertools.cli:main",
]
}
)
if __name__ == '__main__':
main()