Skip to content
This repository was archived by the owner on Aug 30, 2024. It is now read-only.

Commit 8c3c8cd

Browse files
committed
copy and edit pandas azure setup
1 parent 73290e0 commit 8c3c8cd

File tree

6 files changed

+324
-14
lines changed

6 files changed

+324
-14
lines changed
File renamed without changes.
File renamed without changes.

azure-pipelines.yml

+73-13
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,79 @@
1-
# Starter pipeline
2-
# Start with a minimal pipeline that you can customize to build and deploy your code.
3-
# Add steps that build, run tests, deploy, and more:
4-
# https://aka.ms/yaml
1+
schedules:
2+
- cron: "27 3 */1 * *"
3+
# 3:27am UTC everyday
4+
displayName: Nighthly build
5+
branches:
6+
include:
7+
- master
8+
always: true
59

610
trigger:
711
- master
812

9-
pool:
10-
vmImage: 'ubuntu-latest'
13+
pr:
14+
- master
1115

12-
steps:
13-
- script: echo Hello, world!
14-
displayName: 'Run a one-line script'
16+
jobs:
17+
- template: azure/windows.yml
18+
parameters:
19+
name: windows
20+
vmImage: vs2017-win2016
21+
matrix:
22+
py_3.6_32:
23+
PYTHON_VERSION: "3.6.x"
24+
PYTHON_ARCH: "x86"
25+
py_3.6_64:
26+
PYTHON_VERSION: "3.6.x"
27+
py_3.7_32:
28+
PYTHON_VERSION: "3.7.x"
29+
PYTHON_ARCH: "x86"
30+
NIGHTLY_BUILD: "true"
31+
py_3.7_64:
32+
PYTHON_VERSION: "3.7.x"
33+
NIGHTLY_BUILD: "true"
34+
py_3.8_32:
35+
PYTHON_VERSION: "3.8.x"
36+
PYTHON_ARCH: "x86"
37+
NIGHTLY_BUILD: "true"
38+
py_3.8_64:
39+
PYTHON_VERSION: "3.8.x"
40+
NIGHTLY_BUILD: "true"
1541

16-
- script: |
17-
echo Add other tasks to build, test, and deploy your project.
18-
echo See https://aka.ms/yaml
19-
displayName: 'Run a multi-line script'
42+
- template: azure/posix.yml
43+
parameters:
44+
name: linux
45+
vmImage: ubuntu-16.04
46+
matrix:
47+
py_3.6_32:
48+
MB_PYTHON_VERSION: "3.6"
49+
PLAT: "i686"
50+
py_3.6_64:
51+
MB_PYTHON_VERSION: "3.6"
52+
py_3.7_32:
53+
MB_PYTHON_VERSION: "3.7"
54+
PLAT: "i686"
55+
NIGHTLY_BUILD: "true"
56+
py_3.7_64:
57+
MB_PYTHON_VERSION: "3.7"
58+
NIGHTLY_BUILD: "true"
59+
py_3.8_32:
60+
MB_PYTHON_VERSION: "3.8"
61+
PLAT: "i686"
62+
NIGHTLY_BUILD: "true"
63+
py_3.8_64:
64+
MB_PYTHON_VERSION: "3.8"
65+
NIGHTLY_BUILD: "true"
66+
67+
- template: azure/posix.yml
68+
parameters:
69+
name: macOS
70+
vmImage: macOS-10.14
71+
matrix:
72+
py_3.6_64:
73+
MB_PYTHON_VERSION: "3.6"
74+
py_3.7_64:
75+
MB_PYTHON_VERSION: "3.7"
76+
NIGHTLY_BUILD: "true"
77+
py_3.8_64:
78+
MB_PYTHON_VERSION: "3.8"
79+
NIGHTLY_BUILD: "true"

azure/posix.yml

