From 2cde533bf4d916cfa39dc29ed74165ab2f1b3b1e Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Thu, 9 Jan 2025 16:56:19 -0500 Subject: [PATCH 1/3] Update to SimpleITK 2.4.1 Add SimpleITK_PYTHON_USE_LIMITED_API option and update cmake version to 3.26 --- CMakeLists.txt | 12 ++++++++---- README.md | 6 ++---- SimpleITK | 2 +- pyproject.toml | 2 +- requirements-dev.txt | 1 - setup.py | 2 +- 6 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 requirements-dev.txt diff --git a/CMakeLists.txt b/CMakeLists.txt index 0cc9d47..ca2f6c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.3) +cmake_minimum_required(VERSION 3.26) project(SimpleITKPythonPackage NONE) @@ -163,10 +163,13 @@ if(SimpleITKPythonPackage_SUPERBUILD) message(STATUS "SuperBuild - Searching for python") - if (PYTHON_VERSION_STRING) - # need to do something with the passed variable to silence unused - # CMake warning. + if ( PYTHON_VERSION_STRING VERSION_GREATER_EQUAL "3.11.0") + + set(_SimpleITK_PYTHON_USE_LIMITED_API_DEFAULT ON) + else () + set(_SimpleITK_PYTHON_USE_LIMITED_API_DEFAULT OFF) endif() + option( SimpleITK_PYTHON_USE_LIMITED_API "Use Python limited API, for minor version compatibility." ${_SimpleITK_PYTHON_USE_LIMITED_API_DEFAULT} ) # Sanity checks if(DEFINED PYTHON_INCLUDE_DIR AND NOT EXISTS ${PYTHON_INCLUDE_DIR}) @@ -213,6 +216,7 @@ if(SimpleITKPythonPackage_SUPERBUILD) -DPython_EXECUTABLE:PATH=${PYTHON_EXECUTABLE} -DBUILD_TESTING:BOOL=OFF -DSimpleITK_PYTHON_THREADS:BOOL=${SimpleITK_PYTHON_THREADS} + -DSimpleITK_PYTHON_USE_LIMITED_API:BOOL=${SimpleITK_PYTHON_USE_LIMITED_API} -DSimpleITK_DIR:PATH=${SimpleITK_DIR} -DITK_DIR:PATH=${ITK_DIR} -DSWIG_EXECUTABLE:PATH=${SWIG_EXECUTABLE} diff --git a/README.md b/README.md index 0318eee..1a7f19d 100644 --- a/README.md +++ b/README.md @@ -98,16 +98,14 @@ Building wheels requires: Build the SimpleITK Python wheel with the following command: ``` -mkvirtualenv build-sitk -pip install -r requirements-dev.txt -python setup.py bdist_wheel +python -m build . ``` ### Building Source Distribution The Python [build](https://pypa-build.readthedocs.io/en/latest/) package should be used to build the source distribution: ``` -python -m build --sdist +python -m build --sdist . ``` ### Efficiently building wheels for different version of python diff --git a/SimpleITK b/SimpleITK index 42ce27d..cf120d6 160000 --- a/SimpleITK +++ b/SimpleITK @@ -1 +1 @@ -Subproject commit 42ce27df414cfc174e7b4fb379a643360d10348a +Subproject commit cf120d6471195771881794519ea2077867499fe7 diff --git a/pyproject.toml b/pyproject.toml index 634ef6b..47da5e4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ requires = [ "scikit-build>=0.17.6", "wheel", - "cmake>=3.16.4", + "cmake>=3.26.0", "ninja; platform_system!='Windows'" ] build-backend = "setuptools.build_meta" diff --git a/requirements-dev.txt b/requirements-dev.txt deleted file mode 100644 index 91958a4..0000000 --- a/requirements-dev.txt +++ /dev/null @@ -1 +0,0 @@ -scikit-build>=0.14.1 diff --git a/setup.py b/setup.py index 2617108..7b91177 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setup( name='SimpleITK', - version='2.3.1', + version='2.4.1', author='Insight Software Consortium', author_email='insight-users@itk.org', packages=['SimpleITK'], From ca532eadada0b9017fdca9818fa1452a5742df3e Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Thu, 9 Jan 2025 17:13:05 -0500 Subject: [PATCH 2/3] Update to uploaded package as simpleitk*.tar.gz --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a43c14c..d3a48fb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,4 +63,4 @@ jobs: python -m pip install --upgrade pip - name: Build and Install SimpleITK Package run: | - python -m pip install ${{steps.download.outputs.download-path}}/SimpleITK-*.tar.gz + python -m pip install ${{steps.download.outputs.download-path}}/simpleitk-*.tar.gz From 048f797b79fdac232ee9124f84f1feae1fb5ad7c Mon Sep 17 00:00:00 2001 From: Bradley Lowekamp Date: Fri, 10 Jan 2025 08:07:04 -0500 Subject: [PATCH 3/3] Use intel macos-13 os to build The newer ARM instances appear to be running out of memory during linking. --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3a48fb..31286d3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -46,7 +46,7 @@ jobs: needs: package strategy: matrix: - os: [ubuntu-latest, macos-latest] + os: [ubuntu-latest, macos-13] python-version: ['3.8', '3.11'] runs-on: ${{ matrix.os }} steps: