Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Build on Azure pipelines and upload to anaconda.org #74

Merged
merged 21 commits into from
Mar 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
92 changes: 92 additions & 0 deletions appveyor.yml.back
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
environment:
global:
REPO_DIR: pandas
PACKAGE_NAME: pandas
BUILD_COMMIT: v1.0.0
BUILDWHEEL: "True"
BUILD_DEPENDS: "hdf5 numpy>=1.9.3 numexpr>=2.6.2 six cython bzip2"
TEST_DEPENDS: "numpy>=1.9.3 numexpr>=2.6.2 six>=1.9.0 mock"
DISABLE_AVX2: "True" # do not include AVX2 in this build
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
WHEELHOUSE_UPLOADER_SECRET:
secure:
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh

matrix:
- PYTHON: "C:\\Miniconda35"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda35-x64"
PYTHON_VERSION: "3.5"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Miniconda36"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda36-x64"
PYTHON_VERSION: "3.6"
PYTHON_ARCH: "64"
- PYTHON: "C:\\Miniconda37"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "32"
- PYTHON: "C:\\Miniconda37-x64"
PYTHON_VERSION: "3.7"
PYTHON_ARCH: "64"


# We always use a 64-bit machine, but can build x86 distributions
# with the PYTHON_ARCH variable.
platform:
- x64

matrix:
fast_finish: true

install:
# Fetch submodules
- git submodule update --init --recursive

- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PYTHON%\Library\bin;%PATH%
- conda info

# Check that we have the expected version and architecture for Python
- python --version
- python -c "import struct; print(struct.calcsize('P') * 8)"

build_script:
# Install build requirements
- conda create --yes -n build_env python=%PYTHON_VERSION% %BUILD_DEPENDS%
- activate build_env

# FIXME update Cython for python 3.5
- pip install -U cython

# Additional pre install steps:
- set BZIP2_DIR=%CONDA_PREFIX%\Library\

# build wheel:
- cd %REPO_DIR%
- git checkout %BUILD_COMMIT%
- python setup.py bdist_wheel

test_script:
# create test env
- conda create --yes -n test_env python=%PYTHON_VERSION% %TEST_DEPENDS%
- activate test_env

# install from wheel
- pip install --no-index --find-links dist/ %PACKAGE_NAME%

- cd ..
- python -m tables.tests.test_all

artifacts:
- path: "%REPO_DIR%\\dist\\*"

on_success:
# Upload the generated wheel package to Rackspace
# On Windows, Apache Libcloud cannot find a standard CA cert bundle so we
# disable the ssl checks.
- cd %REPO_DIR%
- pip install wheelhouse-uploader
- python -m wheelhouse_uploader upload
--no-ssl-check --local-folder=dist --no-update-index wheels
86 changes: 86 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
schedules:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think can temporarily remove this block to have it run on a pull request

- cron: "27 3 */1 * *"
# 3:27am UTC everyday
displayName: Nighthly build
branches:
include:
- master
always: true

jobs:
- template: azure/windows.yml
parameters:
name: windows
vmImage: vs2017-win2016
matrix:
py_3.6_32:
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: "x86"
NP_BUILD_DEP: "1.13.3"
py_3.6_64:
PYTHON_VERSION: "3.6.x"
NP_BUILD_DEP: "1.13.3"
py_3.7_32:
PYTHON_VERSION: "3.7.x"
PYTHON_ARCH: "x86"
NP_BUILD_DEP: "1.14.5"
NIGHTLY_BUILD: "true"
py_3.7_64:
PYTHON_VERSION: "3.7.x"
NP_BUILD_DEP: "1.14.5"
NIGHTLY_BUILD: "true"
py_3.8_32:
PYTHON_VERSION: "3.8.x"
PYTHON_ARCH: "x86"
NP_BUILD_DEP: "1.17.3"
NIGHTLY_BUILD: "true"
py_3.8_64:
PYTHON_VERSION: "3.8.x"
NP_BUILD_DEP: "1.17.3"
NIGHTLY_BUILD: "true"

- template: azure/posix.yml
parameters:
name: linux
vmImage: ubuntu-16.04
matrix:
py_3.6_32:
MB_PYTHON_VERSION: "3.6"
PLAT: "i686"
py_3.6_64:
MB_PYTHON_VERSION: "3.6"
py_3.7_32:
MB_PYTHON_VERSION: "3.7"
PLAT: "i686"
NP_BUILD_DEP: "numpy==1.14.5"
NIGHTLY_BUILD: "true"
py_3.7_64:
MB_PYTHON_VERSION: "3.7"
NP_BUILD_DEP: "numpy==1.14.5"
NIGHTLY_BUILD: "true"
py_3.8_32:
MB_PYTHON_VERSION: "3.8"
PLAT: "i686"
NP_BUILD_DEP: "numpy==1.17.3"
NIGHTLY_BUILD: "true"
py_3.8_64:
MB_PYTHON_VERSION: "3.8"
NP_BUILD_DEP: "numpy==1.17.3"
NIGHTLY_BUILD: "true"

