CofeehousePy/deps/scikit-image/azure-pipelines.yml

169 lines
4.9 KiB
YAML

# Azure Pipelines configuration file for Continuous Integration
# for building the package and running the tests under Windows.
jobs:
- job: 'Default'
pool:
vmImage: 'vs2017-win2016'
strategy:
maxParallel: 10
matrix:
Python37:
PYTHON_VERSION: '3.7'
ARCH: 'x86'
PIP_FLAGS: ''
Python37-x64:
PYTHON_VERSION: '3.7'
ARCH: 'x64'
PIP_FLAGS: ''
TEST_EXAMPLES: 'true'
Python38:
PYTHON_VERSION: '3.8'
ARCH: 'x86'
PIP_FLAGS: ''
Python38-x64:
PYTHON_VERSION: '3.8'
ARCH: 'x64'
PIP_FLAGS: ''
TEST_EXAMPLES: 'true'
BUILD_DOCS: 'true'
# build pre release packages on Python 3.8 since it has been out long
# enough for wheels to be built for packages that need to be compiled.
Python38-x64-pre:
PYTHON_VERSION: '3.8'
ARCH: 'x64'
PIP_FLAGS: '--pre'
Python39:
PYTHON_VERSION: '3.9'
ARCH: 'x86'
PIP_FLAGS: ''
Python39-x64:
PYTHON_VERSION: '3.9'
ARCH: 'x64'
PIP_FLAGS: ''
# NOTE(honles): winpty is required by one of the doc dependencies,
# but does not provide a wheel for Python 3.9
# TEST_EXAMPLES: 'true'
continueOnError: false
timeoutInMinutes: 60
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '$(PYTHON_VERSION)'
architecture: '$(ARCH)'
name: python
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Update pip
$PYTHON -m pip install -U pip setuptools wheel
# Check that we have the expected version and architecture for Python
$PYTHON --version
$PYTHON -m pip --version
$PYTHON -c "import struct; print('Void pointer width is', struct.calcsize('P') * 8)"
$PYTHON -m pip list
# Install the build and runtime dependencies of the project
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/build.txt
# Disable C99 complex if PyWavelets needs to be built from source.
# The compiler used will be MSVC, but C99 may be detected improperly
USE_C99_COMPLEX=0 $PYTHON -m pip install ${PIP_FLAGS} -r requirements/default.txt
$PYTHON -m pip list
displayName: 'Pre-installation'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Compile the package and build the wheel
$PYTHON setup.py bdist_wheel
# Install the generated wheel package
ls dist
$PYTHON -m pip install ${PIP_FLAGS} --no-index --find-links dist/ scikit-image
displayName: 'Installation'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Install the test dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/test.txt
$PYTHON -m pip list
# Set non-UI Matplotlib backend
cd ${AGENT_BUILDDIRECTORY} # D:\a\1
echo "backend : Agg" > matplotlibrc
displayName: 'Pre-testing'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Change the working directory in order to run the tests
# on the installed version of skimage
cd ${AGENT_BUILDDIRECTORY} # D:\a\1
# Show the info about the installed scikit-image
$PYTHON -c "import skimage; print(skimage.__path__)"
# Force matplotlib to use the prepared config
export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
# Run unit tests with pytest
# We don't test docstring examples (--doctest-modules) on
# Windows due to inconsistent ndarray formatting in `numpy`.
# For more details, see https://github.com/numpy/numpy/issues/13468
export TEST_ARGS="-v --cov=skimage"
$PYTHON -m pytest ${TEST_ARGS} --pyargs skimage
displayName: 'Package testing'
- bash: |
set -ex
export PYTHON="$(python.pythonLocation)\\python.exe"
# Install the doc dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
$PYTHON -m pip list
# Build the documentation
choco install optipng
export SPHINXCACHE=${AGENT_BUILDDIRECTORY}/.cache/sphinx
export SPHINXOPTS=-W
make -C doc html
condition: eq(variables['BUILD_DOCS'], 'true')
displayName: 'Documentation testing'
- bash: |
set -ex
PYTHON="$(python.pythonLocation)\\python.exe"
# Install the doc dependencies
$PYTHON -m pip install ${PIP_FLAGS} -r requirements/docs.txt
$PYTHON -m pip list
# Force matplotlib to use the prepared config
export MATPLOTLIBRC=${AGENT_BUILDDIRECTORY}
# Run example applications
for f in doc/examples/*/*.py; do
$PYTHON "${f}"
if [ $? -ne 0 ]; then
exit 1
fi
done
condition: eq(variables['TEST_EXAMPLES'], 'true')
displayName: 'Gallery testing'
# - bash: |
# # -- Publish the .whl artifacts
# # -- Upload the content of dist/*.whl to a public wheelhouse
# displayName: 'Further consideration'