Skip to content

Commit f6ce3e7

Browse files
azure-pipelines[bot]TomAugspurger
authored andcommitted
Set up CI with Azure Pipelines (#22760)
1 parent d923385 commit f6ce3e7

15 files changed

+253
-188
lines changed

.travis.yml

-5
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,6 @@ matrix:
3030
exclude:
3131
# Exclude the default Python 3.5 build
3232
- python: 3.5
33-
include:
34-
- os: osx
35-
language: generic
36-
env:
37-
- JOB="3.5, OSX" ENV_FILE="ci/travis-35-osx.yaml" TEST_ARGS="--skip-slow --skip-network"
3833

3934
- dist: trusty
4035
env:

appveyor.yml

-91
This file was deleted.

azure-pipelines.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Adapted from https://github.com/numba/numba/blob/master/azure-pipelines.yml
2+
jobs:
3+
# Mac and Linux could potentially use the same template
4+
# except it isn't clear how to use a different build matrix
5+
# for each, so for now they are separate
6+
- template: ci/azure/macos.yml
7+
parameters:
8+
name: macOS
9+
vmImage: xcode9-macos10.13
10+
# - template: ci/azure/linux.yml
11+
# parameters:
12+
# name: Linux
13+
# vmImage: ubuntu-16.04
14+
15+
# Windows Python 2.7 needs VC 9.0 installed, and not sure
16+
# how to make that a conditional task, so for now these are
17+
# separate templates as well
18+
- template: ci/azure/windows.yml
19+
parameters:
20+
name: Windows
21+
vmImage: vs2017-win2017
22+
- template: ci/azure/windows-py27.yml
23+
parameters:
24+
name: WindowsPy27
25+
vmImage: vs2017-win2017
File renamed without changes.
File renamed without changes.
File renamed without changes.

ci/azure/macos.yml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py35_np_110:
13+
ENV_FILE: ci/azure-macos-35.yml
14+
CONDA_PY: "35"
15+
CONDA_ENV: pandas
16+
TEST_ARGS: "--skip-slow --skip-network"
17+
18+
steps:
19+
- script: |
20+
if [ "$(uname)" == "Linux" ]; then sudo apt-get install -y libc6-dev-i386; fi
21+
echo "Installing Miniconda"
22+
ci/incremental/install_miniconda.sh
23+
export PATH=$HOME/miniconda3/bin:$PATH
24+
echo "Setting up Conda environment"
25+
ci/incremental/setup_conda_environment.sh
26+
displayName: 'Before Install'
27+
- script: |
28+
export PATH=$HOME/miniconda3/bin:$PATH
29+
ci/incremental/build.sh
30+
displayName: 'Build'
31+
- script: |
32+
export PATH=$HOME/miniconda3/bin:$PATH
33+
ci/script_single.sh
34+
ci/script_multi.sh
35+
echo "[Test done]"
36+
displayName: 'Test'
37+
- script: |
38+
export PATH=$HOME/miniconda3/bin:$PATH
39+
source activate pandas && pushd /tmp && python -c "import pandas; pandas.show_versions();" && popd

ci/azure/windows-py27.yml

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py36_np14:
13+
ENV_FILE: ci/azure-windows-27.yml
14+
CONDA_PY: "27"
15+
CONDA_ENV: pandas
16+
17+
steps:
18+
- task: CondaEnvironment@1
19+
inputs:
20+
updateConda: no
21+
packageSpecs: ''
22+
23+
# Need to install VC 9.0 only for Python 2.7
24+
# Once we understand how to do tasks conditional on build matrix variables
25+
# we could merge this into azure-windows.yml
26+
- powershell: |
27+
$wc = New-Object net.webclient
28+
$wc.Downloadfile("https://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi", "VCForPython27.msi")
29+
Start-Process "VCForPython27.msi" /qn -Wait
30+
displayName: 'Install VC 9.0'
31+
32+
- script: |
33+
ci\\incremental\\setup_conda_environment.cmd
34+
displayName: 'Before Install'
35+
- script: |
36+
ci\\incremental\\build.cmd
37+
displayName: 'Build'
38+
- script: |
39+
call activate %CONDA_ENV%
40+
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
41+
displayName: 'Test'

ci/azure/windows.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
parameters:
2+
name: ''
3+
vmImage: ''
4+
5+
jobs:
6+
- job: ${{ parameters.name }}
7+
pool:
8+
vmImage: ${{ parameters.vmImage }}
9+
strategy:
10+
maxParallel: 11
11+
matrix:
12+
py36_np14:
13+
ENV_FILE: ci/azure-windows-36.yml
14+
CONDA_PY: "36"
15+
CONDA_ENV: pandas
16+
17+
steps:
18+
- task: CondaEnvironment@1
19+
inputs:
20+
updateConda: no
21+
packageSpecs: ''
22+
23+
- script: |
24+
ci\\incremental\\setup_conda_environment.cmd
25+
displayName: 'Before Install'
26+
- script: |
27+
ci\\incremental\\build.cmd
28+
displayName: 'Build'
29+
- script: |
30+
call activate %CONDA_ENV%
31+
pytest --skip-slow --skip-network pandas -n 2 -r sxX --strict %*
32+
displayName: 'Test'

ci/incremental/build.cmd

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/build.cmd
2+
call activate %CONDA_ENV%
3+
4+
@rem Build numba extensions without silencing compile errors
5+
python setup.py build_ext -q --inplace
6+
7+
@rem Install pandas locally
8+
python -m pip install -e .
9+
10+
if %errorlevel% neq 0 exit /b %errorlevel%

ci/incremental/build.sh

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
source activate $CONDA_ENV
4+
5+
# Make sure any error below is reported as such
6+
set -v -e
7+
8+
echo "[building extensions]"
9+
python setup.py build_ext -q --inplace
10+
python -m pip install -e .
11+
12+
echo
13+
echo "[show environment]"
14+
conda list
15+
16+
echo
17+
echo "[done]"
18+
exit 0

ci/incremental/install_miniconda.sh

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -v -e
4+
5+
# Install Miniconda
6+
unamestr=`uname`
7+
if [[ "$unamestr" == 'Linux' ]]; then
8+
if [[ "$BITS32" == "yes" ]]; then
9+
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86.sh -O miniconda.sh
10+
else
11+
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
12+
fi
13+
elif [[ "$unamestr" == 'Darwin' ]]; then
14+
wget -q https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
15+
else
16+
echo Error
17+
fi
18+
chmod +x miniconda.sh
19+
./miniconda.sh -b
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
@rem https://github.com/numba/numba/blob/master/buildscripts/incremental/setup_conda_environment.cmd
2+
@rem The cmd /C hack circumvents a regression where conda installs a conda.bat
3+
@rem script in non-root environments.
4+
set CONDA_INSTALL=cmd /C conda install -q -y
5+
set PIP_INSTALL=pip install -q
6+
7+
@echo on
8+
9+
@rem Deactivate any environment
10+
call deactivate
11+
@rem Display root environment (for debugging)
12+
conda list
13+
@rem Clean up any left-over from a previous build
14+
conda remove --all -q -y -n %CONDA_ENV%
15+
@rem Scipy, CFFI, jinja2 and IPython are optional dependencies, but exercised in the test suite
16+
conda env create -n %CONDA_ENV% --file=ci\azure-windows-%CONDA_PY%.yaml
17+
18+
call activate %CONDA_ENV%
19+
conda list
20+
21+
if %errorlevel% neq 0 exit /b %errorlevel%
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash
2+
3+
set -v -e
4+
5+
CONDA_INSTALL="conda install -q -y"
6+
PIP_INSTALL="pip install -q"
7+
8+
# Deactivate any environment
9+
source deactivate
10+
# Display root environment (for debugging)
11+
conda list
12+
# Clean up any left-over from a previous build
13+
# (note workaround for https://github.com/conda/conda/issues/2679:
14+
# `conda env remove` issue)
15+
conda remove --all -q -y -n $CONDA_ENV
16+
17+
echo
18+
echo "[create env]"
19+
time conda env create -q -n "${CONDA_ENV}" --file="${ENV_FILE}" || exit 1
20+
21+
# Activate first
22+
set +v
23+
source activate $CONDA_ENV
24+
set -v
25+
26+
# remove any installed pandas package
27+
# w/o removing anything else
28+
echo
29+
echo "[removing installed pandas]"
30+
conda remove pandas -y --force
31+
pip uninstall -y pandas
32+
33+
echo
34+
echo "[no installed pandas]"
35+
conda list pandas
36+
37+
# # Install the compiler toolchain
38+
# if [[ $(uname) == Linux ]]; then
39+
# if [[ "$CONDA_SUBDIR" == "linux-32" || "$BITS32" == "yes" ]] ; then
40+
# $CONDA_INSTALL gcc_linux-32 gxx_linux-32
41+
# else
42+
# $CONDA_INSTALL gcc_linux-64 gxx_linux-64
43+
# fi
44+
# elif [[ $(uname) == Darwin ]]; then
45+
# $CONDA_INSTALL clang_osx-64 clangxx_osx-64
46+
# # Install llvm-openmp and intel-openmp on OSX too
47+
# $CONDA_INSTALL llvm-openmp intel-openmp
48+
# fi

0 commit comments

Comments
 (0)