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

Commit

Permalink
Merge pull request #78 from MacPython/azure-pipelines2
Browse files Browse the repository at this point in the history
Use Azure Pipelines and upload to anaconda
  • Loading branch information
charris authored Apr 22, 2020
2 parents 0e39420 + bdbadcb commit bdc98f8
Show file tree
Hide file tree
Showing 10 changed files with 571 additions and 168 deletions.
167 changes: 4 additions & 163 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,169 +1,10 @@
# As config was originally based on an example by Olivier Grisel. Thanks!
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
clone_depth: 50
image: Ubuntu

# No reason for us to restrict the number concurrent jobs
max_jobs: 100

cache:
- '%LOCALAPPDATA%\pip\Cache'

environment:
global:
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin

CYTHON_BUILD_DEP: Cython
TEST_MODE: fast
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
WHEELHOUSE_UPLOADER_SECRET:
secure:
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh
BUILD_COMMIT: e94cec800304a6a467cf90ce4e7d3e207770b4b4
DAILY_COMMIT: master

matrix:
- PYTHON: C:\Python36
PYTHON_VERSION: 3.6
PYTHON_ARCH: 32

- PYTHON: C:\Python36-x64
PYTHON_VERSION: 3.6
PYTHON_ARCH: 64

- PYTHON: C:\Python37
PYTHON_VERSION: 3.7
PYTHON_ARCH: 32

- PYTHON: C:\Python37-x64
PYTHON_VERSION: 3.7
PYTHON_ARCH: 64

- PYTHON: C:\Python38
PYTHON_VERSION: 3.8
PYTHON_ARCH: 32

- PYTHON: C:\Python38-x64
PYTHON_VERSION: 3.8
PYTHON_ARCH: 64


init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
- ps: >-
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
$env:CONTAINER = "pre-release"
if ($env:DAILY_COMMIT) { $env:BUILD_COMMIT = $env:DAILY_COMMIT }
$env:NPY_RELAXED_STRIDES_DEBUG = 1
} else {
$env:CONTAINER = "wheels"
$env:UPLOAD_ARGS = "--no-update-index"
}
install:
- cmd: echo "Filesystem root:"
- dir C:\

- echo "Installed SDKs:"
- dir "C:/Program Files/Microsoft SDKs/Windows"

# Get needed submodules
- git submodule update --init

# Install new Python if necessary
- ps: .\multibuild\install_python.ps1

# Prepend required Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

# Check that we have the expected version and architecture for Python
- python --version
- >-
python -c "import sys,platform,struct;
print(sys.platform, platform.machine(), struct.calcsize('P') * 8, )"
# Upgrade to the latest pip, setuptools, and wheel.
- python -m pip install -U pip setuptools wheel urllib3

# Download and install static "openblas.a" to PYTHON\lib
- ps: |
$PYTHON = $env:PYTHON
$lib = python numpy/tools/openblas_support.py
$destination = "$PYTHON\lib\openblas.a"
echo $lib
cp $lib $destination
ls $destination
# Install build requirements.
- pip install "%CYTHON_BUILD_DEP%" --install-option="--no-cython-compile"

build_script:
- cd numpy
- git checkout %BUILD_COMMIT%
# Create _distributor_init.py
- cd ..
- python -c "import openblas_support; openblas_support.make_init('numpy/numpy')"
- cd numpy
# Append license text relevant for the built wheel
- type ..\LICENSE_win32.txt >> LICENSE.txt
- ps: |
$PYTHON_ARCH = $env:PYTHON_ARCH
If ($PYTHON_ARCH -eq 32) {
$MINGW = $env:MINGW_32
} Else {
$MINGW = $env:MINGW_64
}
$env:Path += ";$MINGW"
$env:NPY_NUM_BUILD_JOBS = "4"
- python setup.py bdist_wheel
- ps: |
# Upload artifact to Appveyor immediately after build
ls dist -r | Foreach-Object {
appveyor PushArtifact $_.FullName
pip install $_.FullName
}
- echo done

test_script:
- pip install pytest hypothesis
- cd ..
- python check_license.py
- mkdir tmp_for_test
- cd tmp_for_test
- pytest --pyargs numpy
- cd ..
- echo done

after_test:
# Upload test results to Appveyor
- ps: |
If (Test-Path .\junit-results.xml) {
(new-object net.webclient).UploadFile(
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path .\junit-results.xml)
)
}
$LastExitCode = 0
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
#
# If the cache limit is reached, the cache will not be updated (of not even
# created in the first run). So this is a trade of between keeping the cache
# current and having a cache at all.
# NB: This is done only `on_success` since the cache in uploaded only on
# success anyway.
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
# Show size of cache
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"
build: off

on_success:
# Upload the generated wheel package to Rackspace
- cd numpy
- pip install wheelhouse-uploader certifi
- python -m wheelhouse_uploader upload
--local-folder=dist
%UPLOAD_ARGS%
%CONTAINER%
169 changes: 169 additions & 0 deletions .appveyor.yml.back
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
# As config was originally based on an example by Olivier Grisel. Thanks!
# https://github.com/ogrisel/python-appveyor-demo/blob/master/appveyor.yml
clone_depth: 50

# No reason for us to restrict the number concurrent jobs
max_jobs: 100

cache:
- '%LOCALAPPDATA%\pip\Cache'

