|
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 |
| 1 | +jobs: |
5 | 2 |
|
6 |
| -trigger: |
7 |
| -- master |
| 3 | +- job: 'linux' |
| 4 | + pool: |
| 5 | + vmImage: 'ubuntu-latest' |
| 6 | + strategy: |
| 7 | + matrix: |
| 8 | + Python36: |
| 9 | + python.version: '3.6' |
| 10 | + NUMPY_VERSION: "1.13.3" |
| 11 | + SCIPY_VERSION: "0.19.1" |
| 12 | + SKLEARN_VERSION: "0.21.2" |
| 13 | + Python37: |
| 14 | + python.version: '3.7' |
| 15 | + NUMPY_VERSION: "1.16.5" |
| 16 | + SCIPY_VERSION: "1.1.0" |
| 17 | + SKLEARN_VERSION: "0.22.2post1" |
| 18 | + Python38: |
| 19 | + python.version: '3.8' |
| 20 | + SKLEARN_VERSION: "nightly" |
| 21 | + variables: |
| 22 | + OMP_NUM_THREADS: '2' |
| 23 | + |
| 24 | + steps: |
| 25 | + - task: UsePythonVersion@0 |
| 26 | + inputs: |
| 27 | + versionSpec: '$(python.version)' |
| 28 | + displayName: 'Use Python $(python.version)' |
| 29 | + |
| 30 | + - script: | |
| 31 | + set -xe |
| 32 | + python --version |
| 33 | + python -m pip install --upgrade pip |
| 34 | + if [[ "$SKLEARN_VERSION" == "nightly" ]]; then |
| 35 | + # This also installs latest numpy, scipy and joblib. |
| 36 | + pip install --pre --extra-index https://pypi.anaconda.org/scipy-wheels-nightly/simple scikit-learn |
| 37 | + else |
| 38 | + python -m pip install numpy==$NUMPY_VERSION scipy==$SCIPY_VERSION scikit-learn==$SKLEARN_VERSION |
| 39 | + fi |
| 40 | + displayName: 'Install dependencies' |
| 41 | + |
| 42 | + - script: | |
| 43 | + set -xe |
| 44 | + pip install -e . |
| 45 | + displayName: 'Install scikit-learn-extra' |
| 46 | + |
| 47 | + - script: | |
| 48 | + set -xe |
| 49 | + python -m pip install pytest pytest-azurepipelines |
| 50 | + # run doctests in the documentation |
| 51 | + # TODO: remove "|| .." once at least one doctest is added |
| 52 | + python -m pytest doc/*rst doc/modules/*rst || echo "Ignoring exit status" |
| 53 | + python -m pytest --durations 10 sklearn_extra |
| 54 | + displayName: 'Test' |
8 | 55 |
|
9 |
| -pool: |
10 |
| - vmImage: 'ubuntu-latest' |
11 |
| -strategy: |
12 |
| - matrix: |
13 |
| - Python27: |
14 |
| - python.version: '2.7' |
15 |
| - Python35: |
16 |
| - python.version: '3.5' |
17 |
| - Python36: |
18 |
| - python.version: '3.6' |
19 |
| - Python37: |
20 |
| - python.version: '3.7' |
21 | 56 |
|
22 |
| -steps: |
23 |
| -- task: UsePythonVersion@0 |
24 |
| - inputs: |
25 |
| - versionSpec: '$(python.version)' |
26 |
| - displayName: 'Use Python $(python.version)' |
| 57 | +- job: 'macOS1014' |
| 58 | + pool: |
| 59 | + vmImage: 'macOS-10.14' |
| 60 | + strategy: |
| 61 | + matrix: |
| 62 | + Python36: |
| 63 | + python.version: '3.6' |
| 64 | + NUMPY_VERSION: "1.13.3" |
| 65 | + SCIPY_VERSION: "0.19.1" |
| 66 | + SKLEARN_VERSION: "0.21.2" |
| 67 | + Python37: |
| 68 | + python.version: '3.7' |
| 69 | + NUMPY_VERSION: "1.16.5" |
| 70 | + SCIPY_VERSION: "1.1.0" |
| 71 | + SKLEARN_VERSION: "0.22.2post1" |
| 72 | + Python38: |
| 73 | + python.version: '3.8' |
| 74 | + SKLEARN_VERSION: "*" |
| 75 | + variables: |
| 76 | + OMP_NUM_THREADS: '2' |
27 | 77 |
|
28 |
| -- script: | |
29 |
| - python -m pip install --upgrade pip |
30 |
| - pip install -r requirements.txt |
31 |
| - displayName: 'Install dependencies' |
| 78 | + steps: |
| 79 | + - task: UsePythonVersion@0 |
| 80 | + inputs: |
| 81 | + versionSpec: '$(python.version)' |
| 82 | + displayName: 'Use Python $(python.version)' |
| 83 | + |
| 84 | + - script: | |
| 85 | + set -xe |
| 86 | + python --version |
| 87 | + python -m pip install --upgrade pip |
| 88 | + if [[ "$SKLEARN_VERSION" == "*" ]]; then |
| 89 | + # Install latest versions of dependencies. |
| 90 | + python -m pip install scikit-learn |
| 91 | + else |
| 92 | + python -m pip install numpy==$NUMPY_VERSION scipy==$SCIPY_VERSION scikit-learn==$SKLEARN_VERSION |
| 93 | + fi |
| 94 | + displayName: 'Install dependencies' |
| 95 | + |
| 96 | + - script: | |
| 97 | + set -xe |
| 98 | + pip install -e . |
| 99 | + displayName: 'Install scikit-learn-extra' |
| 100 | + |
| 101 | + - script: | |
| 102 | + set -xe |
| 103 | + python -m pip install pytest pytest-azurepipelines pytest |
| 104 | + python -m pytest --durations 10 sklearn_extra |
| 105 | + displayName: 'Test' |
32 | 106 |
|
33 |
| -- script: | |
34 |
| - pip install pytest pytest-azurepipelines |
35 |
| - pytest |
36 |
| - displayName: 'pytest' |
| 107 | +
|
| 108 | +- job: 'win2016' |
| 109 | + pool: |
| 110 | + vmImage: 'vs2017-win2016' |
| 111 | + strategy: |
| 112 | + matrix: |
| 113 | + Python36: |
| 114 | + python_ver: '36' |
| 115 | + python.version: '3.6' |
| 116 | + NUMPY_VERSION: "1.13.3" |
| 117 | + SCIPY_VERSION: "1.0.1" |
| 118 | + SKLEARN_VERSION: "0.21.2" |
| 119 | + Python38: |
| 120 | + python_ver: '38' |
| 121 | + python.version: '3.8' |
| 122 | + NUMPY_VERSION: "1.18.2" |
| 123 | + SCIPY_VERSION: "1.4.1" |
| 124 | + SKLEARN_VERSION: "0.22.2post1" |
| 125 | + variables: |
| 126 | + OMP_NUM_THREADS: '2' |
| 127 | + |
| 128 | + steps: |
| 129 | + - task: UsePythonVersion@0 |
| 130 | + inputs: |
| 131 | + versionSpec: '$(python.version)' |
| 132 | + |
| 133 | + - script: | |
| 134 | + python --version |
| 135 | + python -m pip install --upgrade pip |
| 136 | + python -m pip install numpy==%NUMPY_VERSION% scipy==%SCIPY_VERSION% scikit-learn==%SKLEARN_VERSION% |
| 137 | + displayName: 'Install dependencies' |
| 138 | + |
| 139 | + - script: | |
| 140 | + pip wheel . -w dist\ |
| 141 | + pip install --pre --no-index --find-links dist\ scikit-learn-extra |
| 142 | + displayName: 'Install scikit-learn-extra' |
| 143 | + |
| 144 | + - script: | |
| 145 | + cd .. |
| 146 | + python -m pip install pytest pytest-azurepipelines |
| 147 | + python -m pytest --durations 10 --pyargs sklearn_extra |
| 148 | + displayName: 'Test' |
0 commit comments