Commit 4d2aa840 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

Add Appveyor for windows CI (#634)

* add appveyor

* add nuget and artifacts

* Update appveyor.yml

* remove python27 test
parent 55bfafff
LightGBM, Light Gradient Boosting Machine LightGBM, Light Gradient Boosting Machine
========================================= =========================================
[![Build Status](https://travis-ci.org/Microsoft/LightGBM.svg?branch=master)](https://travis-ci.org/Microsoft/LightGBM) [![Build Status](https://travis-ci.org/Microsoft/LightGBM.svg?branch=master)](https://travis-ci.org/Microsoft/LightGBM)
[![Windows Build status](https://ci.appveyor.com/api/projects/status/1ys5ot401m0fep6l/branch/master?svg=true)](https://ci.appveyor.com/project/guolinke/lightgbm/branch/master)
[![Documentation Status](https://readthedocs.org/projects/lightgbm/badge/?version=latest)](http://lightgbm.readthedocs.io/) [![Documentation Status](https://readthedocs.org/projects/lightgbm/badge/?version=latest)](http://lightgbm.readthedocs.io/)
LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed and efficient with the following advantages: LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed and efficient with the following advantages:
......
version: 1.0.{build}
environment:
matrix:
- PYTHON: "C:/Python36-x64"
PYTHON_VERSION: 3.6
MINICONDA: "C:/Miniconda36-x64"
clone_depth: 50
init:
- "ECHO %PYTHON_VERSION% %MINICONDA%"
install:
- "set PATH=%MINICONDA%;%MINICONDA%/Scripts;%PATH%"
- conda config --set always_yes yes --set changeps1 no
- conda update -q conda
- conda info -a
- conda install --yes numpy scipy scikit-learn pandas matplotlib
- pip install pep8 pytest
build_script:
- mkdir build && cd build
- cmake -DCMAKE_GENERATOR_PLATFORM=x64 .. && cmake --build . --target ALL_BUILD --config Release
- cd ../python-package && python setup.py install && cd ..
- pytest tests/c_api_test/test.py
- pytest tests/python_package_test
- pep8 --ignore=E501 --exclude=./compute,./docs .
nuget:
project_feed: true
artifacts:
- path: Release/lib_lightgbm.dll
name: Library
...@@ -2,18 +2,41 @@ ...@@ -2,18 +2,41 @@
# pylint: skip-file # pylint: skip-file
import ctypes import ctypes
import os import os
import sys
import numpy as np import numpy as np
import pytest import pytest
from scipy import sparse from scipy import sparse
def LoadDll(): def find_lib_path():
if os.environ.get('LIGHTGBM_BUILD_DOC', False):
# we don't need lib_lightgbm while building docs
return []
curr_path = os.path.dirname(os.path.abspath(os.path.expanduser(__file__)))
dll_path = [curr_path, os.path.join(curr_path, '../../lib/'),
os.path.join(curr_path, '../../'),
os.path.join(curr_path, './lib/'),
os.path.join(sys.prefix, 'lightgbm')]
if os.name == 'nt': if os.name == 'nt':
lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../windows/x64/DLL/lib_lightgbm.dll') dll_path.append(os.path.join(curr_path, '../../Release/'))
dll_path.append(os.path.join(curr_path, '../../windows/x64/DLL/'))
dll_path = [os.path.join(p, 'lib_lightgbm.dll') for p in dll_path]
else: else:
lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../lib_lightgbm.so') dll_path = [os.path.join(p, 'lib_lightgbm.so') for p in dll_path]
lib = ctypes.cdll.LoadLibrary(lib_path) lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]
if not lib_path:
dll_path = [os.path.realpath(p) for p in dll_path]
raise Exception('Cannot find lightgbm Library in following paths: ' + ','.join(dll_path))
return lib_path
def LoadDll():
lib_path = find_lib_path()
if len(lib_path) == 0:
return None
lib = ctypes.cdll.LoadLibrary(lib_path[0])
return lib return lib
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment