From 0223ce1855828b7453fc19addec1af57469c63d2 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Mon, 25 Mar 2024 10:41:24 +0100 Subject: [PATCH 01/33] feat: add wheel packaging for VTK SDK using scikit-build-core This pulls a tar.xz archive from https://vtk.org/files/wheel-sdks and package it as a wheel using scikit-build-core. This wheel will then be added to a pip repository to be fetch through build requirements. --- CMakeLists.txt | 65 ++++++++++++++++++++++++++++--- cmake/vtk-config-version.cmake.in | 1 + cmake/vtk-config.cmake.in | 1 + cmake/vtk-sdk-urls.cmake | 13 +++++++ pyproject.toml | 2 + src/main.cpp | 27 ------------- src/vtk_sdk/_core.pyi | 4 -- src/vtk_sdk/cmake/__init__.py | 1 + tests/test_compiled.py | 11 ------ 9 files changed, 77 insertions(+), 48 deletions(-) create mode 100644 cmake/vtk-config-version.cmake.in create mode 100644 cmake/vtk-config.cmake.in create mode 100644 cmake/vtk-sdk-urls.cmake delete mode 100644 src/main.cpp delete mode 100644 src/vtk_sdk/_core.pyi create mode 100644 src/vtk_sdk/cmake/__init__.py delete mode 100644 tests/test_compiled.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 791b1e4..e372804 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,61 @@ -cmake_minimum_required(VERSION 3.15...3.26) -project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX) +cmake_minimum_required(VERSION 3.21) -set(PYBIND11_FINDPYTHON ON) -find_package(pybind11 CONFIG REQUIRED) +set(VTK_VERSION + "9.2.5" + CACHE STRING "VTK SDK version to package") +project( + vtk-sdk + VERSION ${VTK_VERSION} + DESCRIPTION "VTK SDK python distributions" + HOMEPAGE_URL "https://github.com/Kitware/vtk-sdk-python-distributions" + LANGUAGES NONE) -pybind11_add_module(_core MODULE src/main.cpp) -install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME}) +find_package( + Python + COMPONENTS Interpreter Development.Module + REQUIRED) + +include(cmake/vtk-sdk-urls.cmake) +include(FetchContent) + +set(download_dir ${PROJECT_BINARY_DIR}) +set(extract_dir ${PROJECT_BINARY_DIR}/vtk-wheel-sdk) +# FetchContent will download and extract our archive! +FetchContent_Populate( + vtkwheelsdk + URL ${VTK_SDK_BINARY_URL} DOWNLOAD_DIR ${download_dir} + SOURCE_DIR ${extract_dir}) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake @ONLY) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config-version.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config-version.cmake @ONLY) + +# "/" after ${extract_dir} is required so the folder content is copied to dest, +# instead of the folder itself! +install( + DIRECTORY ${extract_dir}/ + DESTINATION vtk_sdk + PATTERN "bin/*" EXCLUDE) + +install( + DIRECTORY ${extract_dir}/bin/ + DESTINATION vtk_sdk/bin + PATTERN + "*" + PERMISSIONS + OWNER_READ + OWNER_WRITE + OWNER_EXECUTE + GROUP_READ + GROUP_EXECUTE + WORLD_READ + WORLD_EXECUTE) + +install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vtk_sdk/cmake/__init__.py + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config-version.cmake + DESTINATION vtk_sdk/cmake) diff --git a/cmake/vtk-config-version.cmake.in b/cmake/vtk-config-version.cmake.in new file mode 100644 index 0000000..aa0b38b --- /dev/null +++ b/cmake/vtk-config-version.cmake.in @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../vtk-@VTK_VERSION@.data/headers/cmake/vtk-config-version.cmake) diff --git a/cmake/vtk-config.cmake.in b/cmake/vtk-config.cmake.in new file mode 100644 index 0000000..79b77d5 --- /dev/null +++ b/cmake/vtk-config.cmake.in @@ -0,0 +1 @@ +include(${CMAKE_CURRENT_LIST_DIR}/../vtk-@VTK_VERSION@.data/headers/cmake/vtk-config.cmake) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake new file mode 100644 index 0000000..608593a --- /dev/null +++ b/cmake/vtk-sdk-urls.cmake @@ -0,0 +1,13 @@ +# VTK SDK is currently stored as a tar.xz archive on a Kitware hosted server +set(python_cp "cp${Python_VERSION_MAJOR}${Python_VERSION_MINOR}") + +# enable any linux to download the right tar.xz +if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + set(VTK_SDK_BINARY_URL + "https://vtk.org/files/wheel-sdks/vtk-wheel-sdk-${VTK_VERSION}-${python_cp}-${python_cp}-manylinux_2_17_x86_64.manylinux2014_x86_64.tar.xz" + ) +else() + set(VTK_SDK_BINARY_URL + "https://vtk.org/files/wheel-sdks/vtk-wheel-sdk-${VTK_VERSION}-${python_cp}-${Python_SOABI}.tar.xz" + ) +endif() diff --git a/pyproject.toml b/pyproject.toml index 0002726..0af9b33 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,8 @@ Homepage = "https://github.com/Kitware/vtk-sdk-python-distributions" Discussions = "https://github.com/Kitware/vtk-sdk-python-distributions/discussions" Changelog = "https://github.com/Kitware/vtk-sdk-python-distributions/releases" +[project.entry-points."cmake.prefix"] +any = "vtk_sdk.cmake" [tool.scikit-build] minimum-version = "0.8.2" diff --git a/src/main.cpp b/src/main.cpp deleted file mode 100644 index d570cd0..0000000 --- a/src/main.cpp +++ /dev/null @@ -1,27 +0,0 @@ -#include - -int add(int i, int j) { return i + j; } - -namespace py = pybind11; - -PYBIND11_MODULE(_core, m) { - m.doc() = R"pbdoc( - Pybind11 example plugin - ----------------------- - .. currentmodule:: python_example - .. autosummary:: - :toctree: _generate - add - subtract - )pbdoc"; - - m.def("add", &add, R"pbdoc( - Add two numbers - Some other explanation about the add function. - )pbdoc"); - - m.def("subtract", [](int i, int j) { return i - j; }, R"pbdoc( - Subtract two numbers - Some other explanation about the subtract function. - )pbdoc"); -} diff --git a/src/vtk_sdk/_core.pyi b/src/vtk_sdk/_core.pyi deleted file mode 100644 index 537c611..0000000 --- a/src/vtk_sdk/_core.pyi +++ /dev/null @@ -1,4 +0,0 @@ -from __future__ import annotations - -def add(_x: int, _y: int) -> int: ... -def subtract(_x: int, _y: int) -> int: ... diff --git a/src/vtk_sdk/cmake/__init__.py b/src/vtk_sdk/cmake/__init__.py new file mode 100644 index 0000000..7739ada --- /dev/null +++ b/src/vtk_sdk/cmake/__init__.py @@ -0,0 +1 @@ +# This module is here because the path of the actual vtk-config.cmake file is not a valid module name diff --git a/tests/test_compiled.py b/tests/test_compiled.py deleted file mode 100644 index d0342ca..0000000 --- a/tests/test_compiled.py +++ /dev/null @@ -1,11 +0,0 @@ -from __future__ import annotations - -import vtk_sdk._core as m - - -def test_add(): - assert m.add(2, 3) == 5 - - -def test_subtract(): - assert m.subtract(7, 5) == 2 From ed4c4da07b051d6bd271b36389c4fd4a622edf81 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 10:53:30 -0400 Subject: [PATCH 02/33] style: Re-organize CMakeLists into "section" to improve readability --- CMakeLists.txt | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e372804..ad33317 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,23 +15,22 @@ find_package( COMPONENTS Interpreter Development.Module REQUIRED) +# ---------------------------------------------------------------------------- +# Download and extract vtk-wheel-sdk archive + include(cmake/vtk-sdk-urls.cmake) -include(FetchContent) set(download_dir ${PROJECT_BINARY_DIR}) set(extract_dir ${PROJECT_BINARY_DIR}/vtk-wheel-sdk) -# FetchContent will download and extract our archive! + +include(FetchContent) FetchContent_Populate( vtkwheelsdk URL ${VTK_SDK_BINARY_URL} DOWNLOAD_DIR ${download_dir} SOURCE_DIR ${extract_dir}) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake @ONLY) - -configure_file( - ${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config-version.cmake.in - ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config-version.cmake @ONLY) +# ---------------------------------------------------------------------------- +# Install content of the vtk-wheel-sdk archive # "/" after ${extract_dir} is required so the folder content is copied to dest, # instead of the folder itself! @@ -54,6 +53,16 @@ install( WORLD_READ WORLD_EXECUTE) +# ---------------------------------------------------------------------------- +# Configure and install "cmake.module" entry point files + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake @ONLY) + +configure_file( + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config-version.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config-version.cmake @ONLY) + install( FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/vtk_sdk/cmake/__init__.py ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake From 97072744148f086892feb40f5c0ca1c7c9482132 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 10:58:15 -0400 Subject: [PATCH 03/33] fix: install SDK under vtk_sdk/content and set bin permissions Do not rely on scikit-build-core automatic package discovery and explicitly install content of the vtk-sdk archive into a dedicated sub-directory. --- CMakeLists.txt | 6 ++++-- cmake/vtk-config-version.cmake.in | 2 +- cmake/vtk-config.cmake.in | 2 +- pyproject.toml | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ad33317..b794bf4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,16 +32,18 @@ FetchContent_Populate( # ---------------------------------------------------------------------------- # Install content of the vtk-wheel-sdk archive +set(VTK_SDK_INSTALL_DIR "content") + # "/" after ${extract_dir} is required so the folder content is copied to dest, # instead of the folder itself! install( DIRECTORY ${extract_dir}/ - DESTINATION vtk_sdk + DESTINATION vtk_sdk/${VTK_SDK_INSTALL_DIR} PATTERN "bin/*" EXCLUDE) install( DIRECTORY ${extract_dir}/bin/ - DESTINATION vtk_sdk/bin + DESTINATION vtk_sdk/${VTK_SDK_INSTALL_DIR}/bin PATTERN "*" PERMISSIONS diff --git a/cmake/vtk-config-version.cmake.in b/cmake/vtk-config-version.cmake.in index aa0b38b..05fd041 100644 --- a/cmake/vtk-config-version.cmake.in +++ b/cmake/vtk-config-version.cmake.in @@ -1 +1 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../vtk-@VTK_VERSION@.data/headers/cmake/vtk-config-version.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../@VTK_SDK_INSTALL_DIR@/vtk-@VTK_VERSION@.data/headers/cmake/vtk-config-version.cmake) diff --git a/cmake/vtk-config.cmake.in b/cmake/vtk-config.cmake.in index 79b77d5..d3daf73 100644 --- a/cmake/vtk-config.cmake.in +++ b/cmake/vtk-config.cmake.in @@ -1 +1 @@ -include(${CMAKE_CURRENT_LIST_DIR}/../vtk-@VTK_VERSION@.data/headers/cmake/vtk-config.cmake) +include(${CMAKE_CURRENT_LIST_DIR}/../@VTK_SDK_INSTALL_DIR@/vtk-@VTK_VERSION@.data/headers/cmake/vtk-config.cmake) diff --git a/pyproject.toml b/pyproject.toml index 0af9b33..d931565 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -64,6 +64,7 @@ minimum-version = "0.8.2" build-dir = "build/{wheel_tag}" metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" sdist.include = ["src/vtk_sdk/_version.py"] +wheel.packages = ["src/vtk_sdk"] [tool.setuptools_scm] From 4ec6085a8ddfaf1cc692aa1c70df38b52be2e07e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 11:28:33 -0400 Subject: [PATCH 04/33] fix: Set VTK_VERSION as regular (non-CACHE) variable Anticipating the introduction of checksum verification, the vtk-sdk archive version will be a static parameter. --- CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b794bf4..eb97e9e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,7 @@ cmake_minimum_required(VERSION 3.21) -set(VTK_VERSION - "9.2.5" - CACHE STRING "VTK SDK version to package") +set(VTK_VERSION "9.2.5") + project( vtk-sdk VERSION ${VTK_VERSION} From 8a6f556b9e60ee3dc74bf45e498a616aec0c3482 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 11:34:11 -0400 Subject: [PATCH 05/33] docs: improve comments/docstrings for install steps and entry point --- CMakeLists.txt | 4 ++-- src/vtk_sdk/cmake/__init__.py | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eb97e9e..8f78c0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,8 +33,8 @@ FetchContent_Populate( set(VTK_SDK_INSTALL_DIR "content") -# "/" after ${extract_dir} is required so the folder content is copied to dest, -# instead of the folder itself! +# Append "/" after ${extract_dir} to ensure folder content is copied to the +# destination, instead of the folder itself. install( DIRECTORY ${extract_dir}/ DESTINATION vtk_sdk/${VTK_SDK_INSTALL_DIR} diff --git a/src/vtk_sdk/cmake/__init__.py b/src/vtk_sdk/cmake/__init__.py index 7739ada..07d3077 100644 --- a/src/vtk_sdk/cmake/__init__.py +++ b/src/vtk_sdk/cmake/__init__.py @@ -1 +1,3 @@ -# This module is here because the path of the actual vtk-config.cmake file is not a valid module name +"""This module serves as `cmake-module` scikit-build-core entrypoint to +lookup the location of the `vtk-config.cmake` and `vtk-config-version.cmake` files. +""" From 7fbc121491a5361355b1fae93aea78516ab2aa9a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 11:27:04 -0400 Subject: [PATCH 06/33] fix: consolidate URL construction from python/abi/platform tag Use python, abi and platform tag terminology to match specification. See https://packaging.python.org/en/latest/specifications/platform-compatibility-tags/ --- cmake/vtk-sdk-urls.cmake | 47 ++++++++++++++++++++++++++++++---------- 1 file changed, 35 insertions(+), 12 deletions(-) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 608593a..42fc85c 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -1,13 +1,36 @@ -# VTK SDK is currently stored as a tar.xz archive on a Kitware hosted server -set(python_cp "cp${Python_VERSION_MAJOR}${Python_VERSION_MINOR}") - -# enable any linux to download the right tar.xz -if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") - set(VTK_SDK_BINARY_URL - "https://vtk.org/files/wheel-sdks/vtk-wheel-sdk-${VTK_VERSION}-${python_cp}-${python_cp}-manylinux_2_17_x86_64.manylinux2014_x86_64.tar.xz" - ) -else() - set(VTK_SDK_BINARY_URL - "https://vtk.org/files/wheel-sdks/vtk-wheel-sdk-${VTK_VERSION}-${python_cp}-${Python_SOABI}.tar.xz" - ) +# ---------------------------------------------------------------------------- +# Set URLs for downloading the VTK SDK stored as a tar.xz archive on Kitware +# hosted server + +message(STATUS "Setting VTK_SDK_BINARY_URL") + +# Python and ABI tags +set(python_tag "cp${Python_VERSION_MAJOR}${Python_VERSION_MINOR}") +set(abi_tag "${python_tag}") +message(STATUS " python_tag: ${python_tag}") +message(STATUS " abi_tag: ${abi_tag}") + +# Platform tag +if(LINUX AND Python_SOABI MATCHES "x86_64") + set(plaform_tag "manylinux_2_17_x86_64.manylinux2014_x86_64") +elseif(APPLE) + if(Python_SOABI MATCHES "x86_64") + set(plaform_tag "macosx_10_10_x86_64") + elseif(Python_SOABI MATCHES "arm64") + set(plaform_tag "macosx_11_0_arm64") + endif() +elseif(WIN32) + set(plaform_tag "win_amd64") endif() +if(NOT DEFINED plaform_tag) + message( + FATAL_ERROR + "Failed to set plaform_tag based of Python_SOABI [${Python_SOABI}]") +endif() +message(STATUS " plaform_tag: ${plaform_tag}") + +set(archive_name + "vtk-wheel-sdk-${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}.tar.xz" +) +set(VTK_SDK_BINARY_URL "https://vtk.org/files/wheel-sdks/${archive_name}") +message(STATUS "Setting VTK_SDK_BINARY_URL: ${VTK_SDK_BINARY_URL}") From 6436089bb4f38725582346cfcd9c6fe6ab2a4a16 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 12:38:10 -0400 Subject: [PATCH 07/33] fix: ensure macOS x86_64 platform tag is always set --- cmake/vtk-sdk-urls.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 42fc85c..6ad9556 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -14,9 +14,8 @@ message(STATUS " abi_tag: ${abi_tag}") if(LINUX AND Python_SOABI MATCHES "x86_64") set(plaform_tag "manylinux_2_17_x86_64.manylinux2014_x86_64") elseif(APPLE) - if(Python_SOABI MATCHES "x86_64") - set(plaform_tag "macosx_10_10_x86_64") - elseif(Python_SOABI MATCHES "arm64") + set(plaform_tag "macosx_10_10_x86_64") + if(Python_SOABI MATCHES "arm64") set(plaform_tag "macosx_11_0_arm64") endif() elseif(WIN32) From 4d0bcf4e7ade29fde6d0c8bd7a29e7f0ddd831a7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 12:25:36 -0400 Subject: [PATCH 08/33] feat: verify downloads via SHA256 checksums --- CMakeLists.txt | 4 +++- cmake/vtk-sdk-urls.cmake | 50 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8f78c0b..71b7a58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,7 +25,9 @@ set(extract_dir ${PROJECT_BINARY_DIR}/vtk-wheel-sdk) include(FetchContent) FetchContent_Populate( vtkwheelsdk - URL ${VTK_SDK_BINARY_URL} DOWNLOAD_DIR ${download_dir} + URL ${VTK_SDK_BINARY_URL} + URL_HASH SHA256=${VTK_SDK_EXPECTED_SHA256} + DOWNLOAD_DIR ${download_dir} SOURCE_DIR ${extract_dir}) # ---------------------------------------------------------------------------- diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 6ad9556..326584d 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -33,3 +33,53 @@ set(archive_name ) set(VTK_SDK_BINARY_URL "https://vtk.org/files/wheel-sdks/${archive_name}") message(STATUS "Setting VTK_SDK_BINARY_URL: ${VTK_SDK_BINARY_URL}") + +# ---------------------------------------------------------------------------- +# Set expected checksum + +message(STATUS "Setting VTK_SDK_EXPECTED_SHA256") + +set(sha256_9.2.5-cp38-cp38-macosx_10_10_x86_64 + "a97438851a029fc3e9a630261a101001f5fc2edae45710f1cb0cde2dd2899334") +set(sha256_9.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64 + "f67ab5114eeccda490bd5a7ab8e6921e0b59d51489e7f47eb0ebc7f18e7cbd93") +set(sha256_9.2.5-cp38-cp38-win_amd64 + "306360396efa3cffb03ecda75c4df84a89ededf05d0adfda4894d80adf2542ec") + +set(sha256_9.2.5-cp39-cp39-macosx_10_10_x86_64 + "6a63d28a726188194fa7858d33645f43ea9ef21e696b8da91cc0536cf4c9131a") +set(sha256_9.2.5-cp39-cp39-macosx_11_0_arm64 + "3747b3448b1ae0f511a389f82398a1ec5a883189ed01ed35c870ef746096ec6d") +set(sha256_9.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64 + "8199f0cff9a43831eadeba0e4d89421c947002c53c030c50edb50312bb0726cd") +set(sha256_9.2.5-cp39-cp39-win_amd64 + "befbbea3bfc8584c5dd3b2c04b5ce7273eeb4581a5586adf10cb35b859609026") + +set(sha256_9.2.5-cp310-cp310-macosx_10_10_x86_64 + "a0d37d8f93521753cb3bed8da3548f9f6c1f45cee493070b5dcc3801f62b33e5") +set(sha256_9.2.5-cp310-cp310-macosx_11_0_arm64 + "99120ac6448907865b1feb95be4111992d2d511954d2c381bd5299ec87c6f76c") +set(sha256_9.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64 + "79f8a8c6caf9d98aef29426637ea9eb9228682072dfa5b69bb97dc3baa2e93d7") +set(sha256_9.2.5-cp310-cp310-win_amd64 + "b85c5d48e6c36082c590276dd34458e5238cea7ae37156b5b30a2ca3e133d2b9") + +set(sha256_9.2.5-cp311-cp311-macosx_10_10_x86_64 + "f0bf60a0c740b9c92bb0f35cadb1f0c38d23b3994bdf24295ac986761dc6e59c") +set(sha256_9.2.5-cp311-cp311-macosx_11_0_arm64 + "d2948347e7c803d8e691b48d58dd057ddb2265baf603eb0d7036a71a538e037d") +set(sha256_9.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64 + "dcd452e018b3a5a7a0b5dfab8e38af2ddbd0e0e387b1a8488b4516354c4a30fb") +set(sha256_9.2.5-cp311-cp311-win_amd64 + "f70dca96484ba357fad52ce4d998b6480e5717e7e1d0f707f20c494c41d7a00e") + +if(NOT DEFINED sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}) + message( + FATAL_ERROR + "Variable sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag} is not defined" + ) +endif() + +set(VTK_SDK_EXPECTED_SHA256 + ${sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}}) +message(STATUS "Setting VTK_SDK_EXPECTED_SHA256: ${VTK_SDK_EXPECTED_SHA256}") From 7c6f3e4539cf71cd691dc20f123c15ca08836a72 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 12:32:28 -0400 Subject: [PATCH 09/33] =?UTF-8?q?ci:=20test=20CPython=203.8=E2=80=933.11;?= =?UTF-8?q?=20exclude=203.12=20(unsupported=20by=209.2.5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Exclude Python 3.12 not supported with VTK 9.2.5 SDKs --- .github/workflows/cd.yml | 4 ++++ .github/workflows/ci.yml | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 32f7da6..9e09239 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -37,6 +37,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest, windows-latest, macos-latest] + arch: ["auto"] steps: - uses: actions/checkout@v5 @@ -44,6 +45,9 @@ jobs: fetch-depth: 0 - uses: pypa/cibuildwheel@v3.2 + env: + CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*" + CIBW_ARCHS: "${{ matrix.arch }}" - name: Upload wheels uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e7bf72f..e4ff0e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,13 +40,9 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11"] runs-on: [ubuntu-latest, macos-latest, windows-latest] - include: - - python-version: pypy-3.10 - runs-on: ubuntu-latest - steps: - uses: actions/checkout@v5 with: From 55d4ed7741daec51d8db352d1428ca7dc8c7436e Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 13:52:29 -0400 Subject: [PATCH 10/33] ci: update cd.yml to publish wheels to PyPI (not TestPyPI) --- .github/workflows/cd.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9e09239..e1e8356 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -71,7 +71,3 @@ jobs: merge-multiple: true - uses: pypa/gh-action-pypi-publish@release/v1 - with: - # Remember to tell (test-)pypi about this repo before publishing - # Remove this line to publish to PyPI - repository-url: https://test.pypi.org/legacy/ From 599121247a34007785f539b6d9c7a4a91b9f65ef Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 14:13:23 -0400 Subject: [PATCH 11/33] ci: Update "cd.yml" adding "test_sdist" and "check_dist" jobs Adapted from https://github.com/scikit-build/cmake-python-distributions --- .github/workflows/cd.yml | 47 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e1e8356..e28f91c 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -30,6 +30,51 @@ jobs: name: cibw-sdist path: dist/*.tar.gz + test_sdist: + name: Test SDist with python ${{ matrix.python }} + needs: [make_sdist] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + name: Install Python ${{ matrix.python }} + with: + python-version: ${{ matrix.python }} + + - name: Install dependencies + run: | + pip install pytest pytest-cov + + - uses: actions/download-artifact@v4 + with: + name: cibw-sdist + path: dist + + - name: Install SDist + run: | + pip -V + pip install dist/*.tar.gz + rm -rf dist + + - name: Test installed SDist + run: pytest ./tests + + check_dist: + name: Check dist + needs: [build_wheels, make_sdist, test_sdist] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: all + + - run: pipx run twine check --strict all/*/* + build_wheels: name: Wheel on ${{ matrix.os }} runs-on: ${{ matrix.os }} @@ -56,7 +101,7 @@ jobs: path: wheelhouse/*.whl upload_all: - needs: [build_wheels, make_sdist] + needs: [check_dist] environment: pypi permissions: id-token: write From 9e29f66bd6e818d6def62d594960373cc8740e81 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 14:05:14 -0400 Subject: [PATCH 12/33] feat: Add support for generating macOS arm64 wheels --- .github/workflows/cd.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index e28f91c..a1b0d12 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -84,6 +84,10 @@ jobs: os: [ubuntu-latest, windows-latest, macos-latest] arch: ["auto"] + include: + - os: macos-14 + arch: "arm64" + steps: - uses: actions/checkout@v5 with: From cbd168df9eb392c07bcef93ad8e9a03e0017a4d3 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 14:30:08 -0400 Subject: [PATCH 13/33] ci: Test building of macOS arm64 wheels in CI workflow --- .github/workflows/ci.yml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e4ff0e5..99802bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -65,3 +65,33 @@ jobs: uses: codecov/codecov-action@v5.5.1 with: token: ${{ secrets.CODECOV_TOKEN }} + + checks-cibw: + name: > + Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} (${{ + matrix.arch }}) + runs-on: ${{ matrix.runs-on }} + needs: [pre-commit] + strategy: + fail-fast: false + matrix: + include: + - runs-on: macos-14 + python-version: cp39 + arch: "arm64" + - runs-on: macos-14 + python-version: cp310 + arch: "arm64" + - runs-on: macos-14 + python-version: cp311 + arch: "arm64" + + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + + - uses: pypa/cibuildwheel@v3.2 + env: + CIBW_BUILD: "${{ matrix.python-version }}-*" + CIBW_ARCHS: "${{ matrix.arch }}" From fa216b25fc7a232817e8c55e3db3733179eeb359 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 14:39:35 -0400 Subject: [PATCH 14/33] fix: Disable cibuildwheel repair command The vtk-sdk is expected to be distributed as-is without being modified using default repair commands. See https://cibuildwheel.pypa.io/en/1.x/options/#repair-wheel-command --- .github/workflows/cd.yml | 1 + .github/workflows/ci.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index a1b0d12..ef94de5 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -97,6 +97,7 @@ jobs: env: CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*" CIBW_ARCHS: "${{ matrix.arch }}" + CIBW_REPAIR_WHEEL_COMMAND: "" - name: Upload wheels uses: actions/upload-artifact@v4 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 99802bc..2d299c9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,3 +95,4 @@ jobs: env: CIBW_BUILD: "${{ matrix.python-version }}-*" CIBW_ARCHS: "${{ matrix.arch }}" + CIBW_REPAIR_WHEEL_COMMAND: "" From 5fffe74ebd0864f39dca359449dcb1ce20db5d17 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Wed, 27 Mar 2024 15:08:02 -0400 Subject: [PATCH 15/33] doc: Fix entrypoint references to consistently mention "cmake.prefix" --- CMakeLists.txt | 2 +- README.md | 2 +- src/vtk_sdk/__init__.py | 2 +- src/vtk_sdk/cmake/__init__.py | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71b7a58..f49303d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,7 +57,7 @@ install( WORLD_EXECUTE) # ---------------------------------------------------------------------------- -# Configure and install "cmake.module" entry point files +# Configure and install "cmake.prefix" entry point files configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/vtk-config.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config.cmake @ONLY) diff --git a/README.md b/README.md index bca51b2..5fa6fdd 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ distributed-memory parallel processing for scalability and better performance. This project is intended to distribute the content of the existing VTK wheel SDKs as first-class `vtk-sdk` wheels. -Each `vtk-sdk` Python wheel is equipped with a scikit-build-core `cmake-module` +Each `vtk-sdk` Python wheel is equipped with a scikit-build-core `cmake.prefix` [entrypoint][scikit-build-core-entrypoint], housing the official VTK SDK sourced from the corresponding [archive][wheel-sdks-link]. diff --git a/src/vtk_sdk/__init__.py b/src/vtk_sdk/__init__.py index d081a1d..d7e1c59 100644 --- a/src/vtk_sdk/__init__.py +++ b/src/vtk_sdk/__init__.py @@ -1,7 +1,7 @@ """ Copyright (c) 2024 Jean-Christophe Fillion-Robin. All rights reserved. -vtk-sdk: Distribution of the VTK wheel SDK with a convenient "cmake-module" scikit-build-core entrypoint +vtk-sdk: Distribution of the VTK wheel SDK with a convenient "cmake.prefix" scikit-build-core entrypoint """ from __future__ import annotations diff --git a/src/vtk_sdk/cmake/__init__.py b/src/vtk_sdk/cmake/__init__.py index 07d3077..e0de3db 100644 --- a/src/vtk_sdk/cmake/__init__.py +++ b/src/vtk_sdk/cmake/__init__.py @@ -1,3 +1,3 @@ -"""This module serves as `cmake-module` scikit-build-core entrypoint to +"""This module serves as `cmake.prefix` scikit-build-core entrypoint to lookup the location of the `vtk-config.cmake` and `vtk-config-version.cmake` files. """ From e0a167eb2b031e1c4b3d681dc63db3abbdfb9ab1 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 14:59:39 -0400 Subject: [PATCH 16/33] chore: Set CMake version range to 3.21..4.0 --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f49303d..581d77e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.21) +cmake_minimum_required(VERSION 3.21...4.0) set(VTK_VERSION "9.2.5") From 92d35b2776a8a0d7dbad22a4f733cd44fb7042bd Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Tue, 21 Oct 2025 12:45:44 -0400 Subject: [PATCH 17/33] style: Remove redundant blank lines in pyproject.toml --- pyproject.toml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index d931565..d7f7463 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,6 @@ requires = ["pybind11", "scikit-build-core"] build-backend = "scikit_build_core.build" - [project] name = "vtk-sdk" authors = [ @@ -66,17 +65,14 @@ metadata.version.provider = "scikit_build_core.metadata.setuptools_scm" sdist.include = ["src/vtk_sdk/_version.py"] wheel.packages = ["src/vtk_sdk"] - [tool.setuptools_scm] write_to = "src/vtk_sdk/_version.py" - [tool.cibuildwheel] test-command = "pytest {project}/tests" test-extras = ["test"] test-skip = ["*universal2:arm64"] - [tool.pytest.ini_options] minversion = "6.0" addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"] @@ -89,7 +85,6 @@ testpaths = [ "tests", ] - [tool.coverage] run.source = ["vtk_sdk"] report.exclude_also = [ From 78951a56def1138e22558923635efc5d9ce931da Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Thu, 3 Jul 2025 09:54:21 +0200 Subject: [PATCH 18/33] ci: Fetch tags from fork to simplify VTK version updates --- .github/workflows/ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2d299c9..5f579eb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,6 +48,14 @@ jobs: with: fetch-depth: 0 + - name: Fetch tags from fork if PR is from a fork + if: + ${{ github.event.pull_request.head.repo.full_name != github.repository + }} + run: | + git remote add fork https://github.com/${{ github.event.pull_request.head.repo.full_name }}.git + git fetch fork --tags + - uses: actions/setup-python@v6 with: python-version: ${{ matrix.python-version }} From 4ad0ec5db213f5c5cabf8d56be3ae5cc130cfabd Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Mon, 5 Aug 2024 15:44:03 +0200 Subject: [PATCH 19/33] ci: install opengl loader on Ubuntu --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f579eb..5c92a5d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -61,6 +61,10 @@ jobs: python-version: ${{ matrix.python-version }} allow-prereleases: true + - name: Install OpenGL libraries + if: ${{ matrix.runs-on == 'ubuntu-latest' }} + run: sudo apt-get install --fix-missing libgl1-mesa-dev + - name: Install package run: python -m pip install .[test] From f382f0005ecd99129d9086fe81312fd761fe8772 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Tue, 12 Nov 2024 15:40:56 +0100 Subject: [PATCH 20/33] feat: bump VTK to 9.5.0 This updates the VTK version to 9.5.0. Co-authored-by: Jean-Christophe Fillion-Robin --- .github/workflows/ci.yml | 2 +- CMakeLists.txt | 2 +- cmake/vtk-sdk-urls.cmake | 92 ++++++++++++++++++++++++++-------------- 3 files changed, 63 insertions(+), 33 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c92a5d..04fd2c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: - name: Install OpenGL libraries if: ${{ matrix.runs-on == 'ubuntu-latest' }} - run: sudo apt-get install --fix-missing libgl1-mesa-dev + run: sudo apt-get install --fix-missing libgl-dev - name: Install package run: python -m pip install .[test] diff --git a/CMakeLists.txt b/CMakeLists.txt index 581d77e..49f035e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.21...4.0) -set(VTK_VERSION "9.2.5") +set(VTK_VERSION "9.5.0") # major.minor.patch project( vtk-sdk diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 326584d..9fa6460 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -12,7 +12,7 @@ message(STATUS " abi_tag: ${abi_tag}") # Platform tag if(LINUX AND Python_SOABI MATCHES "x86_64") - set(plaform_tag "manylinux_2_17_x86_64.manylinux2014_x86_64") + set(plaform_tag "manylinux2014_x86_64.manylinux_2_17_x86_64") elseif(APPLE) set(plaform_tag "macosx_10_10_x86_64") if(Python_SOABI MATCHES "arm64") @@ -39,39 +39,69 @@ message(STATUS "Setting VTK_SDK_BINARY_URL: ${VTK_SDK_BINARY_URL}") message(STATUS "Setting VTK_SDK_EXPECTED_SHA256") -set(sha256_9.2.5-cp38-cp38-macosx_10_10_x86_64 - "a97438851a029fc3e9a630261a101001f5fc2edae45710f1cb0cde2dd2899334") -set(sha256_9.2.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64 - "f67ab5114eeccda490bd5a7ab8e6921e0b59d51489e7f47eb0ebc7f18e7cbd93") -set(sha256_9.2.5-cp38-cp38-win_amd64 - "306360396efa3cffb03ecda75c4df84a89ededf05d0adfda4894d80adf2542ec") +set(sha256_9.5.0-cp38-cp38-macosx_10_10_x86_64 + "aa9785854382bf050e8149ab1b0bce4b6aa4c8988c466d9995ba1ff9f46f92e4") +set(sha256_9.5.0-cp38-cp38-manylinux2014_x86_64.manylinux_2_17_x86_64 + "8c77a54b6b9b782d4df12635dc08f9bb952e50d62d218da6848df5ef30608f85") +set(sha256_9.5.0-cp38-cp38-manylinux_2_28_aarch64 + "1fb7a5d5c57e282f2248dfb00b602e4354b6a4c4f71ecc577baf72abd3cedbd3") +set(sha256_9.5.0-cp38-cp38-win_amd64 + "3427a5ae0940a250f1254a664e70b16b33256f09738c397c9023c7868962d319") -set(sha256_9.2.5-cp39-cp39-macosx_10_10_x86_64 - "6a63d28a726188194fa7858d33645f43ea9ef21e696b8da91cc0536cf4c9131a") -set(sha256_9.2.5-cp39-cp39-macosx_11_0_arm64 - "3747b3448b1ae0f511a389f82398a1ec5a883189ed01ed35c870ef746096ec6d") -set(sha256_9.2.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64 - "8199f0cff9a43831eadeba0e4d89421c947002c53c030c50edb50312bb0726cd") -set(sha256_9.2.5-cp39-cp39-win_amd64 - "befbbea3bfc8584c5dd3b2c04b5ce7273eeb4581a5586adf10cb35b859609026") +set(sha256_9.5.0-cp39-cp39-macosx_10_10_x86_64 + "b11f9a6269370eeac12832614b14f8fc9a8ad07f2eec4773c6e4fd3c9feae613") +set(sha256_9.5.0-cp39-cp39-macosx_11_0_arm64 + "16f365d6327a03c46c8c0670ac327e7ab9cf09e7e2c54aaba7802fc87256acd2") +set(sha256_9.5.0-cp39-cp39-manylinux2014_x86_64.manylinux_2_17_x86_64 + "c53a78818e5be5097f140ced0958de27b5b00aec4019071643c6757b382ec346") +set(sha256_9.5.0-cp39-cp39-manylinux_2_28_aarch64 + "81383e4ddcba3f36f19faaf08c169a75ba72c87cde25eb714619b77aeb899560") +set(sha256_9.5.0-cp39-cp39-win_amd64 + "29d42bf55b8e0a56c570914bdc19fa893f388b44c7a75adbac6f00c6b728f1e4") -set(sha256_9.2.5-cp310-cp310-macosx_10_10_x86_64 - "a0d37d8f93521753cb3bed8da3548f9f6c1f45cee493070b5dcc3801f62b33e5") -set(sha256_9.2.5-cp310-cp310-macosx_11_0_arm64 - "99120ac6448907865b1feb95be4111992d2d511954d2c381bd5299ec87c6f76c") -set(sha256_9.2.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64 - "79f8a8c6caf9d98aef29426637ea9eb9228682072dfa5b69bb97dc3baa2e93d7") -set(sha256_9.2.5-cp310-cp310-win_amd64 - "b85c5d48e6c36082c590276dd34458e5238cea7ae37156b5b30a2ca3e133d2b9") +set(sha256_9.5.0-cp310-cp310-macosx_10_10_x86_64 + "2bea290714bc7bcc2ff4410d347bb5bef1e2dc7fe1e17259dedb26565324a68d") +set(sha256_9.5.0-cp310-cp310-macosx_11_0_arm64 + "499cc8a3fe2e650ba0b3bf280b41ae537ff44a2ce2f1641759a9ebdd03f51ca9") +set(sha256_9.5.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64 + "1eadf905db2a52c712aa5102f3b39b99d948771227f0892fb3e1696d0506893d") +set(sha256_9.5.0-cp310-cp310-manylinux_2_28_aarch64 + "bc3eb9f34415d5cadc30d5b1f25f7779327e48c871aff768e54943ef28cd25e8") +set(sha256_9.5.0-cp310-cp310-win_amd64 + "cccc2dc62a52faf92e6bfc1530bdc2be4a72a859021f284a729971e570a6cee1") -set(sha256_9.2.5-cp311-cp311-macosx_10_10_x86_64 - "f0bf60a0c740b9c92bb0f35cadb1f0c38d23b3994bdf24295ac986761dc6e59c") -set(sha256_9.2.5-cp311-cp311-macosx_11_0_arm64 - "d2948347e7c803d8e691b48d58dd057ddb2265baf603eb0d7036a71a538e037d") -set(sha256_9.2.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64 - "dcd452e018b3a5a7a0b5dfab8e38af2ddbd0e0e387b1a8488b4516354c4a30fb") -set(sha256_9.2.5-cp311-cp311-win_amd64 - "f70dca96484ba357fad52ce4d998b6480e5717e7e1d0f707f20c494c41d7a00e") +set(sha256_9.5.0-cp311-cp311-macosx_10_10_x86_64 + "8509be39dcdcfa20f6fcfceeb41ebc4d90d0039e4439d8ba30f3e79ea39eaa53") +set(sha256_9.5.0-cp311-cp311-macosx_11_0_arm64 + "97f727d87ec88b75b52d76d46ecf2d6340ec5985caa60df3bcf0019046d32b52") +set(sha256_9.5.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64 + "7e21c4463376c16ddbbd9403a751b19553707152a0377cb07548a66838352710") +set(sha256_9.5.0-cp311-cp311-manylinux_2_28_aarch64 + "30f9a53d8d85af0b5c3a489525af32145f446f052d586d832ba162731d992a76") +set(sha256_9.5.0-cp311-cp311-win_amd64 + "dbe5e7a40c13060964dfa002225d808b9a735c52cc014ae3592bf5eec85cdb66") + +set(sha256_9.5.0-cp312-cp312-macosx_10_10_x86_64 + "8751917491635db56a3e877e167dcea5f4465cc8ac9c3e0143d781aaf34a6e8a") +set(sha256_9.5.0-cp312-cp312-macosx_11_0_arm64 + "5d1075389d0a865143c76e3510a4ed17f8e0ae3e420da23e58a129ef260f6ab8") +set(sha256_9.5.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64 + "a0c629cae58e52fd19401adc8c88ce52e047ade1c200a9faff4fc732a3ab22bd") +set(sha256_9.5.0-cp312-cp312-manylinux_2_28_aarch64 + "67f620ba3a8ca3c5b2d16a548c46283b41e1e042012691b6dcc0066d8a9aa757") +set(sha256_9.5.0-cp312-cp312-win_amd64 + "1ccd922f8e68c06cca116f345a9de21858d9e882706f86eddee1caf93b43a923") + +set(sha256_9.5.0-cp313-cp313-macosx_10_10_x86_64 + "566f1050cbf88b72e66a18a2e1f34265045f62dd134ee867e320cc4907f8951f") +set(sha256_9.5.0-cp313-cp313-macosx_11_0_arm64 + "73419c913f077e721c3ccdf2b638be49356cd30d5bdf7f5dcfafb2064e936008") +set(sha256_9.5.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64 + "59ad0e395d7e57eb8b850f990ee7bdcb5074c25fa11a2d6da1c46b695a715659") +set(sha256_9.5.0-cp313-cp313-manylinux_2_28_aarch64 + "b221f3c3526ac7c437be3966d3abe80b0e68d141a176d67fe4a69741530038c3") +set(sha256_9.5.0-cp313-cp313-win_amd64 + "0adaf743d9d1882afe512ad3d8182ae43ec37ffc38dd42a6752ab1ad8073b288") if(NOT DEFINED sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}) message( From c944ea63e492dcbef25c78aa18c60934e45eea16 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Tue, 21 Oct 2025 16:07:10 -0400 Subject: [PATCH 21/33] fix: override setuptools_scm to nearest tag; align CMake version check - Explicitly set setuptools_scm to derive the version from the nearest tag name only: git describe --tags --abbrev=0 --match "*[0-9]*" This yields a clean tag (e.g., 9.5.0) without distance/hash, making wheels/tag-based releases deterministic. - In CMake, compare it with VTK_VERSION and emit a warning if they differ. Trade-off: by removing distance/hash, non-tag builds will look like the nearest tag. This is intentional here to keep package versions aligned with SDK tags. Co-authored-by: Jean-Christophe Fillion-Robin --- CMakeLists.txt | 15 +++++++++++++++ pyproject.toml | 1 + 2 files changed, 16 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49f035e..4fb74a9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,21 @@ cmake_minimum_required(VERSION 3.21...4.0) +# Version diagnostics: +# +# * setuptools_scm (overridden) provides a clean nearest tag as project version +# via: git describe --tags --abbrev=0 --match "*[0-9]*" +# * Compare VTK_VERSION to that clean tag (normalized) and warn on mismatch. set(VTK_VERSION "9.5.0") # major.minor.patch +message(STATUS "SKBUILD_PROJECT_VERSION: ${SKBUILD_PROJECT_VERSION}") +message(STATUS " VTK_VERSION: ${VTK_VERSION}") +if(NOT VTK_VERSION VERSION_EQUAL SKBUILD_PROJECT_VERSION) + message( + WARNING + "Hardcoded VTK version \"${VTK_VERSION}\" disagrees from git tag version \"${SKBUILD_PROJECT_VERSION}\"." + "This check is performed to ensure that the version is the intended one, especially when a specific tag is checked out." + "Please ensure that git tags are up to date and that VTK_VERSION has the expected value." + ) +endif() project( vtk-sdk diff --git a/pyproject.toml b/pyproject.toml index d7f7463..4c1aaf2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -66,6 +66,7 @@ sdist.include = ["src/vtk_sdk/_version.py"] wheel.packages = ["src/vtk_sdk"] [tool.setuptools_scm] +git_describe_command = [ "git", "describe", "--tags" ] # we are only interested by last tag name write_to = "src/vtk_sdk/_version.py" [tool.cibuildwheel] From 883bc08f8a296bff8abb0312684b3355e4f8bd8f Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Thu, 3 Jul 2025 09:53:40 +0200 Subject: [PATCH 22/33] =?UTF-8?q?feat:=20support=20CPython=203.10=E2=80=93?= =?UTF-8?q?3.13=20(drop=203.8=E2=80=933.9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This drops support for Python 3.8 and 3.9 as they are nearing or have reached end-of-life, and adds support for Python 3.12 and 3.13: - Python 3.8 is end-of-life since 2024-10-07 - Python 3.9 will be end-of-life at the end of 2025-10 See https://devguide.python.org/versions Co-authored-by: Jean-Christophe Fillion-Robin --- .github/workflows/cd.yml | 4 ++-- .github/workflows/ci.yml | 11 +++++++---- pyproject.toml | 9 ++++----- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index ef94de5..41d5569 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -37,7 +37,7 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.8", "3.9", "3.10", "3.11"] + python: ["3.10", "3.11", "3.12", "3.13"] steps: - uses: actions/checkout@v4 @@ -95,7 +95,7 @@ jobs: - uses: pypa/cibuildwheel@v3.2 env: - CIBW_BUILD: "cp38-* cp39-* cp310-* cp311-*" + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" CIBW_ARCHS: "${{ matrix.arch }}" CIBW_REPAIR_WHEEL_COMMAND: "" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 04fd2c6..4009014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ["3.8", "3.9", "3.10", "3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: [ubuntu-latest, macos-latest, windows-latest] steps: @@ -88,15 +88,18 @@ jobs: fail-fast: false matrix: include: - - runs-on: macos-14 - python-version: cp39 - arch: "arm64" - runs-on: macos-14 python-version: cp310 arch: "arm64" - runs-on: macos-14 python-version: cp311 arch: "arm64" + - runs-on: macos-14 + python-version: cp312 + arch: "arm64" + - runs-on: macos-14 + python-version: cp313 + arch: "arm64" steps: - uses: actions/checkout@v5 diff --git a/pyproject.toml b/pyproject.toml index 4c1aaf2..dcdbaba 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ description = "Distribution of the VTK wheel SDKs as first-class Python wheels" readme = "README.md" license.file = "LICENSE" -requires-python = ">=3.8" +requires-python = ">=3.10" classifiers = [ "Development Status :: 1 - Planning", "Intended Audience :: Science/Research", @@ -21,11 +21,10 @@ classifiers = [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Topic :: Scientific/Engineering", "Typing :: Typed", ] @@ -95,7 +94,7 @@ report.exclude_also = [ [tool.mypy] files = ["src", "tests"] -python_version = "3.8" +python_version = "3.10" warn_unused_configs = true strict = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] @@ -151,7 +150,7 @@ isort.required-imports = ["from __future__ import annotations"] [tool.pylint] -py-version = "3.8" +py-version = "3.10" ignore-paths = [".*/_version.py"] extension-pkg-allow-list = ["vtk_sdk._core"] reports.output-format = "colorized" From 7b5570d82b039ec5ceb41a2c459fe1efc19f7661 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Thu, 3 Jul 2025 10:10:23 +0200 Subject: [PATCH 23/33] fix: add Linux aarch64 manylinux platform tag --- cmake/vtk-sdk-urls.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 9fa6460..8cf60e4 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -11,8 +11,12 @@ message(STATUS " python_tag: ${python_tag}") message(STATUS " abi_tag: ${abi_tag}") # Platform tag -if(LINUX AND Python_SOABI MATCHES "x86_64") - set(plaform_tag "manylinux2014_x86_64.manylinux_2_17_x86_64") +if(LINUX) + if(Python_SOABI MATCHES "x86_64") + set(plaform_tag "manylinux2014_x86_64.manylinux_2_17_x86_64") + elseif(Python_SOABI MATCHES "aarch64") + set(plaform_tag "manylinux_2_28_aarch64") + endif() elseif(APPLE) set(plaform_tag "macosx_10_10_x86_64") if(Python_SOABI MATCHES "arm64") From 56e7c3bf416df5809294afb7ad2d1a00da1ecde3 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Thu, 28 Mar 2024 15:55:01 +0100 Subject: [PATCH 24/33] test: add integration test for VTK find_package support This adds a test project that verifies the ability to use `find_package(VTK REQUIRED)` in a scikit-build-core-based Python package. - Adds `CMakeLists.txt` and `pyproject.toml` under `tests/packages/find_package` - Creates a minimal Python package (`vtk_simple`) as the test subject - Implements `test_find_package.py` to build the wheel using `pip wheel` in an isolated virtualenv with a custom wheelhouse if provided - Install vtk-sdk package before using it Co-authored-by: Jean-Christophe Fillion-Robin --- .pre-commit-config.yaml | 1 + pyproject.toml | 1 + tests/packages/find_package/CMakeLists.txt | 8 ++ tests/packages/find_package/pyproject.toml | 12 +++ tests/packages/src/vtk_simple/__init__.py | 0 tests/test_find_package.py | 104 +++++++++++++++++++++ 6 files changed, 126 insertions(+) create mode 100644 tests/packages/find_package/CMakeLists.txt create mode 100644 tests/packages/find_package/pyproject.toml create mode 100644 tests/packages/src/vtk_simple/__init__.py create mode 100644 tests/test_find_package.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0f277c4..d2d36c4 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -60,6 +60,7 @@ repos: args: [] additional_dependencies: - pytest + - virtualenv - repo: https://github.com/codespell-project/codespell rev: "v2.2.6" diff --git a/pyproject.toml b/pyproject.toml index dcdbaba..3a2665a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,6 +35,7 @@ dependencies = [] test = [ "pytest >=6", "pytest-cov >=3", + "virtualenv", ] dev = [ "pytest >=6", diff --git a/tests/packages/find_package/CMakeLists.txt b/tests/packages/find_package/CMakeLists.txt new file mode 100644 index 0000000..7afdf44 --- /dev/null +++ b/tests/packages/find_package/CMakeLists.txt @@ -0,0 +1,8 @@ +cmake_minimum_required(VERSION 3.21...4.0) + +project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION}) + +find_package(Python COMPONENTS Interpreter Development.Module) + +set(expected_version "9.5.0") +find_package(VTK ${expected_version} REQUIRED) diff --git a/tests/packages/find_package/pyproject.toml b/tests/packages/find_package/pyproject.toml new file mode 100644 index 0000000..32a838c --- /dev/null +++ b/tests/packages/find_package/pyproject.toml @@ -0,0 +1,12 @@ +[build-system] +requires = ["scikit-build-core", "vtk-sdk"] +build-backend = "scikit_build_core.build" + +[project] +name = "vtk-sdk-test" +version = "1.0.0" +authors = [ + { name = "Alexy Pellegrini", email = "alexy.pellegrini@kitware.com" }, + { name = "Jean-Christophe Fillion-Robin", email = "jchris.fillionr@kitware.com" }, +] +dependencies = [] diff --git a/tests/packages/src/vtk_simple/__init__.py b/tests/packages/src/vtk_simple/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/tests/test_find_package.py b/tests/test_find_package.py new file mode 100644 index 0000000..6e07334 --- /dev/null +++ b/tests/test_find_package.py @@ -0,0 +1,104 @@ +from __future__ import annotations + +import os +import subprocess +import sys +from pathlib import Path +from typing import Literal, overload + +import pytest +import virtualenv as _virtualenv # type: ignore[import-untyped] + +DIR = Path(__file__).parent.resolve() +BASE = DIR / "packages" / "find_package" + + +class VEnv: + def __init__(self, env_dir: Path, *, wheelhouse: Path | None = None) -> None: + cmd = [str(env_dir), "--no-setuptools", "--no-wheel", "--activators", ""] + result = _virtualenv.cli_run(cmd, setup_logging=False) + self.wheelhouse = wheelhouse + self.executable = Path(result.creator.exe) + self.env_dir = env_dir.resolve() + self.platlib = Path( + self.execute("import sysconfig; print(sysconfig.get_path('platlib'))") + ) + self.purelib = Path( + self.execute("import sysconfig; print(sysconfig.get_path('purelib'))") + ) + + @overload + def run(self, *args: str, capture: Literal[True]) -> str: ... + + @overload + def run(self, *args: str, capture: Literal[False] = ...) -> None: ... + + def run(self, *args: str, capture: bool = False) -> str | None: + __tracebackhide__ = True + env = os.environ.copy() + paths = {str(self.executable.parent)} + env["PATH"] = os.pathsep.join([*paths, env["PATH"]]) + env["VIRTUAL_ENV"] = str(self.env_dir) + env["PIP_DISABLE_PIP_VERSION_CHECK"] = "ON" + if self.wheelhouse is not None: + env["PIP_NO_INDEX"] = "ON" + env["PIP_FIND_LINKS"] = str(self.wheelhouse) + + str_args = [os.fspath(a) for a in args] + + # Windows does not make a python shortcut in venv + if str_args[0] in {"python", "python3"}: + str_args[0] = str(self.executable) + + if capture: + result = subprocess.run( + str_args, + check=False, + capture_output=True, + text=True, + env=env, + ) + if result.returncode != 0: + print(result.stdout, file=sys.stdout) + print(result.stderr, file=sys.stderr) + print("FAILED RUN:", *str_args, file=sys.stderr) + raise SystemExit(result.returncode) + return result.stdout.strip() + + result_bytes = subprocess.run( + str_args, + check=False, + env=env, + ) + if result_bytes.returncode != 0: + print("FAILED RUN:", *str_args, file=sys.stderr) + raise SystemExit(result_bytes.returncode) + return None + + def execute(self, command: str) -> str: + return self.run(str(self.executable), "-c", command, capture=True) + + def module(self, *args: str) -> None: + return self.run(str(self.executable), "-m", *args) + + def install(self, *args: str, isolated: bool = True) -> None: + isolated_flags = "" if isolated else ["--no-build-isolation"] + self.module("pip", "install", *isolated_flags, *args) + + +@pytest.fixture() +def virtualenv(tmp_path: Path) -> VEnv: + path = tmp_path / "venv" + return VEnv(path) + + +ROOT = DIR.parent + + +def test_find_package(virtualenv: VEnv, tmp_path: Path): + virtualenv.run( + "python", "-m", "pip", "wheel", str(ROOT), "--wheel-dir", str(tmp_path) + ) + virtualenv.run( + "python", "-m", "pip", "install", "--find-links", str(tmp_path), str(BASE) + ) From 6643afe851c01a16f2e625470c9f7bcce44273e7 Mon Sep 17 00:00:00 2001 From: Alexy Pellegrini Date: Thu, 3 Jul 2025 11:32:59 +0200 Subject: [PATCH 25/33] fix(test): skip non-module/OpenXR components during resolution --- tests/packages/find_package/CMakeLists.txt | 28 +++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tests/packages/find_package/CMakeLists.txt b/tests/packages/find_package/CMakeLists.txt index 7afdf44..614d87c 100644 --- a/tests/packages/find_package/CMakeLists.txt +++ b/tests/packages/find_package/CMakeLists.txt @@ -5,4 +5,30 @@ project(${SKBUILD_PROJECT_NAME} VERSION ${SKBUILD_PROJECT_VERSION}) find_package(Python COMPONENTS Interpreter Development.Module) set(expected_version "9.5.0") -find_package(VTK ${expected_version} REQUIRED) +find_package(VTK ${expected_version}) + +set(skipped_components + # Not VTK modules, from + # https://gitlab.kitware.com/vtk/vtk/-/blob/master/CMake/vtkInstallCMakePackage.cmake#L19 + WrapHierarchy + vtkbuild + vtkplatform + vtkpython + pvtkpython + WrapPython + WrapPythonInit + vtkjava + ParseJava + WrapJava + vtkWebAssemblyTestLinkOptions + # Public dependency to OpenXR loader + RenderingOpenXR + RenderingOpenXRRemoting) +foreach(comp IN LISTS VTK_AVAILABLE_COMPONENTS) + if("${skipped_components}" MATCHES "${comp}") + continue() + endif() + if(NOT VTK_${comp}_FOUND) + message(SEND_ERROR "Expected VTK component \"${comp}\" could not be found!") + endif() +endforeach() From 39f888cb7289667d2d6f256ca40c152a829c7b9f Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 15:25:34 -0400 Subject: [PATCH 26/33] docs(test): Add comment and docstrings to `test_find_package` --- tests/test_find_package.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/tests/test_find_package.py b/tests/test_find_package.py index 6e07334..20b2a50 100644 --- a/tests/test_find_package.py +++ b/tests/test_find_package.py @@ -9,17 +9,24 @@ import pytest import virtualenv as _virtualenv # type: ignore[import-untyped] +# Root test directory and path to the test package DIR = Path(__file__).parent.resolve() BASE = DIR / "packages" / "find_package" +ROOT = DIR.parent class VEnv: + """Manages an isolated virtual environment for testing""" + def __init__(self, env_dir: Path, *, wheelhouse: Path | None = None) -> None: + # Create a virtual environment without setuptools and wheel cmd = [str(env_dir), "--no-setuptools", "--no-wheel", "--activators", ""] result = _virtualenv.cli_run(cmd, setup_logging=False) self.wheelhouse = wheelhouse self.executable = Path(result.creator.exe) self.env_dir = env_dir.resolve() + + # Retrieve install locations (used for debugging or inspection) self.platlib = Path( self.execute("import sysconfig; print(sysconfig.get_path('platlib'))") ) @@ -35,11 +42,15 @@ def run(self, *args: str, capture: Literal[False] = ...) -> None: ... def run(self, *args: str, capture: bool = False) -> str | None: __tracebackhide__ = True + + # Prepare environment variables for subprocess env = os.environ.copy() paths = {str(self.executable.parent)} env["PATH"] = os.pathsep.join([*paths, env["PATH"]]) env["VIRTUAL_ENV"] = str(self.env_dir) env["PIP_DISABLE_PIP_VERSION_CHECK"] = "ON" + + # Use local wheelhouse if provided if self.wheelhouse is not None: env["PIP_NO_INDEX"] = "ON" env["PIP_FIND_LINKS"] = str(self.wheelhouse) @@ -50,6 +61,7 @@ def run(self, *args: str, capture: bool = False) -> str | None: if str_args[0] in {"python", "python3"}: str_args[0] = str(self.executable) + # Run and optionally capture output if capture: result = subprocess.run( str_args, @@ -88,17 +100,20 @@ def install(self, *args: str, isolated: bool = True) -> None: @pytest.fixture() def virtualenv(tmp_path: Path) -> VEnv: + """Provides a fresh virtualenv for each test run""" path = tmp_path / "venv" return VEnv(path) -ROOT = DIR.parent - - def test_find_package(virtualenv: VEnv, tmp_path: Path): + """Ensure that the VTK SDK can be found using find_package inside CMake""" + + # Step 1: Build the test wheel using scikit-build-core and VTK SDK virtualenv.run( "python", "-m", "pip", "wheel", str(ROOT), "--wheel-dir", str(tmp_path) ) + + # Step 2: Install the wheel built from the test project (using find_package(VTK)) virtualenv.run( "python", "-m", "pip", "install", "--find-links", str(tmp_path), str(BASE) ) From f6e0c2638602cc09e15c721be4d5bf01fa467c92 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 16:40:04 -0400 Subject: [PATCH 27/33] chore: Display SKBUILD_SOABI and Python_SOABI --- cmake/vtk-sdk-urls.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 8cf60e4..5ba7194 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -2,6 +2,9 @@ # Set URLs for downloading the VTK SDK stored as a tar.xz archive on Kitware # hosted server +message(STATUS "SKBUILD_SOABI: ${SKBUILD_SOABI}") +message(STATUS "Python_SOABI: ${Python_SOABI}") + message(STATUS "Setting VTK_SDK_BINARY_URL") # Python and ABI tags From 928923996d8ca8bc7709a0b493ef0be959ba155c Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 16:57:30 -0400 Subject: [PATCH 28/33] ci: Update CI workflow to exercise cibuildwheel for all platforms --- .github/workflows/ci.yml | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4009014..24aa944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: matrix: python-version: ["3.10", "3.11", "3.12", "3.13"] runs-on: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: macos-14 + arch: "arm64" steps: - uses: actions/checkout@v5 @@ -80,25 +83,17 @@ jobs: checks-cibw: name: > - Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }} (${{ - matrix.arch }}) + Check Python Wheel on ${{ matrix.runs-on }} (${{matrix.arch }}) runs-on: ${{ matrix.runs-on }} needs: [pre-commit] strategy: fail-fast: false matrix: + runs-on: [ubuntu-latest, windows-latest, macos-15-intel] + arch: ["auto"] + include: - runs-on: macos-14 - python-version: cp310 - arch: "arm64" - - runs-on: macos-14 - python-version: cp311 - arch: "arm64" - - runs-on: macos-14 - python-version: cp312 - arch: "arm64" - - runs-on: macos-14 - python-version: cp313 arch: "arm64" steps: @@ -108,6 +103,6 @@ jobs: - uses: pypa/cibuildwheel@v3.2 env: - CIBW_BUILD: "${{ matrix.python-version }}-*" + CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*" CIBW_ARCHS: "${{ matrix.arch }}" CIBW_REPAIR_WHEEL_COMMAND: "" From 22aeec080233a755d470e30c69558533ea37d830 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 18:05:35 -0400 Subject: [PATCH 29/33] fix: Ensure platform_tag is properly set on macOS Since `Python_SOABI` is set to value like `cpython-XYZ-darwin`, instead checks the value of `CMAKE_SYSTEM_PROCESSOR`. --- cmake/vtk-sdk-urls.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 5ba7194..0687b72 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -4,6 +4,7 @@ message(STATUS "SKBUILD_SOABI: ${SKBUILD_SOABI}") message(STATUS "Python_SOABI: ${Python_SOABI}") +message(STATUS "CMAKE_SYSTEM_PROCESSOR: ${CMAKE_SYSTEM_PROCESSOR}") message(STATUS "Setting VTK_SDK_BINARY_URL") @@ -21,8 +22,9 @@ if(LINUX) set(plaform_tag "manylinux_2_28_aarch64") endif() elseif(APPLE) - set(plaform_tag "macosx_10_10_x86_64") - if(Python_SOABI MATCHES "arm64") + if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + set(plaform_tag "macosx_10_10_x86_64") + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") set(plaform_tag "macosx_11_0_arm64") endif() elseif(WIN32) From 762f572606f54faae530ed19be3e1a87482a8ca7 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 18:15:44 -0400 Subject: [PATCH 30/33] fix: Skip Windows 32bit builds --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 3a2665a..efd6c65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -70,6 +70,7 @@ git_describe_command = [ "git", "describe", "--tags" ] # we are only interested write_to = "src/vtk_sdk/_version.py" [tool.cibuildwheel] +skip = ["*-win32"] test-command = "pytest {project}/tests" test-extras = ["test"] test-skip = ["*universal2:arm64"] From 20a96fe7eb5846a0226834d738fe1fff863a5001 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 18:18:58 -0400 Subject: [PATCH 31/33] ci: Update CD workflow to explicitly use "macos-15-intel" for macOS x86_64 --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 41d5569..a917491 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -81,7 +81,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, windows-latest, macos-latest] + os: [ubuntu-latest, windows-latest, macos-15-intel] arch: ["auto"] include: From e256ac324cec2860190d6168cc06beba077e9660 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 18:54:34 -0400 Subject: [PATCH 32/33] chore: Fix typo in cmake/vtk-sdk-urls.cmake Change `plaform_tag` to `platform_tag` Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- cmake/vtk-sdk-urls.cmake | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/cmake/vtk-sdk-urls.cmake b/cmake/vtk-sdk-urls.cmake index 0687b72..1cc7c7e 100644 --- a/cmake/vtk-sdk-urls.cmake +++ b/cmake/vtk-sdk-urls.cmake @@ -17,28 +17,28 @@ message(STATUS " abi_tag: ${abi_tag}") # Platform tag if(LINUX) if(Python_SOABI MATCHES "x86_64") - set(plaform_tag "manylinux2014_x86_64.manylinux_2_17_x86_64") + set(platform_tag "manylinux2014_x86_64.manylinux_2_17_x86_64") elseif(Python_SOABI MATCHES "aarch64") - set(plaform_tag "manylinux_2_28_aarch64") + set(platform_tag "manylinux_2_28_aarch64") endif() elseif(APPLE) if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") - set(plaform_tag "macosx_10_10_x86_64") + set(platform_tag "macosx_10_10_x86_64") elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64") - set(plaform_tag "macosx_11_0_arm64") + set(platform_tag "macosx_11_0_arm64") endif() elseif(WIN32) - set(plaform_tag "win_amd64") + set(platform_tag "win_amd64") endif() -if(NOT DEFINED plaform_tag) +if(NOT DEFINED platform_tag) message( FATAL_ERROR - "Failed to set plaform_tag based of Python_SOABI [${Python_SOABI}]") + "Failed to set platform_tag based of Python_SOABI [${Python_SOABI}]") endif() -message(STATUS " plaform_tag: ${plaform_tag}") +message(STATUS " platform_tag: ${platform_tag}") set(archive_name - "vtk-wheel-sdk-${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}.tar.xz" + "vtk-wheel-sdk-${VTK_VERSION}-${python_tag}-${abi_tag}-${platform_tag}.tar.xz" ) set(VTK_SDK_BINARY_URL "https://vtk.org/files/wheel-sdks/${archive_name}") message(STATUS "Setting VTK_SDK_BINARY_URL: ${VTK_SDK_BINARY_URL}") @@ -112,13 +112,13 @@ set(sha256_9.5.0-cp313-cp313-manylinux_2_28_aarch64 set(sha256_9.5.0-cp313-cp313-win_amd64 "0adaf743d9d1882afe512ad3d8182ae43ec37ffc38dd42a6752ab1ad8073b288") -if(NOT DEFINED sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}) +if(NOT DEFINED sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${platform_tag}) message( FATAL_ERROR - "Variable sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag} is not defined" + "Variable sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${platform_tag} is not defined" ) endif() set(VTK_SDK_EXPECTED_SHA256 - ${sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${plaform_tag}}) + ${sha256_${VTK_VERSION}-${python_tag}-${abi_tag}-${platform_tag}}) message(STATUS "Setting VTK_SDK_EXPECTED_SHA256: ${VTK_SDK_EXPECTED_SHA256}") From 6aed18571bc113088c8aa3238ab76d8584aef608 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Tue, 21 Oct 2025 18:59:18 -0400 Subject: [PATCH 33/33] chore: Fix setting of isolated_flags in tests/test_find_package.py Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- tests/test_find_package.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_find_package.py b/tests/test_find_package.py index 20b2a50..34b93a9 100644 --- a/tests/test_find_package.py +++ b/tests/test_find_package.py @@ -94,7 +94,7 @@ def module(self, *args: str) -> None: return self.run(str(self.executable), "-m", *args) def install(self, *args: str, isolated: bool = True) -> None: - isolated_flags = "" if isolated else ["--no-build-isolation"] + isolated_flags = [] if isolated else ["--no-build-isolation"] self.module("pip", "install", *isolated_flags, *args)