- template: azure/posix.yml
parameters:
name: macOS
vmImage: macOS-10.14
matrix:
py_3.6_64:
MB_PYTHON_VERSION: "3.6"
NP_BUILD_DEP: "numpy==1.13.3"
py_3.7_64:
MB_PYTHON_VERSION: "3.7"
NP_BUILD_DEP: "numpy==1.14.5"
NIGHTLY_BUILD: "true"
py_3.8_64:
MB_PYTHON_VERSION: "3.8"
NP_BUILD_DEP: "numpy==1.17.3"
NIGHTLY_BUILD: "true"
129 changes: 129 additions & 0 deletions azure/posix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
parameters:
name: ""
vmImage: ""
matrix: []

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
variables:
REPO_DIR: "pandas"
BUILD_COMMIT: "v1.0.2"
PLAT: "x86_64"
NP_BUILD_DEP: "numpy==1.13.3"
CYTHON_BUILD_DEP: "cython==0.29.13"
NIGHTLY_BUILD_COMMIT: "master"
NIGHTLY_BUILD: "false"
TEST_DEPENDS: "pytest pytest-xdist hypothesis"
JUNITXML: "test-data.xml"
TEST_DIR: "tmp_for_test"
strategy:
matrix:
${{ insert }}: ${{ parameters.matrix }}

steps:
- checkout: self
submodules: true

- task: UsePythonVersion@0
inputs:
versionSpec: $(MB_PYTHON_VERSION)
displayName: Set python version

- bash: |
set -e

SKIP_BUILD="false"
if [ "$BUILD_REASON" == "Schedule" ]; then
BUILD_COMMIT=$NIGHTLY_BUILD_COMMIT
if [ "$NIGHTLY_BUILD" != "true" ]; then
SKIP_BUILD="true"
fi
fi
echo "Building pandas@$BUILD_COMMIT"
echo "##vso[task.setvariable variable=BUILD_COMMIT]$BUILD_COMMIT"
echo "##vso[task.setvariable variable=SKIP_BUILD]$SKIP_BUILD"

# Platform variables used in multibuild scripts
if [ `uname` == 'Darwin' ]; then
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]osx"
echo "##vso[task.setvariable variable=MACOSX_DEPLOYMENT_TARGET]10.9"
else
echo "##vso[task.setvariable variable=TRAVIS_OS_NAME]linux"
fi

# Store original Python path to be able to create test_venv pointing
# to same Python version.
PYTHON_EXE=`which python`
echo "##vso[task.setvariable variable=PYTHON_EXE]$PYTHON_EXE"
displayName: Define build env variables

- bash: |
set -e
pip install virtualenv wheel
BUILD_DEPENDS="$NP_BUILD_DEP $CYTHON_BUILD_DEP"

source multibuild/common_utils.sh
source multibuild/travis_steps.sh
source extra_functions.sh

# Setup build dependencies
before_install

clean_code $REPO_DIR $BUILD_COMMIT
build_wheel $REPO_DIR $PLAT
displayName: Build wheel
condition: eq(variables['SKIP_BUILD'], 'false')

- bash: |
set -xe
source multibuild/common_utils.sh
source multibuild/travis_steps.sh
source extra_functions.sh
setup_test_venv
install_run $PLAT
teardown_test_venv
displayName: Install wheel and test
condition: eq(variables['SKIP_BUILD'], 'false')

- bash: |
echo "##vso[task.prependpath]$CONDA/bin"
sudo chown -R $USER $CONDA
displayName: Add conda to PATH
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))

- bash: conda install -q -y anaconda-client
displayName: Install anaconda-client
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))

- bash: |
set -e
if [ "$BUILD_REASON" == "Schedule" ]; then
ANACONDA_ORG="scipy-wheels-nightly"
TOKEN="$PANDAS_NIGHTLY_UPLOAD_TOKEN"
else
ANACONDA_ORG="multibuild-wheels-staging"
TOKEN="$PANDAS_STAGING_UPLOAD_TOKEN"
fi
if [ "$TOKEN" == "" ]; then
echo "##[warning] Could not find anaconda.org upload token in secret variables"
fi
echo "##vso[task.setvariable variable=TOKEN]$TOKEN"
echo "##vso[task.setvariable variable=ANACONDA_ORG]$ANACONDA_ORG"
displayName: Retrieve secret upload token
condition: and(succeeded(), eq(variables['SKIP_BUILD'], 'false'), ne(variables['Build.Reason'], 'PullRequest'))
env:
# Secret variables need to mapped to env variables explicitly:
PANDAS_NIGHTLY_UPLOAD_TOKEN: $(PANDAS_NIGHTLY_UPLOAD_TOKEN)
PANDAS_STAGING_UPLOAD_TOKEN: $(PANDAS_STAGING_UPLOAD_TOKEN)

- bash: |
set -e
# The --force option forces a replacement if the remote file already
# exists.
ls wheelhouse/*.whl
anaconda -t $TOKEN upload --force -u $ANACONDA_ORG wheelhouse/*.whl
echo "PyPI-style index: https://pypi.anaconda.org/$ANACONDA_ORG/simple"
displayName: Upload to anaconda.org (only if secret token is retrieved)
condition: ne(variables['TOKEN'], '')
Loading