1+ # Python package
2+ # Create and test a Python package on multiple Python versions.
3+ # Add steps that analyze code, save the dist with the build record, publish to a PyPI-compatible index, and more:
4+ # https://docs.microsoft.com/azure/devops/pipelines/languages/python
5+
6+ trigger :
7+ - master
8+
9+ jobs :
10+
11+ - job : ' Test'
12+ pool :
13+ vmImage : ' vs2017-win2016'
14+ strategy :
15+ matrix :
16+ # No python 2.x since no available ONNX package for Windows
17+ # Python27:
18+ # python.version: '2.7'
19+ Python35 :
20+ python.version : ' 3.5'
21+ ONNX_PATH : onnx==1.2.3
22+ KERAS : keras==2.1.6
23+ COREML_PATH : https://github.com/apple/coremltools/archive/v2.0.zip
24+
25+ Python36 :
26+ python.version : ' 3.6'
27+ ONNX_PATH : onnx
28+ KERAS : keras
29+ COREML_PATH : git+https://github.com/apple/coremltools
30+
31+ maxParallel : 3
32+
33+ steps :
34+ - task : CondaEnvironment@1
35+ inputs :
36+ createCustomEnvironment : true
37+ environmentName : ' py$(python.version)'
38+ packageSpecs : ' python=$(python.version)'
39+
40+ - script : |
41+ conda install -y -c conda-forge protobuf numpy
42+ python -m pip install --upgrade pip
43+ pip install %COREML_PATH% %ONNX_PATH% cntk==2.5.1
44+ pip install -r requirements-dev.txt"
45+ pip install %KERAS%
46+ install libsvm from github
47+ call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
48+ git clone --recursive https://github.com/cjlin1/libsvm libsvm
49+ cd libsvm
50+ nmake -f Makefile.win lib
51+ copy windows\*.dll python
52+ cd ..
53+ set PYTHONPATH=libsvm\python;%PYTHONPATH%
54+ dir libsvm\python
55+ python -c "import svmutil"
56+ displayName: 'Install dependencies'
57+
58+ - script : |
59+ pip install -e .
60+ pytest tests --doctest-modules --junitxml=junit/test-results.xml
61+ displayName: 'pytest'
62+
63+ - task : PublishTestResults@2
64+ inputs :
65+ testResultsFiles : ' **/test-results.xml'
66+ testRunTitle : ' Python $(python.version)'
67+ condition : succeededOrFailed()
0 commit comments