environment:
global:
MINGW_32: C:\mingw-w64\i686-6.3.0-posix-dwarf-rt_v5-rev1\mingw32\bin
MINGW_64: C:\mingw-w64\x86_64-6.3.0-posix-seh-rt_v5-rev1\mingw64\bin

CYTHON_BUILD_DEP: Cython
TEST_MODE: fast
APPVEYOR_SAVE_CACHE_ON_ERROR: true
APPVEYOR_SKIP_FINALIZE_ON_EXIT: true
WHEELHOUSE_UPLOADER_USERNAME: travis-worker
WHEELHOUSE_UPLOADER_SECRET:
secure:
9s0gdDGnNnTt7hvyNpn0/ZzOMGPdwPp2SewFTfGzYk7uI+rdAN9rFq2D1gAP4NQh
BUILD_COMMIT: e94cec800304a6a467cf90ce4e7d3e207770b4b4
DAILY_COMMIT: master

matrix:
- PYTHON: C:\Python36
PYTHON_VERSION: 3.6
PYTHON_ARCH: 32

- PYTHON: C:\Python36-x64
PYTHON_VERSION: 3.6
PYTHON_ARCH: 64

- PYTHON: C:\Python37
PYTHON_VERSION: 3.7
PYTHON_ARCH: 32

- PYTHON: C:\Python37-x64
PYTHON_VERSION: 3.7
PYTHON_ARCH: 64

- PYTHON: C:\Python38
PYTHON_VERSION: 3.8
PYTHON_ARCH: 32

- PYTHON: C:\Python38-x64
PYTHON_VERSION: 3.8
PYTHON_ARCH: 64


init:
- "ECHO %PYTHON% %PYTHON_VERSION% %PYTHON_ARCH%"
- "ECHO \"%APPVEYOR_SCHEDULED_BUILD%\""
- ps: >-
if ($env:APPVEYOR_REPO_BRANCH -eq "master") {
$env:CONTAINER = "pre-release"
if ($env:DAILY_COMMIT) { $env:BUILD_COMMIT = $env:DAILY_COMMIT }
$env:NPY_RELAXED_STRIDES_DEBUG = 1
} else {
$env:CONTAINER = "wheels"
$env:UPLOAD_ARGS = "--no-update-index"
}
install:
- cmd: echo "Filesystem root:"
- dir C:\

- echo "Installed SDKs:"
- dir "C:/Program Files/Microsoft SDKs/Windows"

# Get needed submodules
- git submodule update --init

# Install new Python if necessary
- ps: .\multibuild\install_python.ps1

# Prepend required Python to the PATH of this build (this cannot be
# done from inside the powershell script as it would require to restart
# the parent CMD process).
- SET PATH=%PYTHON%;%PYTHON%\Scripts;%PATH%

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

# Upgrade to the latest pip, setuptools, and wheel.
- python -m pip install -U pip setuptools wheel urllib3

# Download and install static "openblas.a" to PYTHON\lib
- ps: |
$PYTHON = $env:PYTHON
$lib = python numpy/tools/openblas_support.py
$destination = "$PYTHON\lib\openblas.a"
echo $lib
cp $lib $destination
ls $destination

# Install build requirements.
- pip install "%CYTHON_BUILD_DEP%" --install-option="--no-cython-compile"

build_script:
- cd numpy
- git checkout %BUILD_COMMIT%
# Create _distributor_init.py
- cd ..
- python -c "import openblas_support; openblas_support.make_init('numpy/numpy')"
- cd numpy
# Append license text relevant for the built wheel
- type ..\LICENSE_win32.txt >> LICENSE.txt
- ps: |
$PYTHON_ARCH = $env:PYTHON_ARCH
If ($PYTHON_ARCH -eq 32) {
$MINGW = $env:MINGW_32
} Else {
$MINGW = $env:MINGW_64
}
$env:Path += ";$MINGW"
$env:NPY_NUM_BUILD_JOBS = "4"
- python setup.py bdist_wheel
- ps: |
# Upload artifact to Appveyor immediately after build
ls dist -r | Foreach-Object {
appveyor PushArtifact $_.FullName
pip install $_.FullName
}

test_script:
- pip install pytest hypothesis
- cd ..
- python check_license.py
- mkdir tmp_for_test
- cd tmp_for_test
- pytest --pyargs numpy
- cd ..

after_test:
# Upload test results to Appveyor
- ps: |
If (Test-Path .\junit-results.xml) {
(new-object net.webclient).UploadFile(
"https://ci.appveyor.com/api/testresults/junit/$($env:APPVEYOR_JOB_ID)",
(Resolve-Path .\junit-results.xml)
)
}
$LastExitCode = 0
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
#
# If the cache limit is reached, the cache will not be updated (of not even
# created in the first run). So this is a trade of between keeping the cache
# current and having a cache at all.
# NB: This is done only `on_success` since the cache in uploaded only on
# success anyway.
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -mtime +360 -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -type f -size +10M -delete
- C:\cygwin\bin\find "%LOCALAPPDATA%\pip" -empty -delete
# Show size of cache
- C:\cygwin\bin\du -hs "%LOCALAPPDATA%\pip\Cache"

on_success:
# Upload the generated wheel package to Rackspace
- cd numpy
- pip install wheelhouse-uploader certifi
- python -m wheelhouse_uploader upload
--local-folder=dist
%UPLOAD_ARGS%
%CONTAINER%
File renamed without changes.
Loading

0 comments on commit bdc98f8

Please sign in to comment.