forked from microsoft/LightGBM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.appveyor.yml
57 lines (51 loc) · 2.49 KB
/
.appveyor.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
version: 2.2.4.{build}
image: Visual Studio 2015
platform: x64
configuration: # a trick to construct a build matrix with multiple Python versions
- 3.6
environment:
matrix:
- COMPILER: MSVC
- COMPILER: MINGW
clone_depth: 50
install:
- git submodule update --init --recursive # get `compute` folder
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix)
- set PATH=C:\mingw-w64\x86_64-7.3.0-posix-seh-rt_v5-rev0\mingw64\bin;%PATH%
- set PYTHON_VERSION=%CONFIGURATION%
- ps: >-
switch ($env:PYTHON_VERSION) {
"2.7" {$env:MINICONDA = """C:\Miniconda-x64"""}
"3.4" {$env:MINICONDA = """C:\Miniconda34-x64"""}
"3.5" {$env:MINICONDA = """C:\Miniconda35-x64"""}
"3.6" {$env:MINICONDA = """C:\Miniconda36-x64"""}
"3.7" {$env:MINICONDA = """C:\Miniconda37-x64"""}
default {$env:MINICONDA = """C:\Miniconda37-x64"""}
}
- set PATH=%MINICONDA%;%MINICONDA%\Scripts;%PATH%
- ps: $env:LGB_VER = (Get-Content VERSION.txt).trim()
- conda config --set always_yes yes --set changeps1 no
- conda update -q -y conda
- conda create -q -y -n test-env python=%PYTHON_VERSION% matplotlib nose numpy pandas psutil pytest python-graphviz scikit-learn scipy
- activate test-env
build_script:
- cd %APPVEYOR_BUILD_FOLDER%\python-package
- IF "%COMPILER%"=="MINGW" (
python setup.py install --mingw)
ELSE (
python setup.py install)
test_script:
- pytest %APPVEYOR_BUILD_FOLDER%\tests\python_package_test
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide
- ps: >-
@("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py" # prevent interactive window mode
(Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py"
- ps: >-
foreach ($file in @(Get-ChildItem *.py)) {
@("import sys, warnings", "warnings.showwarning = lambda message, category, filename, lineno, file=None, line=None: sys.stdout.write(warnings.formatwarning(message, category, filename, lineno, line))") + (Get-Content $file) | Set-Content $file
python $file
if (!$?) { $host.SetShouldExit(-1) }
} # run all examples
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide\notebooks
- conda install -q -y -n test-env ipywidgets notebook
- jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb # run all notebooks