Skip to content

Commit 4d3c7eb

Browse files
Build on Azure pipelines and upload to anaconda.org (MacPython#74)
1 parent b6a4f08 commit 4d3c7eb

8 files changed

+474
-2
lines changed

.travis.yml .travis.yml.back

File renamed without changes.

appveyor.yml.back

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
environment:
2+
global:
3+
REPO_DIR: pandas
4+
PACKAGE_NAME: pandas
5+
BUILD_COMMIT: v1.0.0
6+
BUILDWHEEL: "True"
7+
BUILD_DEPENDS: "hdf5 numpy>=1.9.3 numexpr>=2.6.2 six cython bzip2"
8+
TEST_DEPENDS: "numpy>=1.9.3 numexpr>=2.6.2 six>=1.9.0 mock"
9+
DISABLE_AVX2: "True" # do not include AVX2 in this build
10+
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
11+
WHEELHOUSE_UPLOADER_SECRET:
12+
secure:
13+
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh
14+
15+
matrix:
16+
- PYTHON: "C:\\Miniconda35"
17+
PYTHON_VERSION: "3.5"
18+
PYTHON_ARCH: "32"
19+
- PYTHON: "C:\\Miniconda35-x64"
20+
PYTHON_VERSION: "3.5"
21+
PYTHON_ARCH: "64"
22+
- PYTHON: "C:\\Miniconda36"
23+
PYTHON_VERSION: "3.6"
24+
PYTHON_ARCH: "32"
25+
- PYTHON: "C:\\Miniconda36-x64"
26+
PYTHON_VERSION: "3.6"
27+
PYTHON_ARCH: "64"
28+
- PYTHON: "C:\\Miniconda37"
29+
PYTHON_VERSION: "3.7"
30+
PYTHON_ARCH: "32"
31+
- PYTHON: "C:\\Miniconda37-x64"
32+
PYTHON_VERSION: "3.7"
33+
PYTHON_ARCH: "64"
34+
35+
36+
# We always use a 64-bit machine, but can build x86 distributions
37+
# with the PYTHON_ARCH variable.
38+
platform:
39+
- x64
40+
41+
matrix:
42+
fast_finish: true
43+
44+
install:
45+
# Fetch submodules
46+
- git submodule update --init --recursive
47+
48+
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%
49+
- conda info
50+
51+
# Check that we have the expected version and architecture for Python
52+
- python --version
53+
- python -c "import struct; print(struct.calcsize('P') * 8)"
54+
55+
build_script:
56+
# Install build requirements
57+
- conda create --yes -n build_env python=%PYTHON_VERSION% %BUILD_DEPENDS%
58+
- activate build_env
59+
60+
# FIXME update Cython for python 3.5
61+
- pip install -U cython
62+
63+
# Additional pre install steps:
64+
- set BZIP2_DIR=%CONDA_PREFIX%\Library\
65+
66+
# build wheel:
67+
- cd %REPO_DIR%
68+
- git checkout %BUILD_COMMIT%
69+
- python setup.py bdist_wheel
70+
71+
test_script:
72+
# create test env
73+
- conda create --yes -n test_env python=%PYTHON_VERSION% %TEST_DEPENDS%
74+
- activate test_env
75+
76+
# install from wheel
77+
- pip install --no-index --find-links dist/ %PACKAGE_NAME%
78+
79+
- cd ..
80+
- python -m tables.tests.test_all
81+
82+
artifacts:
83+
- path: "%REPO_DIR%\\dist\\*"
84+
85+
on_success:
86+
# Upload the generated wheel package to Rackspace
87+
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
88+
# disable the ssl checks.
89+
- cd %REPO_DIR%
90+
- pip install wheelhouse-uploader
91+
- python -m wheelhouse_uploader upload
92+
--no-ssl-check --local-folder=dist --no-update-index wheels

azure-pipelines.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
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
9+
10+
jobs:
11+
- template: azure/windows.yml
12+
parameters:
13+
name: windows
14+
vmImage: vs2017-win2016
15+
matrix:
16+
py_3.6_32:
17+
PYTHON_VERSION: "3.6.x"
18+
PYTHON_ARCH: "x86"
19+
NP_BUILD_DEP: "1.13.3"
20+
py_3.6_64:
21+
PYTHON_VERSION: "3.6.x"
22+
NP_BUILD_DEP: "1.13.3"
23+
py_3.7_32:
24+
PYTHON_VERSION: "3.7.x"
25+
PYTHON_ARCH: "x86"
26+
NP_BUILD_DEP: "1.14.5"
27+
NIGHTLY_BUILD: "true"
28+
py_3.7_64:
29+
PYTHON_VERSION: "3.7.x"
30+
NP_BUILD_DEP: "1.14.5"
31+
NIGHTLY_BUILD: "true"
32+
py_3.8_32:
33+
PYTHON_VERSION: "3.8.x"
34+
PYTHON_ARCH: "x86"
35+
NP_BUILD_DEP: "1.17.3"
36+
NIGHTLY_BUILD: "true"
37+
py_3.8_64:
38+
PYTHON_VERSION: "3.8.x"
39+
NP_BUILD_DEP: "1.17.3"
40+
NIGHTLY_BUILD: "true"
41+
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+
NP_BUILD_DEP: "numpy==1.14.5"
56+
NIGHTLY_BUILD: "true"
57+
py_3.7_64:
58+
MB_PYTHON_VERSION: "3.7"
59+
NP_BUILD_DEP: "numpy==1.14.5"
60+
NIGHTLY_BUILD: "true"
61+
py_3.8_32:
62+
MB_PYTHON_VERSION: "3.8"
63+
PLAT: "i686"
64+
NP_BUILD_DEP: "numpy==1.17.3"
65+
NIGHTLY_BUILD: "true"
66+
py_3.8_64:
67+
MB_PYTHON_VERSION: "3.8"
68+
NP_BUILD_DEP: "numpy==1.17.3"
69+
NIGHTLY_BUILD: "true"
70+
71+
- template: azure/posix.yml
72+
parameters:
73+
name: macOS
74+
vmImage: macOS-10.14
75+
matrix:
76+
py_3.6_64:
77+
MB_PYTHON_VERSION: "3.6"
78+
NP_BUILD_DEP: "numpy==1.13.3"
79+
py_3.7_64:
80+
MB_PYTHON_VERSION: "3.7"
81+
NP_BUILD_DEP: "numpy==1.14.5"
82+
NIGHTLY_BUILD: "true"
83+
py_3.8_64:
84+
MB_PYTHON_VERSION: "3.8"
85+
NP_BUILD_DEP: "numpy==1.17.3"
86+
NIGHTLY_BUILD: "true"

azure/posix.yml

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

0 commit comments

Comments
 (0)