* add appveyor

* add nuget and artifacts

* Update appveyor.yml

* remove python27 test
This commit is contained in:
Guolin Ke 2017-06-18 19:44:57 +08:00 коммит произвёл GitHub
Родитель 55bfafffab
Коммит 4d2aa8403c
3 изменённых файлов: 62 добавлений и 4 удалений

Просмотреть файл

@ -1,6 +1,7 @@
LightGBM, Light Gradient Boosting Machine
=========================================
[![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/)
LightGBM is a gradient boosting framework that uses tree based learning algorithms. It is designed to be distributed and efficient with the following advantages:

34
appveyor.yml Normal file
Просмотреть файл

@ -0,0 +1,34 @@
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 @@
# pylint: skip-file
import ctypes
import os
import sys
import numpy as np
import pytest
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':
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:
lib_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../lib_lightgbm.so')
lib = ctypes.cdll.LoadLibrary(lib_path)
dll_path = [os.path.join(p, 'lib_lightgbm.so') for p in dll_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