From 5668feb235dae456843507e7054508f55b79e8c3 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Nov 2015 04:57:02 +0100 Subject: [PATCH 1/5] * Fix pickle test for python3 --- spacy/tests/test_pickle.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spacy/tests/test_pickle.py b/spacy/tests/test_pickle.py index 540e54486..2577f58a6 100644 --- a/spacy/tests/test_pickle.py +++ b/spacy/tests/test_pickle.py @@ -5,6 +5,11 @@ import pickle import pytest import tempfile +try: + unicode +except NameError: + unicode = str + @pytest.mark.models def test_pickle_english(EN): file_ = io.BytesIO() @@ -21,7 +26,7 @@ def test_cloudpickle_to_file(EN): p = cloudpickle.CloudPickler(f) p.dump(EN) f.close() - loaded_en = cloudpickle.load(open(f.name)) + loaded_en = cloudpickle.load(open(f.name, 'rb')) os.unlink(f.name) doc = loaded_en(unicode('test parse')) assert len(doc) == 2 From bb5598b816767b1ed8d69fe420ed216d43ce5871 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Nov 2015 05:32:18 +0100 Subject: [PATCH 2/5] * Fix test command in fabfile --- fabfile.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fabfile.py b/fabfile.py index 8def13386..8f0097615 100644 --- a/fabfile.py +++ b/fabfile.py @@ -121,9 +121,8 @@ def clean(): def test(): with virtualenv(VENV_DIR): - # Run each test file separately. pytest is performing poorly, not sure why with lcd(path.dirname(__file__)): - local('py.test -x tests/') + local('py.test -x --models spacy/tests') def train(json_dir=None, dev_loc=None, model_dir=None): From 3656f06e35dac681b736644692bc04534a5dd932 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Nov 2015 06:39:30 +0100 Subject: [PATCH 3/5] * Don't use models in fab test --- fabfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabfile.py b/fabfile.py index 8f0097615..f7eac3f28 100644 --- a/fabfile.py +++ b/fabfile.py @@ -122,7 +122,7 @@ def clean(): def test(): with virtualenv(VENV_DIR): with lcd(path.dirname(__file__)): - local('py.test -x --models spacy/tests') + local('py.test -x spacy/tests') def train(json_dir=None, dev_loc=None, model_dir=None): From 8bde2bba58b7c685d1f09faebfa3ddda5232e82c Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Nov 2015 07:11:59 +0100 Subject: [PATCH 4/5] * Fiddle with prebuild command --- fabfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fabfile.py b/fabfile.py index f7eac3f28..0fb1e80a6 100644 --- a/fabfile.py +++ b/fabfile.py @@ -54,10 +54,10 @@ def prebuild(build_dir='/tmp/build_spacy'): local('pip install --no-cache-dir -r requirements.txt') local('fab clean make') local('cp -r %s/corpora/en/wordnet corpora/en/' % spacy_dir) - local('cp %s/corpora/en/freqs.txt.gz corpora/en/' % spacy_dir) local('PYTHONPATH=`pwd` python bin/init_model.py en lang_data corpora spacy/en/data') local('fab test') - local('python setup.py sdist') + local('PYTHONPATH=`pwd` python spacy.en.download --force all en') + local('py.test --models spacy/tests/') def docs(): From 2714fb47331d05d99113bbbc79d5cff244d38433 Mon Sep 17 00:00:00 2001 From: Matthew Honnibal Date: Tue, 3 Nov 2015 07:21:03 +0100 Subject: [PATCH 5/5] * Fix prebuild command --- fabfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fabfile.py b/fabfile.py index 0fb1e80a6..5fd934820 100644 --- a/fabfile.py +++ b/fabfile.py @@ -56,7 +56,7 @@ def prebuild(build_dir='/tmp/build_spacy'): local('cp -r %s/corpora/en/wordnet corpora/en/' % spacy_dir) local('PYTHONPATH=`pwd` python bin/init_model.py en lang_data corpora spacy/en/data') local('fab test') - local('PYTHONPATH=`pwd` python spacy.en.download --force all en') + local('PYTHONPATH=`pwd` python -m spacy.en.download --force all') local('py.test --models spacy/tests/')