From 2d06422a6d2ae68a5e135370bf07f36dc80d50a8 Mon Sep 17 00:00:00 2001 From: Lars Buitinck Date: Fri, 11 Jul 2014 16:13:55 +0200 Subject: [PATCH 1/2] test Python3 --- .travis.yml | 7 +++++-- requirements3.txt | 16 ++++++++++++++++ setup.py | 4 +++- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 requirements3.txt diff --git a/.travis.yml b/.travis.yml index 2b67d8f..e18c8ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: python python: # Only 2.7 to prevent having to install NumPy and SciPy from source. - "2.7" + - "3.2" services: - elasticsearch @@ -12,9 +13,11 @@ virtualenv: install: - sudo apt-get update - - sudo apt-get install python-numpy python-scipy + - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then sudo apt-get install python-numpy python-scipy; fi + - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then sudo apt-get install python3-numpy python3-scipy; fi + - if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then pip install -r requirements.txt; fi + - if [[ $TRAVIS_PYTHON_VERSION == 3* ]]; then pip install -r requirements3.txt; fi - pip install . - - pip install -r requirements.txt script: - python -m xtas.worker --loglevel=info --pidfile=worker.pid & diff --git a/requirements3.txt b/requirements3.txt new file mode 100644 index 0000000..50bbdf6 --- /dev/null +++ b/requirements3.txt @@ -0,0 +1,16 @@ +celery>=3.0.0 +chardet +elasticsearch +flask>=0.10.1 +gensim +kombu +#langid>=1.1.4dev +#librabbitmq +nltk>=3.0.0b1 +pyspotlight +scikit-learn>=0.15.0b2 +setuptools>=1.3.2 +six +toolz +unidecode +weighwords diff --git a/setup.py b/setup.py index 96b4482..7a09c3b 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,7 @@ from distutils.core import setup import os.path +import sys # Get __version__ from xtas source @@ -19,7 +20,8 @@ def readme(): def requirements(): - with open(os.path.join(dist_dir, "requirements.txt")) as f: + fname = "requirements%s.txt" % ("" if sys.version_info.major == 2 else "3") + with open(os.path.join(dist_dir, fname)) as f: return f.readlines() From 41eda02fd3370bf2a43c6cc96eb3b31733433a1e Mon Sep 17 00:00:00 2001 From: Lars Buitinck Date: Sun, 7 Sep 2014 14:29:29 +0200 Subject: [PATCH 2/2] Py3 reqs: new NLTK, scikit-learn; toolz -> cytoolz --- requirements3.txt | 6 +++--- xtas/tasks/cluster.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/requirements3.txt b/requirements3.txt index 50bbdf6..99465a0 100644 --- a/requirements3.txt +++ b/requirements3.txt @@ -1,16 +1,16 @@ celery>=3.0.0 chardet +cytoolz elasticsearch flask>=0.10.1 gensim kombu #langid>=1.1.4dev #librabbitmq -nltk>=3.0.0b1 +nltk>=3.0.0 pyspotlight -scikit-learn>=0.15.0b2 +scikit-learn>=0.15.2 setuptools>=1.3.2 six -toolz unidecode weighwords diff --git a/xtas/tasks/cluster.py b/xtas/tasks/cluster.py index 97b89e3..7f1c4ed 100644 --- a/xtas/tasks/cluster.py +++ b/xtas/tasks/cluster.py @@ -7,7 +7,7 @@ import operator -import cytoolz +import cytoolz as toolz from six import itervalues from .es import fetch