From 4ffd5232cd95e4e100ea6f382f9d9acd9ae98a03 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Sun, 16 Feb 2020 11:10:01 +0100 Subject: [PATCH 1/4] MNT/CI drop python 3.5 --- README.rst | 4 ++-- azure-pipelines.yml | 20 ++++++++++---------- build_tools/azure/install.sh | 5 +++-- build_tools/azure/posix-32.yml | 2 +- doc/install.rst | 7 ++++--- setup.py | 4 ++-- 6 files changed, 22 insertions(+), 20 deletions(-) diff --git a/README.rst b/README.rst index 8a974b554..f04e32959 100644 --- a/README.rst +++ b/README.rst @@ -52,8 +52,8 @@ Dependencies imbalanced-learn is tested to work under Python 3.6+. The dependency requirements are based on the last scikit-learn release: -* scipy(>=0.17) -* numpy(>=1.11) +* scipy(>=0.19.1) +* numpy(>=1.13.3) * scikit-learn(>=0.22) * joblib(>=0.11) * keras 2 (optional) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 49d265978..cf3062e84 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,7 +3,7 @@ jobs: - job: linting displayName: Linting pool: - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 steps: - bash: echo "##vso[task.prependpath]$CONDA/bin" displayName: Add conda to PATH @@ -19,15 +19,15 @@ jobs: - template: build_tools/azure/posix.yml parameters: name: Linux - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 dependsOn: [linting] matrix: # Linux environment to test that scikit-learn can be built against - # versions of numpy, scipy with ATLAS that comes with Ubuntu Xenial 16.04 - # i.e. numpy 1.11 and scipy 0.17 - py35_ubuntu_atlas: + # versions of numpy, scipy with ATLAS that comes with Ubuntu Bionic 18.04 + # i.e. numpy 1.13.3 and scipy 0.19 + py36_ubuntu_atlas: DISTRIB: 'ubuntu' - PYTHON_VERSION: '3.5' + PYTHON_VERSION: '3.6' JOBLIB_VERSION: '*' # Linux environment to test the latest available dependencies and MKL. pylatest_pip_openblas_pandas: @@ -60,12 +60,12 @@ jobs: - template: build_tools/azure/posix-32.yml parameters: name: Linux32 - vmImage: ubuntu-16.04 + vmImage: ubuntu-18.04 dependsOn: [linting] matrix: py35_ubuntu_atlas_32bit: DISTRIB: 'ubuntu-32' - PYTHON_VERSION: '3.5' + PYTHON_VERSION: '3.6' JOBLIB_VERSION: '*' TEST_DOCSTRINGS: 'true' @@ -100,6 +100,6 @@ jobs: PYTEST_VERSION: '*' COVERAGE: 'true' CHECK_WARNINGS: 'true' - py35_pip_openblas_32bit: - PYTHON_VERSION: '3.5' + py36_pip_openblas_32bit: + PYTHON_VERSION: '3.6' PYTHON_ARCH: '32' diff --git a/build_tools/azure/install.sh b/build_tools/azure/install.sh index 3ece1d750..5b0b83a36 100755 --- a/build_tools/azure/install.sh +++ b/build_tools/azure/install.sh @@ -1,6 +1,7 @@ #!/bin/bash set -e +set -x UNAMESTR=`uname` @@ -70,14 +71,14 @@ if [[ "$DISTRIB" == "conda" ]]; then elif [[ "$DISTRIB" == "ubuntu" ]]; then sudo add-apt-repository --remove ppa:ubuntu-toolchain-r/test sudo apt-get update - sudo apt-get install python3-scipy libatlas3-base libatlas-base-dev libatlas-dev python3-virtualenv git + sudo apt-get install python3-scipy libatlas3-base libatlas-base-dev python3-virtualenv git python3 -m virtualenv --system-site-packages --python=python3 $VIRTUALENV source $VIRTUALENV/bin/activate python -m pip install pytest==$PYTEST_VERSION pytest-cov joblib cython python -m pip install git+https://github.com/scikit-learn/scikit-learn.git elif [[ "$DISTRIB" == "ubuntu-32" ]]; then apt-get update - apt-get install -y python3-dev python3-scipy libatlas3-base libatlas-base-dev libatlas-dev python3-virtualenv git + apt-get install -y python3-dev python3-scipy libatlas3-base libatlas-base-dev python3-virtualenv git python3 -m virtualenv --system-site-packages --python=python3 $VIRTUALENV source $VIRTUALENV/bin/activate python -m pip install pytest==$PYTEST_VERSION pytest-cov joblib cython diff --git a/build_tools/azure/posix-32.yml b/build_tools/azure/posix-32.yml index 68e05e347..b4c9e4ebb 100644 --- a/build_tools/azure/posix-32.yml +++ b/build_tools/azure/posix-32.yml @@ -40,7 +40,7 @@ jobs: -e OMP_NUM_THREADS=$OMP_NUM_THREADS -e OPENBLAS_NUM_THREADS=$OPENBLAS_NUM_THREADS -e SKLEARN_SKIP_NETWORK_TESTS=$SKLEARN_SKIP_NETWORK_TESTS - i386/ubuntu:16.04 + i386/ubuntu:18.04 sleep 1000000 displayName: 'Start container' - script: > diff --git a/doc/install.rst b/doc/install.rst index 3ae9c8b30..5e146d430 100644 --- a/doc/install.rst +++ b/doc/install.rst @@ -7,8 +7,9 @@ Prerequisites The imbalanced-learn package requires the following dependencies: -* numpy (>=1.11) -* scipy (>=0.17) +* python (>=3.6) +* numpy (>=1.13.3) +* scipy (>=0.19.1) * scikit-learn (>=0.22) * keras 2 (optional) * tensorflow (optional) @@ -16,7 +17,7 @@ The imbalanced-learn package requires the following dependencies: Install ======= -imbalanced-learn is currently available on the PyPi's reporitories and you can +imbalanced-learn is currently available on the PyPi's repositories and you can install it via `pip`:: pip install -U imbalanced-learn diff --git a/setup.py b/setup.py index b3cab4f09..c88e83d11 100755 --- a/setup.py +++ b/setup.py @@ -36,8 +36,8 @@ 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8'] INSTALL_REQUIRES = [ - 'numpy>=1.11', - 'scipy>=0.17', + 'numpy>=1.13.3', + 'scipy>=0.19.1', 'scikit-learn>=0.22', 'joblib>=0.11' ] From c1b2a20edca95c3888742ee4eb75011c85ba432f Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Sun, 16 Feb 2020 11:29:18 +0100 Subject: [PATCH 2/4] iter --- .travis.yml | 3 +-- azure-pipelines.yml | 2 +- build_tools/travis/install.sh | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 00b73b723..df32af08f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,8 +28,7 @@ env: matrix: include: - # This environment tests the using anaconda - # Ubuntu 14.04 environment + # Last LTS ubuntu version - env: DISTRIB="ubuntu" TEST_DOC="true" TEST_NUMPYDOC="false" # Latest release - env: DISTRIB="conda" PYTHON_VERSION="3.7" diff --git a/azure-pipelines.yml b/azure-pipelines.yml index cf3062e84..e84269032 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -63,7 +63,7 @@ jobs: vmImage: ubuntu-18.04 dependsOn: [linting] matrix: - py35_ubuntu_atlas_32bit: + py36_ubuntu_atlas_32bit: DISTRIB: 'ubuntu-32' PYTHON_VERSION: '3.6' JOBLIB_VERSION: '*' diff --git a/build_tools/travis/install.sh b/build_tools/travis/install.sh index a11a76ad2..f0e043f94 100755 --- a/build_tools/travis/install.sh +++ b/build_tools/travis/install.sh @@ -63,7 +63,7 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then virtualenv --system-site-packages --python=python3 testvenv source testvenv/bin/activate - pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn + pip3 install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn pip3 install pandas pip3 install pytest pytest-cov codecov sphinx numpydoc From c150d59d300cd53db45fafdf667649d99ab79dbc Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Sun, 16 Feb 2020 11:47:19 +0100 Subject: [PATCH 3/4] get nightly build from anaconda --- build_tools/travis/install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build_tools/travis/install.sh b/build_tools/travis/install.sh index f0e043f94..a764dc843 100755 --- a/build_tools/travis/install.sh +++ b/build_tools/travis/install.sh @@ -63,7 +63,7 @@ elif [[ "$DISTRIB" == "ubuntu" ]]; then virtualenv --system-site-packages --python=python3 testvenv source testvenv/bin/activate - pip3 install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn + pip3 install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn pip3 install pandas pip3 install pytest pytest-cov codecov sphinx numpydoc From 796353d177903497ef1874ae94fc607f8457e692 Mon Sep 17 00:00:00 2001 From: Guillaume Lemaitre Date: Sun, 16 Feb 2020 11:53:52 +0100 Subject: [PATCH 4/4] use nightly build on travis --- .travis.yml | 9 ++--- build_tools/travis/install.sh | 76 ++++++++++++++--------------------- 2 files changed, 34 insertions(+), 51 deletions(-) diff --git a/.travis.yml b/.travis.yml index df32af08f..6582c8b2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,16 +28,13 @@ env: matrix: include: - # Last LTS ubuntu version - - env: DISTRIB="ubuntu" TEST_DOC="true" TEST_NUMPYDOC="false" - # Latest release - - env: DISTRIB="conda" PYTHON_VERSION="3.7" + - env: PYTHON_VERSION="3.7" NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master" OPTIONAL_DEPS="keras" TEST_DOC="true" TEST_NUMPYDOC="false" - - env: DISTRIB="conda" PYTHON_VERSION="3.7" + - env: PYTHON_VERSION="3.7" NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master" OPTIONAL_DEPS="tensorflow" TEST_DOC="true" TEST_NUMPYDOC="false" - - env: DISTRIB="conda" PYTHON_VERSION="3.7" + - env: PYTHON_VERSION="3.7" NUMPY_VERSION="*" SCIPY_VERSION="*" SKLEARN_VERSION="master" OPTIONAL_DEPS="false" TEST_DOC="false" TEST_NUMPYDOC="true" diff --git a/build_tools/travis/install.sh b/build_tools/travis/install.sh index a764dc843..4a7a7c2c2 100755 --- a/build_tools/travis/install.sh +++ b/build_tools/travis/install.sh @@ -17,57 +17,43 @@ export CXX=/usr/lib/ccache/g++ # ~60M is used by .ccache when compiling from scratch at the time of writing ccache --max-size 100M --show-stats -if [[ "$DISTRIB" == "conda" ]]; then - # Deactivate the travis-provided virtual environment and setup a - # conda-based environment instead - deactivate +# Deactivate the travis-provided virtual environment and setup a +# conda-based environment instead +deactivate - # Install miniconda - wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - -O miniconda.sh - MINICONDA_PATH=/home/travis/miniconda - chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH - export PATH=$MINICONDA_PATH/bin:$PATH +# Install miniconda +wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh \ + -O miniconda.sh +MINICONDA_PATH=/home/travis/miniconda +chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH +export PATH=$MINICONDA_PATH/bin:$PATH - # Configure the conda environment and put it in the path using the - # provided versions - conda create -n testenv --yes python=$PYTHON_VERSION pip - source activate testenv - conda install --yes numpy=$NUMPY_VERSION scipy=$SCIPY_VERSION +# Configure the conda environment and put it in the path using the +# provided versions +conda create -n testenv --yes python=$PYTHON_VERSION pip +source activate testenv - if [[ "$OPTIONAL_DEPS" == "keras" ]]; then - conda install --yes pandas keras tensorflow=1 - KERAS_BACKEND=tensorflow - python -c "import keras.backend" - sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json; - elif [[ "$OPTIONAL_DEPS" == "tensorflow" ]]; then - conda install --yes pandas tensorflow - fi +pip install --upgrade pip setuptools +echo "Installing numpy and scipy master wheels" +dev_url=https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com +pip install --pre --upgrade --timeout=60 -f $dev_url numpy scipy pandas cython +echo "Installing joblib master" +pip install https://github.com/joblib/joblib/archive/master.zip - if [[ "$SKLEARN_VERSION" == "master" ]]; then - pip install --pre -f https://sklearn-nightly.scdn8.secure.raxcdn.com scikit-learn - else - conda install --yes scikit-learn=$SKLEARN_VERSION - fi - - conda install --yes pytest pytest-cov - pip install codecov - pip install -U git+https://github.com/numpy/numpydoc.git - -elif [[ "$DISTRIB" == "ubuntu" ]]; then - # At the time of writing numpy 1.9.1 is included in the travis - # virtualenv but we want to use the numpy installed through apt-get - # install. - deactivate - # Create a new virtualenv using system site packages for python, numpy - virtualenv --system-site-packages --python=python3 testvenv - source testvenv/bin/activate +if [[ "$OPTIONAL_DEPS" == "keras" ]]; then + conda install --yes keras tensorflow=1 + KERAS_BACKEND=tensorflow + python -c "import keras.backend" + sed -i -e 's/"backend":[[:space:]]*"[^"]*/"backend":\ "'$KERAS_BACKEND'/g' ~/.keras/keras.json; +elif [[ "$OPTIONAL_DEPS" == "tensorflow" ]]; then + conda install --yes tensorflow +fi - pip3 install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn - pip3 install pandas - pip3 install pytest pytest-cov codecov sphinx numpydoc +pip install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn -fi +conda install --yes pytest pytest-cov +pip install codecov +pip install -U git+https://github.com/numpy/numpydoc.git python --version python -c "import numpy; print('numpy %s' % numpy.__version__)"