Skip to content

Commit

Permalink
Merge pull request #142 from dzenanz/master
Browse files Browse the repository at this point in the history
  • Loading branch information
dzenanz committed Apr 27, 2022
2 parents aa0791a + 188551d commit 298911e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 108 deletions.
116 changes: 12 additions & 104 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ jobs:
strategy:
max-parallel: 3
matrix:
os: [ubuntu-18.04, windows-2019, macos-10.15]
os: [ubuntu-20.04, windows-2019, macos-10.15]
include:
- os: ubuntu-18.04
- os: ubuntu-20.04
c-compiler: "gcc"
cxx-compiler: "g++"
itk-git-tag: "v5.2.0"
itk-git-tag: "v5.3rc03"
cmake-build-type: "MinSizeRel"
- os: windows-2019
c-compiler: "cl.exe"
cxx-compiler: "cl.exe"
itk-git-tag: "v5.2.0"
itk-git-tag: "v5.3rc03"
cmake-build-type: "Release"
- os: macos-10.15
c-compiler: "clang"
cxx-compiler: "clang++"
itk-git-tag: "v5.2.0"
itk-git-tag: "v5.3rc03"
cmake-build-type: "MinSizeRel"

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2

- name: Set up Python 3.8
uses: actions/setup-python@v2
Expand Down Expand Up @@ -135,9 +135,9 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version: [36, 37, 38, 39]
python-version: [37, 38, 39, 310]
include:
- itk-python-git-tag: "v5.2.0"
- itk-python-git-tag: "v5.3rc03"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -173,7 +173,7 @@ jobs:
max-parallel: 2
matrix:
include:
- itk-python-git-tag: "v5.2.0"
- itk-python-git-tag: "v5.3rc03"

steps:
- uses: actions/checkout@v2
Expand Down Expand Up @@ -207,9 +207,9 @@ jobs:
strategy:
max-parallel: 2
matrix:
python-version-minor: [6, 7, 8, 9]
python-version-minor: [7, 8, 9, 10]
include:
- itk-python-git-tag: "v5.2.0"
- itk-python-git-tag: "v5.3rc03"

steps:
- name: Get specific version of CMake, Ninja
Expand Down Expand Up @@ -253,77 +253,12 @@ jobs:
name: WindowsWheel3.${{ matrix.python-version-minor }}
path: ../../im/dist

build-linux-opencl-python-packages:
runs-on: ubuntu-18.04
strategy:
max-parallel: 2
matrix:
python-version: [36, 37, 38, 39]
include:
- itk-python-git-tag: "v5.2.0"

steps:
- uses: actions/checkout@v2

- name: 'Free up disk space'
run: |
# Workaround for https://github.com/actions/virtual-environments/issues/709
df -h
sudo apt-get clean
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
df -h
- name: 'Build 🐍 Python 📦 package'
run: |
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
./wrapping/dockcross-manylinux-download-cache.sh
./wrapping/dockcross-manylinux-build-module-wheels-opencl.sh cp${{ matrix.python-version }}
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v1
with:
name: LinuxOpenCLWheel${{ matrix.python-version }}
path: dist

build-macos-opencl-python-packages:
runs-on: macos-10.15
strategy:
max-parallel: 2
matrix:
include:
- itk-python-git-tag: "v5.2.0"

steps:
- uses: actions/checkout@v2

- name: Get specific version of CMake, Ninja
uses: lukka/get-cmake@v3.18.3

- name: 'Fetch build script'
run: |
curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O
chmod u+x macpython-download-cache-and-build-module-wheels.sh
- name: 'Build 🐍 Python 📦 package'
run: |
export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }}
export MACOSX_DEPLOYMENT_TARGET=10.9
export ELASTIX_USE_OPENCL=1
./macpython-download-cache-and-build-module-wheels.sh
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v1
with:
name: MacOSOpenCLWheels
path: dist

publish-python-packages-to-pypi:
needs:
- build-linux-python-packages
- build-macos-python-packages
- build-windows-python-packages
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04

steps:
- name: Download Python Packages
Expand All @@ -345,30 +280,3 @@ jobs:
with:
user: __token__
password: ${{ secrets.pypi_password }}

publish-opencl-python-packages-to-pypi:
needs:
- build-linux-opencl-python-packages
- build-macos-opencl-python-packages
runs-on: ubuntu-18.04

steps:
- name: Download Python Packages
uses: actions/download-artifact@v2

- name: Prepare packages for upload
run: |
ls -R
for d in */; do
mv ${d}/*.whl .
done
mkdir dist
mv itk_elastix_opencl-*.whl dist/
ls dist
- name: Publish 🐍 Python 📦 package to PyPI
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.opencl_pypi_password }}
17 changes: 15 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.10.2)
cmake_minimum_required(VERSION 3.16.3)
project(Elastix)

# To ease enablement with Python packaging
Expand Down Expand Up @@ -40,7 +40,7 @@ set(_itk_build_testing ${BUILD_TESTING})
set(_itk_build_shared ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS OFF)
set(elastix_GIT_REPOSITORY "https://github.com/SuperElastix/elastix.git")
set(elastix_GIT_TAG "3816950f157753ad3763cfe3988f49f788eb38c2")
set(elastix_GIT_TAG "a0cf5235691ab0e7416600ed29db5abf2ff8ffe2")
FetchContent_Declare(
elx
GIT_REPOSITORY ${elastix_GIT_REPOSITORY}
Expand Down Expand Up @@ -80,6 +80,19 @@ set(BUILD_TESTING ${_itk_build_testing})
set(BUILD_SHARED_LIBS ${_itk_build_shared})


if(ITK_WRAP_PYTHON) # Python wrapping is enabled
get_property(multi_config GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if(multi_config)
if(NOT (CMAKE_CONFIGURATION_TYPES STREQUAL "Release"))
message(WARNING "Python wrapping of ITKElastix is known not to work with RelWithDebInfo configuration. Release is recommended. Your CMAKE_CONFIGURATION_TYPES: ${CMAKE_CONFIGURATION_TYPES}")
endif()
else()
if(NOT (CMAKE_BUILD_TYPE STREQUAL "Release"))
message(WARNING "Python wrapping of ITKElastix is known not to work with RelWithDebInfo configuration. Release is recommended. Your CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
endif()
endif()
endif()

if(NOT ITK_SOURCE_DIR)
find_package(ITK REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name=package_name,
version='0.13.0',
version='0.14.0',
author='Insight Software Consortium',
author_email='itk+community@discourse.itk.org',
packages=['itk'],
Expand Down Expand Up @@ -49,6 +49,6 @@
keywords='ITK InsightToolkit',
url=r'https://itk.org/',
install_requires=[
r'itk>=5.2.0'
r'itk>=5.3rc3'
]
)

0 comments on commit 298911e

Please sign in to comment.