1+ # https://docs.microsoft.com/azure/devops/pipelines/languages/python
2+
3+ trigger :
4+ - master
5+
6+
7+ jobs :
8+
9+ - job : ' Test_conda_linux'
10+
11+ pool :
12+ vmImage : ' ubuntu-16.04'
13+
14+ strategy :
15+ matrix :
16+ Python27 :
17+ python.version : ' 27'
18+ Python35 :
19+ python.version : ' 35'
20+ Python36 :
21+ python.version : ' 36'
22+ coverage : true
23+ Python37 :
24+ python.version : ' 37'
25+
26+ steps :
27+ - bash : echo "##vso[task.prependpath]/usr/share/miniconda/bin"
28+ displayName : Add conda to PATH
29+ - script : conda env create --quiet --file ci/requirements-py$(python.version).yml
30+ displayName : Create Anaconda environment
31+ - script : |
32+ source activate test_env
33+ pip install pytest-azurepipelines
34+ pip install -e .
35+ displayName: 'pip dependencies'
36+ - script : |
37+ source activate test_env
38+ conda list
39+ displayName: 'List installed dependencies'
40+ - script : |
41+ source activate test_env
42+ pytest pvlib --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
43+ displayName: 'pytest'
44+ # - script: |
45+ # source activate test_env
46+ # flake8 pvlib
47+ # displayName: 'flake8'
48+ - task : PublishTestResults@2
49+ inputs :
50+ testResultsFiles : ' **/test-results.xml'
51+ testRunTitle : ' Linux $(python.version)'
52+ - task : PublishCodeCoverageResults@1
53+ inputs :
54+ codeCoverageTool : Cobertura
55+ summaryFileLocation : ' $(System.DefaultWorkingDirectory)/**/coverage.xml'
56+ reportDirectory : ' $(System.DefaultWorkingDirectory)/**/htmlcov'
57+ condition : eq(variables['coverage'], true)
58+ - script : |
59+ bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
60+ displayName: 'codecov'
61+ condition: eq(variables['coverage'], true)
62+
63+
64+ - job : ' Test_conda_windows'
65+
66+ pool :
67+ vmImage : ' vs2017-win2016'
68+
69+ strategy :
70+ matrix :
71+ Python27-windows :
72+ python.version : ' 27'
73+ Python35-windows :
74+ python.version : ' 35'
75+ Python36-windows :
76+ python.version : ' 36'
77+ Python37-windows :
78+ python.version : ' 37'
79+
80+ steps :
81+ - powershell : Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
82+ displayName : Add conda to PATH
83+ - script : conda env create --quiet --file ci/requirements-py$(python.version).yml
84+ displayName : Create Anaconda environment
85+ - script : |
86+ call activate test_env
87+ pip install pytest-azurepipelines
88+ pip install -e .
89+ displayName: 'pip dependencies'
90+ - script : |
91+ call activate test_env
92+ conda list
93+ displayName: 'List installed dependencies'
94+ - script : |
95+ call activate test_env
96+ pytest pvlib --junitxml=junit/test-results.xml
97+ displayName: 'pytest'
98+ - task : PublishTestResults@2
99+ inputs :
100+ testResultsFiles : ' **/test-results.xml'
101+ testRunTitle : ' Windows $(python.version)'
102+
103+
104+ - job : ' Publish'
105+ dependsOn : ' Test_conda_linux'
106+ pool :
107+ vmImage : ' ubuntu-latest'
108+
109+ steps :
110+ - task : UsePythonVersion@0
111+ inputs :
112+ versionSpec : ' 3.x'
113+ architecture : ' x64'
114+
115+ - script : python setup.py sdist
116+ displayName : ' Build sdist'
0 commit comments