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
1
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
5
2
6
3
trigger :
7
4
- master
8
5
6
+
9
7
jobs :
10
8
11
- - job : ' Test_conda'
9
+ - job : ' Test_conda_linux'
10
+
12
11
pool :
13
- vmImage : ' ubuntu-latest'
12
+ vmImage : ' ubuntu-16.04'
13
+
14
14
strategy :
15
15
matrix :
16
16
Python27 :
@@ -19,21 +19,20 @@ jobs:
19
19
python.version : ' 35'
20
20
Python36 :
21
21
python.version : ' 36'
22
+ coverage : true
22
23
Python37 :
23
24
python.version : ' 37'
24
25
25
26
steps :
26
27
- bash : echo "##vso[task.prependpath]/usr/share/miniconda/bin"
27
28
displayName : Add conda to PATH
28
-
29
29
- script : conda env create --quiet --file ci/requirements-py$(python.version).yml
30
30
displayName : Create Anaconda environment
31
-
32
31
- script : |
33
32
source activate test_env
34
33
pip install pytest pytest-azurepipelines
34
+ pip install -e .
35
35
displayName: 'pip dependencies'
36
-
37
36
- script : |
38
37
source activate test_env
39
38
conda list
@@ -42,28 +41,68 @@ jobs:
42
41
source activate test_env
43
42
pytest pvlib --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
44
43
displayName: 'pytest'
45
- - script : |
46
- source activate test_env
47
- flake8 pvlib
48
- displayName: 'flake8'
44
+ # - script: |
45
+ # source activate test_env
46
+ # flake8 pvlib
47
+ # displayName: 'flake8'
49
48
- task : PublishTestResults@2
50
49
inputs :
51
50
testResultsFiles : ' **/test-results.xml'
52
- testRunTitle : ' Python $(python.version)'
53
-
51
+ testRunTitle : ' Linux $(python.version)'
54
52
- task : PublishCodeCoverageResults@1
55
53
inputs :
56
54
codeCoverageTool : Cobertura
57
55
summaryFileLocation : ' $(System.DefaultWorkingDirectory)/**/coverage.xml'
58
56
reportDirectory : ' $(System.DefaultWorkingDirectory)/**/htmlcov'
59
-
57
+ condition : eq(variables['coverage'], true)
60
58
- script : |
61
59
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
62
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 myEnvironment
87
+ pip install pytest pytest-azurepipelines pytest-mock
88
+ pip install -e .
89
+ displayName: 'pip dependencies'
90
+ - script : |
91
+ call activate myEnvironment
92
+ conda list
93
+ displayName: 'List installed dependencies'
94
+ - script : |
95
+ call activate myEnvironment
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)'
63
102
64
103
65
104
- job : ' Publish'
66
- dependsOn : ' Test_conda '
105
+ dependsOn : ' Test_conda_linux '
67
106
pool :
68
107
vmImage : ' ubuntu-latest'
69
108
0 commit comments