+128
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
parameters:
2+
name: ""
3+
vmImage: ""
4+
matrix: []
5+
6+
jobs:
7+
- job: ${{ parameters.name }}
8+
pool:
9+
vmImage: ${{ parameters.vmImage }}
10+
variables:
11+
REPO_DIR: "numpy"
12+
BUILD_COMMIT: "v1.18.2"
13+
PLAT: "x86_64"
14+
CYTHON_BUILD_DEP: "cython==0.29.16"
15+
NIGHTLY_BUILD_COMMIT: "master"
16+
NIGHTLY_BUILD: "false"
17+
TEST_DEPENDS: "pytest hypothesis cffi pytz"
18+
JUNITXML: "test-data.xml"
19+
TEST_DIR: "tmp_for_test"
20+
strategy:
21+
matrix:
22+
${{ insert }}: ${{ parameters.matrix }}
23+
24+
steps:
25+
- checkout: self
26+
submodules: true
27+
28+
- task: UsePythonVersion@0
29+
inputs:
30+
versionSpec: $(MB_PYTHON_VERSION)
31+
displayName: Set python version
32+
33+
- bash: |
34+
set -e
35+
36+
SKIP_BUILD="false"
37+
if [ "$BUILD_REASON" == "Schedule" ]; then
38+
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
39+
if [ "$NIGHTLY_BUILD" != "true" ]; then
40+
SKIP_BUILD="true"
41+
fi
42+
fi
43+
echo "Building numpy@$BUILD_COMMIT"
44+
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
45+
echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
46+
47+
# Platform variables used in multibuild scripts
48+
if [ `uname` == 'Darwin' ]; then
49+
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]osx"
50+
echo "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET]10.9"
51+
else
52+
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]linux"
53+
fi
54+
55+
# Store original Python path to be able to create test_venv pointing
56+
# to same Python version.
57+
PYTHON_EXE=`which python`
58+
echo "##vso[task.setvariable variable=PYTHON_EXE]$PYTHON_EXE"
59+
displayName: Define build env variables
60+
61+
- bash: |
62+
set -e
63+
pip install virtualenv wheel
64+
BUILD_DEPENDS="$CYTHON_BUILD_DEP"
65+
66+
source multibuild/common_utils.sh
67+
source multibuild/travis_steps.sh
68+
source extra_functions.sh
69+
70+
# Setup build dependencies
71+
before_install
72+
73+
clean_code $REPO_DIR $BUILD_COMMIT
74+
build_wheel $REPO_DIR $PLAT
75+
displayName: Build wheel
76+
condition: eq(variables['SKIP_BUILD'], 'false')
77+
78+
- bash: |
79+
set -xe
80+
source multibuild/common_utils.sh
81+
source multibuild/travis_steps.sh
82+
source extra_functions.sh
83+
setup_test_venv
84+
install_run $PLAT
85+
teardown_test_venv
86+
displayName: Install wheel and test
87+
condition: eq(variables['SKIP_BUILD'], 'false')
88+
89+
- bash: |
90+
echo "##vso[task.prependpath]$CONDA/bin"
91+
sudo chown -R $USER $CONDA
92+
displayName: Add conda to PATH
93+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
94+
95+
- bash: conda install -q -y anaconda-client
96+
displayName: Install anaconda-client
97+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
98+
99+
- bash: |
100+
set -e
101+
if [ "$BUILD_REASON" == "Schedule" ]; then
102+
ANACONDA_ORG="scipy-wheels-nightly"
103+
TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN"
104+
else
105+
ANACONDA_ORG="multibuild-wheels-staging"
106+
TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN"
107+
fi
108+
if [ "$TOKEN" == "" ]; then
109+
echo "##[warning] Could not find anaconda.org upload token in secret variables"
110+
fi
111+
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
112+
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
113+
displayName: Retrieve secret upload token
114+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
115+
env:
116+
# Secret variables need to mapped to env variables explicitly:
117+
NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
118+
NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
119+
120+
- bash: |
121+
set -e
122+
# The --force option forces a replacement if the remote file already
123+
# exists.
124+
ls wheelhouse/*.whl
125+
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
126+
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
127+
displayName: Upload to anaconda.org (only if secret token is retrieved)
128+
condition: ne(variables['TOKEN'], '')

azure/windows.yml

+122
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
parameters:
2+
name: ""
3+
vmImage: ""
4+
matrix: []
5+
6+
jobs:
7+
- job: ${{ parameters.name }}
8+
pool:
9+
vmImage: ${{ parameters.vmImage }}
10+
variables:
11+
BUILD_COMMIT: "v1.18.2"
12+
NIGHTLY_BUILD_COMMIT: "master"
13+
NIGHTLY_BUILD: "false"
14+
PYTHON_ARCH: "x64"
15+
JUNITXML: "test-data.xml"
16+
TEST_DIR: '$(Agent.WorkFolder)/tmp_for_test'
17+
strategy:
18+
matrix:
19+
${{ insert }}: ${{ parameters.matrix }}
20+
steps:
21+
- checkout: self
22+
submodules: true
23+
24+
- task: UsePythonVersion@0
25+
inputs:
26+
versionSpec: $(PYTHON_VERSION)
27+
architecture: $(PYTHON_ARCH)
28+
displayName: Set python version
29+
30+
- bash: |
31+
set -e
32+
echo PYTHON $PYTHON_VERSION $PYTHON_ARCH
33+
echo Build Reason: $BUILD_REASON
34+
python --version
35+
python -c "import struct; print(struct.calcsize('P') * 8)"
36+
pip --version
37+
displayName: Check that we have the expected version and architecture for Python
38+
- bash: |
39+
set -e
40+
SKIP_BUILD="false"
41+
if [ "$BUILD_REASON" == "Schedule" ]; then
42+
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
43+
if [ "$NIGHTLY_BUILD" != "true" ]; then
44+
SKIP_BUILD="true"
45+
fi
46+
fi
47+
echo "Building numpy@$BUILD_COMMIT"
48+
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
49+
echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"
50+
# Store original Python path to be able to create test_venv pointing
51+
# to same Python version.
52+
PYTHON_EXE=`which python`
53+
echo "##vso[task.setvariable variable=PYTHON_EXE]$PYTHON_EXE"
54+
displayName: Define build env variables
55+
- bash: |
56+
set -e
57+
cd numpy
58+
git checkout $BUILD_COMMIT
59+
git clean -fxd
60+
git reset --hard
61+
displayName: Checkout numpy commit
62+
condition: eq(variables['SKIP_BUILD'], 'false')
63+
- bash: |
64+
set -e
65+
pip install --timeout=60 -r test_requirements.txt
66+
pip install twine wheel
67+
pushd numpy
68+
python setup.py build
69+
python setup.py bdist_wheel
70+
ls dist
71+
twine check dist/*
72+
popd
73+
displayName: Build wheel
74+
condition: eq(variables['SKIP_BUILD'], 'false')
75+
- bash: |
76+
set -e
77+
source extra_functions.sh
78+
source config.sh
79+
setup_test_venv
80+
pip install numpy/dist/numpy-*.whl
81+
python run_tests.py -mfull
82+
teardown_test_venv
83+
displayName: Install wheel and test
84+
condition: eq(variables['SKIP_BUILD'], 'false')
85+
86+
- bash: echo "##vso[task.prependpath]$CONDA/Scripts"
87+
displayName: Add conda to PATH
88+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
89+
90+
- bash: conda install -q -y anaconda-client
91+
displayName: Install anaconda-client
92+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
93+
94+
- bash: |
95+
set -e
96+
if [ "$BUILD_REASON" == "Schedule" ]; then
97+
ANACONDA_ORG="scipy-wheels-nightly"
98+
TOKEN="$NUMPY_NIGHTLY_UPLOAD_TOKEN"
99+
else
100+
ANACONDA_ORG="multibuild-wheels-staging"
101+
TOKEN="$NUMPY_STAGING_UPLOAD_TOKEN"
102+
fi
103+
if [ "$TOKEN" == "" ]; then
104+
echo "##[warning] Could not find anaconda.org upload token in secret variables"
105+
fi
106+
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
107+
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
108+
displayName: Retrieve secret upload token
109+
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
110+
env:
111+
# Secret variables need to mapped to env variables explicitly:
112+
NUMPY_NIGHTLY_UPLOAD_TOKEN: $(NUMPY_NIGHTLY_UPLOAD_TOKEN)
113+
NUMPY_STAGING_UPLOAD_TOKEN: $(NUMPY_STAGING_UPLOAD_TOKEN)
114+
- bash: |
115+
set -e
116+
# The --force option forces a replacement if the remote file already
117+
# exists.
118+
ls numpy/dist/numpy-*.whl
119+
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG numpy/dist/numpy-*.whl
120+
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
121+
displayName: Upload to anaconda.org (only if secret token is retrieved)
122+
condition: ne(variables['TOKEN'], '')

0 commit comments

Comments
 (0)