Skip to content

Commit ffcf96f

Browse files
authored
Add Azure Pipelines setup (#55)
1 parent 1e75008 commit ffcf96f

File tree

6 files changed

+150
-124
lines changed

6 files changed

+150
-124
lines changed

.travis.yml

Lines changed: 0 additions & 48 deletions
This file was deleted.

appveyor.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

azure-pipelines.yml

Lines changed: 143 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,148 @@
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:
52

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'
855
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'
2156
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'
2777

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'
32106
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'

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ requires = [
44
"setuptools",
55
"wheel",
66
"cython>=0.28",
7-
"numpy==1.14.5; python_version=='3.5' and platform_system!='AIX'",
8-
"numpy==1.14.5; python_version=='3.6' and platform_system!='AIX'",
7+
"numpy==1.13.3; python_version=='3.5' and platform_system!='AIX'",
8+
"numpy==1.13.3; python_version=='3.6' and platform_system!='AIX'",
99
"numpy==1.14.5; python_version=='3.7' and platform_system!='AIX'",
1010
"numpy==1.17.3; python_version>='3.8' and platform_system!='AIX'",
1111
# Minimum supported numpy 1.16 for AIX
1212
# see https://github.com/scipy/scipy/pull/10431
13-
"numpy==1.16.0; python_version=='3.5' and platform_system!='AIX'",
13+
"numpy==1.16.0; python_version=='3.5' and platform_system=='AIX'",
1414
"numpy==1.16.0; python_version=='3.6' and platform_system=='AIX'",
1515
"numpy==1.16.0; python_version=='3.7' and platform_system=='AIX'",
1616
"numpy==1.17.3; python_version>='3.8' and platform_system=='AIX'",

requirements.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
cython
2-
numpy
3-
scipy
4-
scikit-learn
1+
numpy>=1.13.3
2+
scipy>=0.19.1
3+
scikit-learn>=0.20.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
LICENSE = "new BSD"
2727
DOWNLOAD_URL = "https://github.com/scikit-learn-contrib/scikit-learn-extra"
2828
VERSION = __version__ # noqa
29-
INSTALL_REQUIRES = ["cython", "numpy", "scipy", "scikit-learn"]
29+
INSTALL_REQUIRES = ["numpy>=1.13.3", "scipy>=0.19.1", "scikit-learn>=0.21.0"]
3030
CLASSIFIERS = [
3131
"Intended Audience :: Science/Research",
3232
"Intended Audience :: Developers",

0 commit comments

Comments
 (0)