diff --git a/.travis.yml b/.travis.yml index 958907e9..350b973b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,7 +9,7 @@ language: python python: - 2.6 -- "2.7_with_system_site_packages" +- 2.7 - 3.2 - 3.3 - 3.4 @@ -18,6 +18,13 @@ before_install: - export DISPLAY=:99.0 - export PYTHONWARNINGS="all" - export WHEELHOUSE="--no-index --find-links=http://travis-wheels.scikit-image.org/" + - sudo apt-get update + + - virtualenv -p python ~/venv + - source ~/venv/bin/activate + - which python + - python --version + - travis_retry tools/travis_setup.sh - python check_bento_build.py diff --git a/requirements.txt b/requirements.txt index 98f3b77f..9e5c9ba4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,7 @@ cython>=0.19.2 -matplotlib>=1.1.0 -numpy>=1.6.1 +matplotlib>=1.1.1 +numpy>=1.6.0 scipy>=0.9 six>=1.3 networkx>=1.8 -pillow>=1.1.7 +pillow>=1.7.8 diff --git a/setup.py b/setup.py index 1d7b3d1c..f9ec3a07 100755 --- a/setup.py +++ b/setup.py @@ -35,7 +35,7 @@ DEPENDENCIES = {} with open('requirements.txt', 'rb') as fid: data = fid.read().decode('utf-8', 'replace') for line in data.splitlines(): - pkg, _, version_info = line.partition('>=') + pkg, _, version_info = line.replace('==', '>=').partition('>=') # Only require Cython if we have a developer checkout if pkg.lower() == 'cython' and not VERSION.endswith('dev'): continue @@ -88,22 +88,29 @@ def check_requirements(): for (package_name, min_version) in DEPENDENCIES.items(): if package_name == 'cython': package_name = 'Cython' - dep_error = False + dep_error = '' if package_name.lower() == 'pillow': package_name = 'PIL.Image' + min_version = '1.1.7' try: package = __import__(package_name, fromlist=[package_name.rpartition('.')[0]]) except ImportError: - dep_error = True + dep_error = ('You need `%s` version %s or later.' + % (package_name, min_version)) else: - package_version = get_package_version(package) + if package_name == 'PIL': + package_version = package.PILLOW_VERSION + else: + package_version = get_package_version(package) if LooseVersion(min_version) > LooseVersion(package_version): - dep_error = True + dep_error = ('You need `%s` version %s or later,' + 'found version %s.' + % (package_name, min_version, + package_version)) if dep_error: - raise ImportError('You need `%s` version %s or later.' \ - % (package_name, min_version)) + raise ImportError(dep_error) if __name__ == "__main__": diff --git a/tools/travis_install_optional.sh b/tools/travis_install_optional.sh index ec01d899..b1de66de 100755 --- a/tools/travis_install_optional.sh +++ b/tools/travis_install_optional.sh @@ -10,7 +10,7 @@ if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then else sudo apt-get install -q libqt4-dev pip install -q PySide $WHEELHOUSE - python ~/virtualenv/python${TRAVIS_PYTHON_VERSION}/bin/pyside_postinstall.py -install + python ~/venv/bin/pyside_postinstall.py -install fi # imread does NOT support py3.2 diff --git a/tools/travis_setup.sh b/tools/travis_setup.sh index e8227642..d9f46cd9 100755 --- a/tools/travis_setup.sh +++ b/tools/travis_setup.sh @@ -2,20 +2,26 @@ set -ex sh -e /etc/init.d/xvfb start -sudo apt-get update pip install wheel flake8 coveralls nose -pip uninstall -y numpy + +# install system tk +sudo apt-get install python-tk # on Python 2.7, use the system versions of numpy, scipy, and matplotlib # and the minimum version of cython and networkx if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then sudo apt-get install python-scipy python-matplotlib - pip install https://github.com/cython/cython/archive/0.19.2.tar.gz - pip install https://github.com/networkx/networkx/archive/networkx-1.8.tar.gz + sed -i 's/cython>=/cython==/g' requirements.txt + sed -i 's/networkx>=/networkx==/g' requirements.txt fi -pip install -r requirements.txt $WHEELHOUSE +# on Python 3.2, use matplotlib 1.3.1 +if [[ $TRAVIS_PYTHON_VERSION == 2.7* ]]; then + sed -i 's/matplotlib>=*.*.*/matplotlib==1.3.1/g' requirements.txt +fi + +pip install $WHEELHOUSE -r requirements.txt # clean up disk space sudo apt-get clean