Skip to content

Commit

Permalink
update setup.py (#58)
Browse files Browse the repository at this point in the history
Fix CI
  • Loading branch information
raulbocanegra committed Feb 23, 2020
1 parent 6f62781 commit 694ac01
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 28 deletions.
50 changes: 31 additions & 19 deletions .CI/travis/install-khiva.sh
Expand Up @@ -5,6 +5,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

function check-error() {
KHIVA_ERROR=$?
if [ $KHIVA_ERROR -ne 0 ]; then
echo "$1: $KHIVA_ERROR"
exit $KHIVA_ERROR
fi
}

if [[ "$INSTALL_KHIVA_METHOD" == "installer" ]]; then
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
if [ ! -e "./installers/khiva-v0.1.0.pkg" ]; then
Expand All @@ -22,38 +30,42 @@ if [[ "$INSTALL_KHIVA_METHOD" == "installer" ]]; then
fi

else
# GitHub method
# Install cmake in Linux, it is already installed in osx
cmake --version
#Installing conan and dependencies
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
# Check if the file already exists
if [ ! -e "${TRAVIS_BUILD_DIR}/cmakebin/cmake-3.13.2-Linux-x86_64.sh" ]; then
mkdir -p cmakebin
wget https://github.com/Kitware/CMake/releases/download/v3.13.2/cmake-3.13.2-Linux-x86_64.sh -O cmakebin/cmake-3.13.2-Linux-x86_64.sh
fi
# Install cmake
sudo bash cmakebin/cmake-3.13.2-Linux-x86_64.sh --prefix=./cmakebin/ --skip-license
pip install conan==1.22.2
else
pip${PYTHON_VERSION} install conan==1.22.2
fi

#Installing conan and dependencies
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
pip install conan
else
pip${PYTHON_VERSION} install conan==1.22.2
fi
conan remote add conan-mpusz https://api.bintray.com/conan/mpusz/conan-mpusz
if [ $? -ne 0 ]; then
conan remote update conan-mpusz https://api.bintray.com/conan/mpusz/conan-mpusz
fi

# Cloning Github repo into khiva-library folder
git clone https://github.com/shapelets/khiva.git khiva-library
cd khiva-library
git submodule update --init
mkdir -p build && cd build
conan profile new --detect --force default
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
conan install .. -s compiler=apple-clang -s compiler.version=9.1 -s compiler.libcxx=libc++ --build missing
conan profile update settings.compiler.libcxx=libc++ default
conan profile update settings.compiler=apple-clang default
conan profile update settings.compiler.version=9.1 default
conan install .. --build missing
cmake .. -DKHIVA_ONLY_CPU_BACKEND=ON -DKHIVA_BUILD_DOCUMENTATION=OFF -DKHIVA_BUILD_EXAMPLES=OFF -DKHIVA_BUILD_BENCHMARKS=OFF
make install -j8
check-error "Error generating CMake configuration"
make install -j8
check-error "Error building Khiva"
else
conan install .. -s compiler.libcxx=libstdc++11 --build missing
../../cmakebin/bin/cmake .. -DKHIVA_ENABLE_COVERAGE=ON -DKHIVA_BUILD_DOCUMENTATION=OFF -DKHIVA_BUILD_EXAMPLES=OFF -DKHIVA_BUILD_BENCHMARKS=OFF
conan profile update settings.compiler.libcxx=libstdc++11 default
conan profile update settings.compiler.version=7 default
conan install .. --build missing
cmake .. -DKHIVA_ENABLE_COVERAGE=ON -DKHIVA_BUILD_DOCUMENTATION=OFF -DKHIVA_BUILD_EXAMPLES=OFF -DKHIVA_BUILD_BENCHMARKS=OFF
check-error "Error generating CMake configuration"
sudo make install -j8
check-error "Error building Khiva"
sudo ldconfig
fi
# Switching back to the khiva-python folder
Expand Down
17 changes: 11 additions & 6 deletions .appveyor.yml
Expand Up @@ -7,15 +7,19 @@
image:
- Visual Studio 2017
environment:
global:
GENERATOR: "Visual Studio 15 2017 Win64"
BOOST_PATH: C:\Libraries\boost_1_69_0
AF_PATH: C:\Program Files\ArrayFire\v3
KHIVA_PATH: C:\Program Files\Khiva\v0
PATH: $(AF_PATH)\lib;$(KHIVA_PATH)\lib;$(PATH)
matrix:
- PYTHON: "C:\\Python36-x64;C:\\Python36-x64\\Scripts"
- PYTHON: "C:\\Python37-x64;C:\\Python37-x64\\Scripts"
- PYTHON: "C:\\Python38-x64;C:\\Python38-x64\\Scripts"
matrix:
- PYTHON: "C:\\Python36-x64;C:\\Python36-x64\\Scripts"
PATH: $(PYTHON);$(PATH)
- PYTHON: "C:\\Python37-x64;C:\\Python37-x64\\Scripts"
PATH: $(PYTHON);$(PATH)
- PYTHON: "C:\\Python38-x64;C:\\Python38-x64\\Scripts"
PATH: $(PYTHON);$(PATH)
cache:
- C:\tools\vcpkg\installed
- C:\Program Files\ArrayFire
Expand All @@ -25,7 +29,8 @@ platform:
- x64
before_build:
- ps: systeminfo
- ps: $env:PATH="$env:PYTHON;$env:PATH"
- ps: $env:PATH="$env:AF_PATH\lib;$env:KHIVA_PATH\lib;$env:PATH"
- cmd: set
- ps: python --version
- ps: python -m pip install --upgrade pip
- ps: if(!(Test-Path -Path "C:\Program Files\ArrayFire" )){ appveyor DownloadFile "http://arrayfire.s3.amazonaws.com/3.6.2/ArrayFire-v3.6.2.exe"};
Expand Down Expand Up @@ -55,7 +60,7 @@ test_script:
- coverage run -m unittest discover tests/unit_tests *_tests.py -f -v
- python -m xmlrunner discover tests/unit_tests *_tests.py
on_finish:
#- ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# - ps: $blockRdp = $true; iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
- codecov -F Windows -X gcov
- ps: |
$files = Get-ChildItem -Path . -File -Filter *.xml
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Expand Up @@ -10,7 +10,7 @@ matrix:
fast_finish: true
include:
- os: linux
dist: xenial
dist: bionic
sudo: required
python: "3.6"
cache:
Expand All @@ -21,7 +21,7 @@ matrix:
after_success:
- codecov -F Linux -X gcov
- os: linux
dist: xenial
dist: bionic
sudo: required
python: "3.5"
cache:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -21,7 +21,7 @@
author="Shapelets.io",
author_email="dev@shapelets.io",
name="khiva",
version='0.3.5',
version='0.5.0',
long_description = LONG_DESC,
description="Python bindings for khiva",
license="MPL 2.0",
Expand Down

0 comments on commit 694ac01

Please sign in to comment.