Skip to content

Commit

Permalink
Merge branch 'master' into slice-explorer-plotly
Browse files Browse the repository at this point in the history
  • Loading branch information
mkcor committed Dec 11, 2020
2 parents 7582868 + 366464e commit 10aeeb0
Show file tree
Hide file tree
Showing 124 changed files with 1,452 additions and 603 deletions.
18 changes: 11 additions & 7 deletions .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,17 @@
# Windows
environment:
matrix:
- PYTHON: C:\Python36
- PYTHON: C:\Python36-x64
- PYTHON: C:\Python37
- PYTHON: C:\Python37-x64
- PYTHON: C:\Python38
- PYTHON: C:\Python38-x64
- PYTHON: C:\Python37-x64
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: C:\Python39
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
PYTHON: C:\Python39-x64
# 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.
- PYTHON: C:\Python38-x64
PIP_FLAGS: --pre

matrix:
Expand All @@ -29,23 +33,23 @@ install:
throw "There are newer queued builds for this pull request, failing early." }

- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
- "python -m pip install --retries 3 -U pip"
- "python -m pip install -U pip"

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

# Install the build and runtime dependencies of the project.
- pip install %PIP_FLAGS% --retries 3 -r requirements/default.txt
- pip install %PIP_FLAGS% --retries 3 -r requirements/build.txt
- pip install %PIP_FLAGS% -r requirements/default.txt
- pip install %PIP_FLAGS% -r requirements/build.txt
- python setup.py bdist_wheel bdist_wininst
- ps: "ls dist"

# Install the generated wheel package to test it.
- pip install %PIP_FLAGS% --no-index --find-links dist/ scikit-image
# Install the test dependencies
- pip install %PIP_FLAGS% --retries 3 -r requirements/test.txt
- pip install %PIP_FLAGS% -r requirements/test.txt

