From a127f908a92cfc4ec015d7b2322ae4a8c41b0003 Mon Sep 17 00:00:00 2001 From: Ozan Caglayan Date: Mon, 6 Feb 2017 11:03:13 +0100 Subject: [PATCH] setup.py: check paraphrase files --- setup.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index ac5d052..4fbb398 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,19 @@ # -*- coding: utf-8 -*- +from __future__ import print_function +import os +import sys + from setuptools import setup import nmtpy # Install pycocoevalcap metric scorers as well -pycocometrics = ['bleu', 'meteor', 'cider', 'rouge'] -pycocopackages = ['nmtpy.cocoeval.%s' % m for m in pycocometrics] +pycocometrics = ['bleu', 'meteor', 'cider', 'rouge'] +pycocopackages = ['nmtpy.cocoeval.%s' % m for m in pycocometrics] + +if 'install' in sys.argv or 'develop' in sys.argv: + if not os.path.exists('nmtpy/external/data/paraphrase-en.gz'): + print('You need to run scripts/get-meteor-data.sh first.') + sys.exit(1) setup( name='nmtpy',