-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
35 lines (27 loc) · 1.07 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
import setuptools
from setuptools.command.install import install
import json
class DownloadNltkPackages(install):
def run(self):
install.run(self)
try:
import nltk
print('Installing nltk required packages...')
except ImportError:
raise ImportError('nltk is required')
nltk.download('punkt')
nltk.download('stopwords')
nltk.download('wordnet')
nltk.download('averaged_perceptron_tagger')
if __name__ == '__main__':
with open('README.md', 'r', encoding='UTF-8') as fh:
long_description = fh.read()
with open('setup.json', 'r') as sf:
setup_infos = json.load(sf)
setuptools.setup(include_package_data=True,
cmdclass={'install': DownloadNltkPackages},
packages=setuptools.find_packages(),
long_description=long_description,
setup_requires=['nltk >= 3'],
install_requires=['nltk >= 3'],
**setup_infos)