diff --git a/rnlp/__init__.py b/rnlp/__init__.py index a44e311..8bca420 100644 --- a/rnlp/__init__.py +++ b/rnlp/__init__.py @@ -64,7 +64,7 @@ __copyright__ = 'Copyright (c) 2017-2018 StARLinG Lab' __license__ = 'GPL-v3' -__version__ = '0.3.1' +__version__ = '0.3.2' __status__ = 'Beta' __maintainer__ = 'Alexander L. Hayes (@batflyer)' __email__ = 'alexander.hayes@utdallas.edu' diff --git a/setup.py b/setup.py index 8a8f5c2..5b00456 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,8 @@ """ from setuptools import setup, find_packages +from setuptools.command.install import install as _install + from codecs import open from os import path @@ -12,20 +14,27 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f: long_description = f.read() -# rnlp needs a few additional nltk packages to function properly. -import nltk -nltk.download('punkt') -nltk.download('stopwords') -#nltk.download('wordnet') -nltk.download('averaged_perceptron_tagger') -# Import the package and assign metadata as appropriate -import rnlp +# https://stackoverflow.com/questions/26799894/installing-nltk-data-in-setup-py-script +class Install(_install): + """ + Overwriting the base class to additionally install nltk packages. + """ + + def run(self): + _install.do_egg_install(self) + + # Install the additional required nltk packages + import nltk + nltk.download('punkt') + nltk.download('stopwords') + nltk.download('averaged_perceptron_tagger') + setup( name='rnlp', - version=rnlp.__version__, - license=rnlp.__license__, + version='0.3.2', + license='GPL-v3', description='Converts text corpora into a set of relational facts.', long_description=long_description, @@ -61,5 +70,15 @@ 'Tracker': 'https://github.com/starling-lab/rnlp/issues' }, - packages=find_packages(exclude=['tests']) + packages=find_packages(exclude=['tests']), + + cmdclass={'install': Install}, + + install_requires=[ + 'nltk', + 'tqdm', + 'joblib' + ], + + setup_requires=['nltk'] )