Skip to content

Commit

Permalink
test(ml): skip sklearn for py27
Browse files Browse the repository at this point in the history
  • Loading branch information
maartenbreddels committed May 31, 2019
1 parent 9194f4f commit 548aff4
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,18 @@ before_install:
- if [[ $TRAVIS_OS_NAME == linux ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh; fi
- if [[ $TRAVIS_OS_NAME == osx ]]; then wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh; fi
# we do not install lightgbm on linux/travis, since importing those fail, if we run those tests only on osx, that should be fine
# we also don't support sklearn in python 2.7
- export OPTIONAL_PACKAGES="";
- if [[ $TRAVIS_OS_NAME == osx ]] && [[ "$PYTHON_VERSION" != "2.7" ]]; then export OPTIONAL_PACKAGES="lightgbm py-xgboost"; fi
- if [[ "$PYTHON_VERSION" != "2.7" ]]; export OPTIONAL_PACKAGES="scikit-learn "; fi
- if [[ $TRAVIS_OS_NAME == osx ]] && [[ "$PYTHON_VERSION" != "2.7" ]]; then export OPTIONAL_PACKAGES="$OPTIONAL_PACKAGES lightgbm py-xgboost "; fi
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- hash -r
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
# future: kapteyn should only be needed for astro package testing
- conda create -q -n test-environment -c conda-forge python=$PYTHON_VERSION pip numpy scipy pyqt matplotlib pyopengl h5py numexpr astropy tornado cython runipy pandas pytest numba pyarrow graphviz python-graphviz pcre catboost scikit-learn $OPTIONAL_PACKAGES
- conda create -q -n test-environment -c conda-forge python=$PYTHON_VERSION pip numpy scipy pyqt matplotlib pyopengl h5py numexpr astropy tornado cython runipy pandas pytest numba pyarrow graphviz python-graphviz pcre catboost $OPTIONAL_PACKAGES
- which pip
- source activate test-environment
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
Expand Down
1 change: 1 addition & 0 deletions packages/vaex-ml/vaex/ml/linear_model.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import numpy as np
import traitlets
pytest.importorskip("sklearn")
import sklearn.linear_model as lin

import vaex
Expand Down
1 change: 1 addition & 0 deletions tests/ml/sklearn_test.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import vaex
pytest.importorskip("sklearn")
from vaex.ml.sklearn import SKLearnPredictor

import numpy as np
Expand Down

0 comments on commit 548aff4

Please sign in to comment.