2019-11-29 03:40:04 +03:00
|
|
|
|
version: 2.3.2.{build}
|
2017-09-08 13:17:00 +03:00
|
|
|
|
|
2018-09-12 05:40:11 +03:00
|
|
|
|
image: Visual Studio 2015
|
|
|
|
|
platform: x64
|
|
|
|
|
configuration: # a trick to construct a build matrix with multiple Python versions
|
2017-09-08 13:17:00 +03:00
|
|
|
|
- 3.6
|
2017-06-18 14:44:57 +03:00
|
|
|
|
|
|
|
|
|
environment:
|
|
|
|
|
matrix:
|
2018-09-12 05:40:11 +03:00
|
|
|
|
- COMPILER: MSVC
|
|
|
|
|
- COMPILER: MINGW
|
2017-06-18 14:44:57 +03:00
|
|
|
|
|
2019-10-22 02:21:05 +03:00
|
|
|
|
clone_depth: 5
|
2017-06-18 14:44:57 +03:00
|
|
|
|
|
2017-09-08 13:17:00 +03:00
|
|
|
|
install:
|
2017-09-10 03:27:48 +03:00
|
|
|
|
- git submodule update --init --recursive # get `compute` folder
|
2018-06-09 05:04:57 +03:00
|
|
|
|
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=% # delete sh.exe from PATH (mingw32-make fix)
|
2019-04-09 05:23:32 +03:00
|
|
|
|
- set PATH=C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;%PATH%
|
2017-09-08 13:17:00 +03:00
|
|
|
|
- set PYTHON_VERSION=%CONFIGURATION%
|
|
|
|
|
- ps: >-
|
|
|
|
|
switch ($env:PYTHON_VERSION) {
|
|
|
|
|
"2.7" {$env:MINICONDA = """C:\Miniconda-x64"""}
|
|
|
|
|
"3.5" {$env:MINICONDA = """C:\Miniconda35-x64"""}
|
|
|
|
|
"3.6" {$env:MINICONDA = """C:\Miniconda36-x64"""}
|
2018-10-04 04:26:32 +03:00
|
|
|
|
"3.7" {$env:MINICONDA = """C:\Miniconda37-x64"""}
|
|
|
|
|
default {$env:MINICONDA = """C:\Miniconda37-x64"""}
|
2017-09-08 13:17:00 +03:00
|
|
|
|
}
|
|
|
|
|
- set PATH=%MINICONDA%;%MINICONDA%\Scripts;%PATH%
|
|
|
|
|
- ps: $env:LGB_VER = (Get-Content VERSION.txt).trim()
|
2019-07-24 15:06:58 +03:00
|
|
|
|
- activate
|
2017-09-08 13:17:00 +03:00
|
|
|
|
- conda config --set always_yes yes --set changeps1 no
|
2019-07-24 15:06:58 +03:00
|
|
|
|
- conda update -q -y conda
|
2019-12-19 14:00:29 +03:00
|
|
|
|
- conda create -q -y -n test-env python=%PYTHON_VERSION% joblib matplotlib numpy pandas psutil pytest python-graphviz "scikit-learn<=0.21.3" scipy
|
2017-09-08 13:17:00 +03:00
|
|
|
|
- activate test-env
|
2017-06-18 14:44:57 +03:00
|
|
|
|
|
2017-06-18 15:37:31 +03:00
|
|
|
|
build_script:
|
2018-09-12 05:40:11 +03:00
|
|
|
|
- cd %APPVEYOR_BUILD_FOLDER%\python-package
|
2017-09-08 13:17:00 +03:00
|
|
|
|
- IF "%COMPILER%"=="MINGW" (
|
2018-09-12 05:40:11 +03:00
|
|
|
|
python setup.py install --mingw)
|
2017-09-08 13:17:00 +03:00
|
|
|
|
ELSE (
|
2018-09-12 05:40:11 +03:00
|
|
|
|
python setup.py install)
|
|
|
|
|
|
|
|
|
|
test_script:
|
2018-07-15 19:03:39 +03:00
|
|
|
|
- pytest %APPVEYOR_BUILD_FOLDER%\tests\python_package_test
|
|
|
|
|
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide
|
2018-06-09 05:04:57 +03:00
|
|
|
|
- ps: >-
|
2019-07-01 13:11:10 +03:00
|
|
|
|
@("import matplotlib", "matplotlib.use('Agg')") + (Get-Content "plot_example.py") | Set-Content "plot_example.py" # prevent interactive window mode
|
2018-09-12 05:40:11 +03:00
|
|
|
|
(Get-Content "plot_example.py").replace('graph.render(view=True)', 'graph.render(view=False)') | Set-Content "plot_example.py"
|
2018-06-09 05:04:57 +03:00
|
|
|
|
- ps: >-
|
|
|
|
|
foreach ($file in @(Get-ChildItem *.py)) {
|
2019-02-02 09:38:19 +03:00
|
|
|
|
@("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
|
2018-06-09 05:04:57 +03:00
|
|
|
|
python $file
|
2019-02-02 09:38:19 +03:00
|
|
|
|
if (!$?) { $host.SetShouldExit(-1) }
|
2018-06-09 05:04:57 +03:00
|
|
|
|
} # run all examples
|
2018-11-05 10:49:54 +03:00
|
|
|
|
- cd %APPVEYOR_BUILD_FOLDER%\examples\python-guide\notebooks
|
2019-10-06 04:56:10 +03:00
|
|
|
|
- conda install -q -y -n test-env ipywidgets notebook
|
2018-11-05 10:49:54 +03:00
|
|
|
|
- jupyter nbconvert --ExecutePreprocessor.timeout=180 --to notebook --execute --inplace *.ipynb # run all notebooks
|