Skip to content

Commit 2e1c245

Browse files
authored
azure pipelines config (#715)
* windows? * single matrix * fix build name * move windows into separate job. too many differences for one * hardcode pool * deps * no flake8, pip install pytest-mock * update conda * explicit windows pip install pytest-mock * limit coverage steps * try brackets * eq * no napoleon
1 parent 8fe314c commit 2e1c245

File tree

6 files changed

+64
-21
lines changed

6 files changed

+64
-21
lines changed

azure-pipelines.yml

Lines changed: 55 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
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:
41
# https://docs.microsoft.com/azure/devops/pipelines/languages/python
52

63
trigger:
74
- master
85

6+
97
jobs:
108

11-
- job: 'Test_conda'
9+
- job: 'Test_conda_linux'
10+
1211
pool:
13-
vmImage: 'ubuntu-latest'
12+
vmImage: 'ubuntu-16.04'
13+
1414
strategy:
1515
matrix:
1616
Python27:
@@ -19,21 +19,20 @@ jobs:
1919
python.version: '35'
2020
Python36:
2121
python.version: '36'
22+
coverage: true
2223
Python37:
2324
python.version: '37'
2425

2526
steps:
2627
- bash: echo "##vso[task.prependpath]/usr/share/miniconda/bin"
2728
displayName: Add conda to PATH
28-
2929
- script: conda env create --quiet --file ci/requirements-py$(python.version).yml
3030
displayName: Create Anaconda environment
31-
3231
- script: |
3332
source activate test_env
3433
pip install pytest pytest-azurepipelines
34+
pip install -e .
3535
displayName: 'pip dependencies'
36-
3736
- script: |
3837
source activate test_env
3938
conda list
@@ -42,28 +41,68 @@ jobs:
4241
source activate test_env
4342
pytest pvlib --junitxml=junit/test-results.xml --cov --cov-report=xml --cov-report=html
4443
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'
4948
- task: PublishTestResults@2
5049
inputs:
5150
testResultsFiles: '**/test-results.xml'
52-
testRunTitle: 'Python $(python.version)'
53-
51+
testRunTitle: 'Linux $(python.version)'
5452
- task: PublishCodeCoverageResults@1
5553
inputs:
5654
codeCoverageTool: Cobertura
5755
summaryFileLocation: '$(System.DefaultWorkingDirectory)/**/coverage.xml'
5856
reportDirectory: '$(System.DefaultWorkingDirectory)/**/htmlcov'
59-
57+
condition: eq(variables['coverage'], true)
6058
- script: |
6159
bash <(curl https://codecov.io/bash) -t bbc2bdbe-5e67-4fef-9cb7-f52fe0b703a8 -f coverage.xml -F adder -F subtractor -F conda
6260
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)'
63102

64103

65104
- job: 'Publish'
66-
dependsOn: 'Test_conda'
105+
dependsOn: 'Test_conda_linux'
67106
pool:
68107
vmImage: 'ubuntu-latest'
69108

ci/requirements-py27.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ dependencies:
1414
- siphon
1515
- pytest
1616
- pytest-cov
17-
- pytest-mock
1817
- nose
18+
- shapely # pvfactors dependency
1919
- pip:
2020
- coveralls
21+
- pytest-mock
2122
- pytest-timeout
2223
- pvfactors==0.1.5

ci/requirements-py34.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ dependencies:
1414
- siphon
1515
- pytest
1616
- pytest-cov
17-
- pytest-mock
1817
- nose
1918
- pip:
2019
- coveralls
20+
- pytest-mock
2121
- pytest-timeout

ci/requirements-py35.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ dependencies:
1414
- siphon
1515
- pytest
1616
- pytest-cov
17-
- pytest-mock
1817
- nose
18+
- shapely # pvfactors dependency
1919
- pip:
2020
- coveralls
21+
- pytest-mock
2122
- pytest-timeout
2223
- pvfactors==0.1.5

ci/requirements-py36.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ dependencies:
1414
- siphon
1515
- pytest
1616
- pytest-cov
17-
- pytest-mock
1817
- nose
18+
- shapely # pvfactors dependency
1919
- pip:
2020
- coveralls
21+
- pytest-mock
2122
- pvfactors==0.1.5

ci/requirements-py37.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@ dependencies:
1414
# - siphon
1515
- pytest
1616
- pytest-cov
17-
- pytest-mock
1817
- nose
18+
- shapely # pvfactors dependency
1919
- pip:
2020
- coveralls
21+
- pytest-mock
2122
- pvfactors==0.1.5

0 commit comments

Comments
 (0)