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

[MRG] Enable Azure pipelines for builds with uploads to anaconda.org #23

Merged
merged 197 commits into from
Feb 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
197 commits
Select commit Hold shift + click to select a range
f1a102b
ENH Enable Azure pipelines
thomasjpfan Mar 5, 2019
07aa7a8
FIX upload
thomasjpfan Mar 6, 2019
ae05088
FIX Python 2.7 3.4
thomasjpfan Mar 6, 2019
a332eb9
FIX Python 2.7
thomasjpfan Mar 6, 2019
48a39d7
FIX Python 3.4
thomasjpfan Mar 6, 2019
089755a
BUG Fix
thomasjpfan Mar 6, 2019
372b1ed
TST Debug
thomasjpfan Mar 6, 2019
7da2c4c
TST quote it
thomasjpfan Mar 6, 2019
5ffb59f
TST Debug
thomasjpfan Mar 6, 2019
f13a860
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
2208aa4
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
2a9392b
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
70ddb19
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
fcd0b27
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
f5fcb5a
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
8065102
BUG Fix python 3.4
thomasjpfan Mar 6, 2019
a74601d
OC
thomasjpfan Mar 6, 2019
8f906d2
Checking apps
thomasjpfan Mar 6, 2019
59877d0
Checking apps
thomasjpfan Mar 6, 2019
3d33849
Checking apps
thomasjpfan Mar 6, 2019
32c9e3e
Checking apps
thomasjpfan Mar 6, 2019
3e40168
Checking apps
thomasjpfan Mar 6, 2019
48ff9ba
DEBUG
thomasjpfan Mar 7, 2019
5a43878
DEBUG
thomasjpfan Mar 7, 2019
595a3b2
Use SDK for distutils
thomasjpfan Mar 7, 2019
6600170
DEBUG
thomasjpfan Mar 7, 2019
a693d44
DEBUG
thomasjpfan Mar 7, 2019
f466ac3
DEBUG
thomasjpfan Mar 7, 2019
cb7ab64
DEBUG
thomasjpfan Mar 7, 2019
b232e01
DEBUG
thomasjpfan Mar 7, 2019
97d518b
DEBUG
thomasjpfan Mar 7, 2019
d217546
DEBUG
thomasjpfan Mar 7, 2019
337ef40
DEBUG
thomasjpfan Mar 7, 2019
8061ebf
DEBUG
thomasjpfan Mar 7, 2019
cfa1a0a
DEBUG
thomasjpfan Mar 7, 2019
9b24455
DEBUG
thomasjpfan Mar 7, 2019
a92ef1b
DEBUG
thomasjpfan Mar 7, 2019
9f00c2b
DEBUG
thomasjpfan Mar 7, 2019
8fc6042
DEBUG
thomasjpfan Mar 7, 2019
75dcfa4
DEBUG
thomasjpfan Mar 7, 2019
8b43398
DEBUG
thomasjpfan Mar 7, 2019
c9e8fd7
DEBUG
thomasjpfan Mar 7, 2019
ffe0f03
DEBUG
thomasjpfan Mar 7, 2019
f6f1063
DEBUG
thomasjpfan Mar 7, 2019
f273aaf
DEBUG
thomasjpfan Mar 7, 2019
7a74745
DEBUG
thomasjpfan Mar 7, 2019
ddcaa75
DEBUG
thomasjpfan Mar 7, 2019
54d1b02
DEBUG
thomasjpfan Mar 7, 2019
4377435
DEBUG
thomasjpfan Mar 7, 2019
2387ba7
DEBUG
thomasjpfan Mar 7, 2019
2677381
DEBUG
thomasjpfan Mar 7, 2019
324c4c3
DEBUG
thomasjpfan Mar 7, 2019
c0b6a94
DEBUG
thomasjpfan Mar 7, 2019
4b9b0d6
DEBUG
thomasjpfan Mar 7, 2019
3dff38a
DEBUG
thomasjpfan Mar 7, 2019
9bb3a20
DEBUG
thomasjpfan Mar 7, 2019
9faa863
DEBUG
thomasjpfan Mar 7, 2019
f261585
DEBUG
thomasjpfan Mar 7, 2019
364625b
DEBUG
thomasjpfan Mar 7, 2019
d22558d
DEBUG
thomasjpfan Mar 7, 2019
dfdaa7a
DEBUG
thomasjpfan Mar 7, 2019
3ea698a
DEBUG
thomasjpfan Mar 7, 2019
cb6d0bd
DEBUG
thomasjpfan Mar 7, 2019
f8a139e
DEBUG
thomasjpfan Mar 7, 2019
21621e9
DEBUG
thomasjpfan Mar 7, 2019
352951f
DEBUG
thomasjpfan Mar 7, 2019
7b21ede
DEBUG
thomasjpfan Mar 7, 2019
25ff7f8
DEBUG
thomasjpfan Mar 7, 2019
3e98f54
DEBUG
thomasjpfan Mar 7, 2019
4369c9f
DEBUG
thomasjpfan Mar 7, 2019
4305af0
ENH Adds Azure pipelines
thomasjpfan Mar 5, 2019
6782b76
Trigger CI [no upload]
thomasjpfan Mar 7, 2019
f4c64d3
BLD Trigger CI [no upload]
thomasjpfan Mar 7, 2019
951dc53
CLN Moves test to own step
thomasjpfan Mar 8, 2019
4562942
CLN Moves test back to step [no upload]
thomasjpfan Mar 8, 2019
f512307
Merge branch 'azure_pipelines_pr_2' into azure_pipelines_pr
thomasjpfan Mar 8, 2019
512a5f1
DEBUG
thomasjpfan Mar 8, 2019
89186fb
DEBUG
thomasjpfan Mar 8, 2019
e9a0329
DEBUG
thomasjpfan Mar 8, 2019
abf2a8f
DEBUG
thomasjpfan Mar 8, 2019
00ed30d
DEBUG
thomasjpfan Mar 8, 2019
e9c13d5
DEBUG
thomasjpfan Mar 8, 2019
066afad
DEBUG
thomasjpfan Mar 8, 2019
000f270
DEBUG
thomasjpfan Mar 8, 2019
912057a
DEBUG
thomasjpfan Mar 8, 2019
35e9450
DEBUG [no upload]
thomasjpfan Mar 8, 2019
9fd7b22
ENH: Enable windows 32 [no upload]
thomasjpfan Mar 8, 2019
133d023
ENH: Enable windows 32 [no upload]
thomasjpfan Mar 8, 2019
42fd530
ENH: Enable windows 32 [no upload]
thomasjpfan Mar 8, 2019
ada8fd2
ENH: Adds windows python 3.4 support [no upload]
thomasjpfan Mar 8, 2019
e80c1bf
Merge remote-tracking branch 'upstream/master' into azure_pipelines_pr_2
thomasjpfan May 15, 2019
d091b98
ENH Sync with travis and appveyor config
thomasjpfan May 15, 2019
3164b08
CLN Comments out linux and osx
thomasjpfan May 15, 2019
06a16f2
BLD Trigger CI
thomasjpfan May 31, 2019
ec94a1a
Merge remote-tracking branch 'upstream/master' into azure_pipelines_pr_2
thomasjpfan Feb 8, 2020
e6dc026
MNT Updates multibuild
thomasjpfan Feb 8, 2020
c0362ef
CLN Removes wheelhouse
thomasjpfan Feb 8, 2020
a60e8b8
TST Just build
thomasjpfan Feb 8, 2020
61523af
TST Just build
thomasjpfan Feb 8, 2020
1bb2695
TST Update to artifacts
thomasjpfan Feb 8, 2020
d3eb18e
MNT Update to artifact feed
thomasjpfan Feb 8, 2020
37bd846
Uses full url for fork
thomasjpfan Feb 8, 2020
6f7e398
TST Upload sklearn-release
thomasjpfan Feb 8, 2020
691f324
DEP Cython
thomasjpfan Feb 8, 2020
c102d03
BUG Fix
thomasjpfan Feb 8, 2020
ba8e5d7
BUG Fix
thomasjpfan Feb 8, 2020
68c56ec
explore fs
thomasjpfan Feb 8, 2020
3d6b5d5
ITS IN THE WHEELHOUSE
thomasjpfan Feb 8, 2020
fc720ec
ITS IN THE WHEELHOUSE
thomasjpfan Feb 8, 2020
229df65
Twine is great
thomasjpfan Feb 8, 2020
de1923f
DEBUG .pypirc
thomasjpfan Feb 8, 2020
5905e5d
USE VERSION 1
thomasjpfan Feb 8, 2020
c36a65a
ITS SINGULAr
thomasjpfan Feb 8, 2020
4f07fc2
USE ENV
thomasjpfan Feb 8, 2020
e76cf99
BUG Fix
thomasjpfan Feb 8, 2020
574c865
MNT Install keyring
thomasjpfan Feb 8, 2020
3c1909b
Updates feed name
thomasjpfan Feb 8, 2020
6dc8d2b
no newline
thomasjpfan Feb 8, 2020
ee2ef4a
MNT Adds more artifacts
thomasjpfan Feb 9, 2020
a56f6dd
BLD Build all the supported versions
thomasjpfan Feb 9, 2020
427442a
BLD Build all the supported versions
thomasjpfan Feb 9, 2020
8e6f959
BLD Only build windows
thomasjpfan Feb 9, 2020
37e47e0
BLD Use bash
thomasjpfan Feb 9, 2020
08551e5
BLD Uses bash
thomasjpfan Feb 9, 2020
8be8224
DEBUG
thomasjpfan Feb 9, 2020
f4df20b
DEBUG
thomasjpfan Feb 9, 2020
0840a31
DEBUG
thomasjpfan Feb 9, 2020
345431e
BUG Fix comments
thomasjpfan Feb 9, 2020
9f63a1a
BUG check artifacts
thomasjpfan Feb 9, 2020
3e9bb81
DEBUG
thomasjpfan Feb 9, 2020
9319b9a
DEBUG build windows 3.8
thomasjpfan Feb 9, 2020
d3d76c3
BLD Builds all of windows
thomasjpfan Feb 9, 2020
f9bb937
BLD
thomasjpfan Feb 9, 2020
e01ceeb
REV
thomasjpfan Feb 9, 2020
c1e94fd
STY Whitespace
thomasjpfan Feb 9, 2020
c849f8e
sty update
thomasjpfan Feb 9, 2020
b2d60c2
TST Enable tests
thomasjpfan Feb 9, 2020
3c72a5f
TST Enable all tests
thomasjpfan Feb 9, 2020
6baf332
TST Enable all tests
thomasjpfan Feb 9, 2020
969d40b
TST Only tests osx
thomasjpfan Feb 9, 2020
7a7aeb0
MNT Makes PR mergable
thomasjpfan Feb 9, 2020
592ea7b
Typo in JOBLIB_BUILD_DEP
ogrisel Feb 10, 2020
65d275b
UNICODE_WIDTH is only useful for Python 2
ogrisel Feb 10, 2020
e828aed
Isolate tests in empty venv and let pip install latest runtime deps
ogrisel Feb 10, 2020
45b9d29
Use additional shell functions to be used directly in main posix.yml …
ogrisel Feb 10, 2020
1ff4d3b
typo
ogrisel Feb 10, 2020
a3cf875
Split main script in posix.yml
ogrisel Feb 10, 2020
f4537ac
Temporary disable older Python versions to iterate faster
ogrisel Feb 10, 2020
bd1ddef
Fix variable definitions
ogrisel Feb 10, 2020
95f79dc
Make test_env functions more robust
ogrisel Feb 10, 2020
1ffe768
Fix DAILY_BUILD condition
ogrisel Feb 10, 2020
bc98776
Isolated test venv on windows + split test step
ogrisel Feb 10, 2020
9e9212d
typo
ogrisel Feb 10, 2020
8a8c6a3
No need for virtualenv (Python 3 only)
ogrisel Feb 10, 2020
4aea61e
Windows venv activation
ogrisel Feb 10, 2020
2173b1a
One more try
ogrisel Feb 10, 2020
98a1419
Upgrade pip
ogrisel Feb 10, 2020
fc61831
One more try
ogrisel Feb 10, 2020
df45d63
Install scikit-learn via filename
ogrisel Feb 10, 2020
69f7323
Define TEST_DEPENDS on top
ogrisel Feb 10, 2020
7b94f1d
Reduce daily builds to 2 Python versions
ogrisel Feb 10, 2020
0f07d8f
Update README.rst
ogrisel Feb 10, 2020
ec514ac
Use explicit path to python executable when creating test env
ogrisel Feb 10, 2020
98c919f
Clean up local echo in windows scripts
ogrisel Feb 10, 2020
4de0e3e
Windows specific venv config
ogrisel Feb 10, 2020
f6779b1
Try to upload to anaconda.org
ogrisel Feb 10, 2020
8204138
Fix invalid yaml
ogrisel Feb 10, 2020
d4abad6
More trial and error for anaconda upload
ogrisel Feb 10, 2020
1fbe614
Fix nightly build vars
ogrisel Feb 10, 2020
54e6ec2
Better error message in case of missing token
ogrisel Feb 10, 2020
3308d58
Map secret variables to env variables
ogrisel Feb 10, 2020
7f4eaaa
debug windows env
ogrisel Feb 10, 2020
8890b90
Fix: use bash everywhere explicitly to avoid silly copy and paste errors
ogrisel Feb 10, 2020
41ab878
Replace existing files
ogrisel Feb 10, 2020
613fb2e
Fix link in README.rst
ogrisel Feb 10, 2020
6600b8a
Prepare junit + schedule jobs
ogrisel Feb 10, 2020
70986f6
Try scheduled run
ogrisel Feb 10, 2020
6982e32
Cosmetics
ogrisel Feb 10, 2020
da3a009
Check nightly_build tag
ogrisel Feb 10, 2020
cfe8ebd
Update build matrix
ogrisel Feb 10, 2020
d933fee
disable test schedule for now
ogrisel Feb 10, 2020
4abbe42
Fix skip build logic
ogrisel Feb 10, 2020
e02561d
Fix conditions
ogrisel Feb 10, 2020
62f3aac
Fix typo in SKIP_BUILD definition, reduce schedule to test while I'm …
ogrisel Feb 10, 2020
8f5cb62
Reeable tests
ogrisel Feb 11, 2020
5ae6a91
Do not try to upload if TOKEN is not present
ogrisel Feb 11, 2020
bae8fa5
Typo
ogrisel Feb 11, 2020
928c34d
Fix secret variable mapping
ogrisel Feb 11, 2020
c7d3c0c
More debug
ogrisel Feb 11, 2020
d0d95dd
Typo
ogrisel Feb 11, 2020
7d1aa2d
Fix missing variable
ogrisel Feb 11, 2020
618e372
Enable tests
ogrisel Feb 11, 2020
3f22da5
debug test dir
ogrisel Feb 11, 2020
b10cb88
Debug
ogrisel Feb 12, 2020
e733336
More debug
ogrisel Feb 12, 2020
cc36cbf
Small improvements
ogrisel Feb 12, 2020
684d608
Cleanup
ogrisel Feb 12, 2020
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.
6 changes: 3 additions & 3 deletions .travis.yml → .travis.yml.back
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@ after_success:
- pip install wheelhouse-uploader twine
- python -m twine check ${TRAVIS_BUILD_DIR}/wheelhouse/*
- python -m wheelhouse_uploader upload --local-folder
${TRAVIS_BUILD_DIR}/wheelhouse/
$UPLOAD_ARGS
$CONTAINER
${TRAVIS_BUILD_DIR}/wheelhouse/
$UPLOAD_ARGS
$CONTAINER
19 changes: 9 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,28 +1,27 @@
.. image:: https://travis-ci.org/MacPython/scikit-learn-wheels.svg?branch=master
:target: https://travis-ci.org/MacPython/scikit-learn-wheels
.. image:: https://ci.appveyor.com/api/projects/status/0vgnsltgf2ghhbr2/branch/master?svg=true
:target: https://ci.appveyor.com/project/sklearn-wheels/scikit-learn-wheels
TODO: add Azure Pipelines badge here

##########################
Scikit-learn wheel builder
##########################

Repository to build scikit-learn wheels.

Edit `appveyor.yml` and `.travis.yml` to change the `BUILD_COMMIT` environment
variable to set the name of the git tag to build, commit and push (to master).
Edit `azure/windows.yml` and `azure/posix.yml` to change the `BUILD_COMMIT`
environment variable to set the name of the git tag to build, commit and push
(to master).

Travis and appveyor should automatically build and test that version on
Windows, Linux and OSX for various versions of Python (both 32 bit and 64 bit).
Azure Pipelines should automatically build and test that version on Windows,
Linux and OSX for various versions of Python (both 32 bit and 64 bit).

If the tests pass, the resulting wheels should show up on:

http://wheels.scipy.org
- https://anaconda.org/scikit-learn-wheels-staging for release wheels staging;
- https://anaconda.org/scipy-wheels-nightly for nightly builds.

The following tool can be useful to download all the wheels for a specific
release:

https://github.com/ogrisel/wheelhouse-uploader

and then use `twine` to publish all the wheels along with the locally built
source tarball of the release all at once to PyPI.
source tarball of the release all at once to PyPI.
88 changes: 88 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
schedules:
- 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.12.1"
py_3.6_64:
PYTHON_VERSION: "3.6.x"
NP_BUILD_DEP: "1.12.1"
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"
SCIPY_BUILD_DEP: "1.4.1"
NIGHTLY_BUILD: "true"
py_3.8_64:
PYTHON_VERSION: "3.8.x"
NP_BUILD_DEP: "1.17.3"
SCIPY_BUILD_DEP: "1.4.1"
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"
Copy link
Collaborator

Choose a reason for hiding this comment

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

don't wanna use oldest-supported-numpy ?

Copy link
Contributor

Choose a reason for hiding this comment

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

oldest-supported-numpy that also works on Python 3.8.

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: xcode9-macos10.13
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"
141 changes: 141 additions & 0 deletions azure/posix.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
parameters:
name: ""
vmImage: ""
matrix: []

jobs:
- job: ${{ parameters.name }}
pool:
vmImage: ${{ parameters.vmImage }}
variables:
REPO_DIR: "scikit-learn"
BUILD_COMMIT: "0.22.1"
PLAT: "x86_64"
NP_BUILD_DEP: "numpy==1.11.0"
CYTHON_BUILD_DEP: "cython==0.29.14"
SCIPY_BUILD_DEP: "scipy"
JOBLIB_BUILD_DEP: "joblib==0.11"
NIGHTLY_BUILD_COMMIT: "master"
NIGHTLY_BUILD: "false"
TEST_DEPENDS: "pytest"
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 scikit-learn@$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
BUILD_DEPENDS="$NP_BUILD_DEP $CYTHON_BUILD_DEP $SCIPY_BUILD_DEP"

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

# Setup build dependencies
before_install

# OpenMP is not present on macOS by default
setup_compiler
clean_code $REPO_DIR $BUILD_COMMIT
build_wheel $REPO_DIR $PLAT
teardown_compiler
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')

- task: PublishTestResults@2
inputs:
testResultsFiles: '$(TEST_DIR)/$(JUNITXML)'
testRunTitle: ${{ format('{0}-$(Agent.JobName)', parameters.name) }}
displayName: 'Publish Test Results'
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="$SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN"
else
ANACONDA_ORG="scikit-learn-wheels-staging"
TOKEN="$SCIKIT_LEARN_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:
SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN: $(SCIKIT_LEARN_NIGHTLY_UPLOAD_TOKEN)
SCIKIT_LEARN_STAGING_UPLOAD_TOKEN: $(SCIKIT_LEARN_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