# Not a .NET project, we build scikit-image in the install step instead
build: false
Expand Down
17 changes: 16 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ jobs:
- image: circleci/python:3.8.2
steps:
- checkout
- run:
name: concatenate requirement files
command: cat requirements/*.txt > requirements/all_requirements
- restore_cache:
keys:
- data-v1-{{ checksum "skimage/data/_registry.py" }}
- packages-v1-{{ checksum "requirements/all_requirements" }}
- run:
name: install dependencies and package
command: |
Expand All @@ -17,14 +24,22 @@ jobs:
python -m pip install -r requirements/default.txt
python -m pip install -r requirements/docs.txt
export
- save_cache:
key: packages-v1-{{ checksum "requirements/all_requirements" }}
paths:
- skimage_venv
- run:
name: build doc
no_output_timeout: 50m
command: |
source skimage_venv/bin/activate
cd doc
make clean
make html
SPHINXOPTS="-j 1" make html
- save_cache:
key: data-v1-{{ checksum "skimage/data/_registry.py" }}
paths:
- /home/circleci/.cache/scikit-image/master
- store_artifacts:
path: doc/build/html
destination: doc/build/html
Expand Down
117 changes: 117 additions & 0 deletions .github/workflows/cibuildwheel.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
name: Build CI wheels

on:
push:
branches:
- master
- v[0-9]+.[0-9]+.x
- cibuildwheel
tags:
- v*

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, windows-latest, macos-latest]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- uses: actions/setup-python@v2
name: Install Python
with:
python-version: '3.7'

- name: Install cibuildwheel
run: |
python -m pip install cibuildwheel==1.6.3
- name: Build wheels for CPython 3.9 and Mac OS
if: matrix.os == 'macos-latest'
run: |
brew install libomp
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CPPFLAGS: "-Xpreprocessor -fopenmp"
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
CXXFLAGS: "-I/usr/local/opt/libomp/include"
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
CIBW_TEST_COMMAND: pytest --pyargs skimage

- name: Build wheels for CPython 3.9 (Linux and Windows)
if: matrix.os != 'macos-latest'
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.19.3
CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
CIBW_TEST_COMMAND: pytest --pyargs skimage

- name: Build wheels for CPython (MacOS)
if: matrix.os == 'macos-latest'
run: |
brew install libomp
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp3?-*"
CIBW_SKIP: "cp35-* cp36-* cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CPPFLAGS: "-Xpreprocessor -fopenmp"
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
CXXFLAGS: "-I/usr/local/opt/libomp/include"
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"
CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
CIBW_TEST_COMMAND: pytest --pyargs skimage


- name: Build wheels for CPython (Linux and Windows)
if: matrix.os != 'macos-latest'
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp3?-*"
CIBW_SKIP: "cp35-* cp36-* cp39-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
CIBW_TEST_REQUIRES: pytest pooch pytest-localserver pytest-faulthandler
CIBW_TEST_COMMAND: pytest --pyargs skimage



- name: Build wheels for CPython 3.6
run: |
python -m cibuildwheel --output-dir dist
env:
CIBW_BUILD: "cp36-*"
CIBW_MANYLINUX_X86_64_IMAGE: manylinux1
CIBW_MANYLINUX_I686_IMAGE: manylinux1
# CIBW_BEFORE_BUILD: pip install certifi numpy==1.16
if: >
startsWith(github.ref, 'refs/heads/v0.17') ||
startsWith(github.ref, 'refs/tags/v0.17')
- uses: actions/upload-artifact@v2
with:
name: wheels
path: ./dist/*.whl
192 changes: 192 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# Workflow to build and test wheels
name: Test

on: [push, pull_request]

jobs:

test_skimage_linux:
name: linux-cp${{ matrix.python-version }}-${{ matrix.OPTIONS_NAME }}
runs-on: ubuntu-latest
env:
BUILD_DOCS: 1
TEST_EXAMPLES: 0

strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
PIP_FLAGS: [""]
MINIMUM_REQUIREMENTS: [0]
QT: ["PyQt5"]
WITH_PYSIDE: [0]
BUILD_DOCS: [1]
PYTHONOPTIMIZE: [0]
TEST_EXAMPLES: [0]
OPTIONAL_DEPS: [0]
OPTIONS_NAME: ["default"]
INSTALL_FROM_SDIST: [0]
include:
- platform_id: manylinux_x86_64
python-version: 3.7
MINIMUM_REQUIREMENTS: 1
BUILD_DOCS: 0
OPTIONAL_DEPS: 0
# Test miminum requirements (don't build docs there is a problem
# with dask and astropy)
OPTIONS_NAME: "mini-req"
- platform_id: manylinux_x86_64
python-version: 3.7
MINIMUM_REQUIREMENTS: 1
OPTIONAL_DEPS: 1
BUILD_DOCS: 0
OPTIONS_NAME: "mini-req-optional-deps"
- platform_id: manylinux_x86_64
python-version: 3.8
PIP_FLAGS: "--pre"
# test pre-releases
OPTIONS_NAME: "pre"
- platform_id: manylinux_x86_64
python-version: 3.7
BUILD_DOCS: 1
OPTIONAL_DEPS: 1
OPTIONS_NAME: "optional-deps"
- platform_id: manylinux_x86_64
python-version: 3.7
PYTHONOPTIMIZE: 2
BUILD_DOCS: 0
OPTIONS_NAME: "optimize"
- platform_id: manylinux_x86_64
python-version: 3.7
INSTALL_FROM_SDIST: 1
OPTIONS_NAME: "install-from-sdist"




steps:
- name: Checkout scikit-image
uses: actions/checkout@v1

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version}}

- name: Build package
env:
VERSION: ${{ matrix.python-version }}
PYTHONOPTIMIZE: ${{ matrix.PYTHONOPTIMIZE }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
INSTALL_FROM_SDIST: ${{ matrix.INSTALL_FROM_SDIST }}
run: |
set -ex
source tools/github/before_install.sh
python setup.py sdist
if [[ $INSTALL_FROM_SDIST ]]; then
pip uninstall cython -y;
pip install dist/scikit-image-*.tar.gz;
else
pip install -vv -e .;
fi
- name: Run tests
env:
PIP_FLAGS: ${{ matrix.PIP_FLAGS }}
MINIMUM_REQUIREMENTS: ${{ matrix.MINIMUM_REQUIREMENTS }}
QT: ${{ matrix.QT }}
WITH_PYSIDE: ${{ matrix.WITH_PYSIDE }}
BUILD_DOCS: ${{ matrix.BUILD_DOCS }}
TEST_EXAMPLES: ${{ matrix.TEST_EXAMPLES }}
OPTIONAL_DEPS: ${{ matrix.OPTIONAL_DEPS }}
run: |
echo $PIP_FLAGS
pip install $PIP_FLAGS -r requirements/test.txt
export MPL_DIR=`python -c 'import matplotlib; print(matplotlib.get_configdir())'`
mkdir -p ${MPL_DIR}
touch ${MPL_DIR}/matplotlibrc
if [[ "${OPTIONAL_DEPS}" == "1" ]]; then
pip install -r ./requirements/optional.txt
if [[ "${EXTRA_DEPS}" != "0" ]]; then
# Extra deps need compilation, and it may not always be possible to
# compile them easily on all platforms
pip install -r ./requirements/extras.txt
fi
fi
source tools/github/script.sh
test_skimage_macos:
name: macos-cp${{ matrix.python-version }}
runs-on: macos-latest

strategy:
# Ensure that a wheel builder finishes even if another fails
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9]
QT: ["PyQt5"]
BUILD_DOCS: [1]
TEST_EXAMPLES: [0]
OPTIONAL_DEPS: [1]
OPTIONS_NAME: ["default"]
include:
- python-version: 3.7
OPTIONAL_DEPS: 0
- python-version: 3.9
OPTIONAL_DEPS: 0
exclude:
- python-version: 3.7
OPTIONAL_DEPS: 1
# Problem with SimpleITK and py 3.9
- python-version: 3.9
OPTIONAL_DEPS: 1

env:
BUILD_DOCS: 1
TEST_EXAMPLES: 0
CC: /usr/bin/clang
CXX: /usr/bin/clang++
CPPFLAGS: "-Xpreprocessor -fopenmp"
CFLAGS: "-Wno-implicit-function-declaration -I/usr/local/opt/libomp/include"
CXXFLAGS: "-I/usr/local/opt/libomp/include"
LDFLAGS: "-Wl,-rpath,/usr/local/opt/libomp/lib -L/usr/local/opt/libomp/lib -lomp"

steps:
- name: Checkout scikit-image
uses: actions/checkout@v1

- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version}}

- name: OSX configuration
run: |
# OpenMP is not present on macOS by default
set -ex
brew install libomp
- name: Build package
run: |
set -ex
source tools/github/before_install.sh
python setup.py sdist
pip install -vv --no-build-isolation -e .;
- name: Run tests
run: |
pip install $PIP_FLAGS -r requirements/test.txt
export MPL_DIR=`python -c 'import matplotlib; print(matplotlib.get_configdir())'`
mkdir -p ${MPL_DIR}
touch ${MPL_DIR}/matplotlibrc
if [[ "${OPTIONAL_DEPS}" == "1" ]]; then
pip install -r ./requirements/optional.txt
pip install -r ./requirements/extras.txt
fi
source tools/github/script.sh
Loading

0 comments on commit 10aeeb0

Please sign in to comment.