Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
0223ce1
feat: add wheel packaging for VTK SDK using scikit-build-core
AlexyPellegrini Mar 25, 2024
ed4c4da
style: Re-organize CMakeLists into "section" to improve readability
jcfr Mar 27, 2024
9707274
fix: install SDK under vtk_sdk/content and set bin permissions
jcfr Mar 27, 2024
4ec6085
fix: Set VTK_VERSION as regular (non-CACHE) variable
jcfr Mar 27, 2024
8a6f556
docs: improve comments/docstrings for install steps and entry point
jcfr Mar 27, 2024
7fbc121
fix: consolidate URL construction from python/abi/platform tag
jcfr Mar 27, 2024
6436089
fix: ensure macOS x86_64 platform tag is always set
jcfr Mar 27, 2024
4d0bcf4
feat: verify downloads via SHA256 checksums
jcfr Mar 27, 2024
7c6f3e4
ci: test CPython 3.8–3.11; exclude 3.12 (unsupported by 9.2.5)
jcfr Mar 27, 2024
55d4ed7
ci: update cd.yml to publish wheels to PyPI (not TestPyPI)
jcfr Mar 27, 2024
5991212
ci: Update "cd.yml" adding "test_sdist" and "check_dist" jobs
jcfr Mar 27, 2024
9e29f66
feat: Add support for generating macOS arm64 wheels
jcfr Mar 27, 2024
cbd168d
ci: Test building of macOS arm64 wheels in CI workflow
jcfr Mar 27, 2024
fa216b2
fix: Disable cibuildwheel repair command
jcfr Mar 27, 2024
5fffe74
doc: Fix entrypoint references to consistently mention "cmake.prefix"
jcfr Mar 27, 2024
e0a167e
chore: Set CMake version range to 3.21..4.0
jcfr Oct 21, 2025
92d35b2
style: Remove redundant blank lines in pyproject.toml
AlexyPellegrini Oct 21, 2025
78951a5
ci: Fetch tags from fork to simplify VTK version updates
AlexyPellegrini Jul 3, 2025
4ad0ec5
ci: install opengl loader on Ubuntu
AlexyPellegrini Aug 5, 2024
f382f00
feat: bump VTK to 9.5.0
AlexyPellegrini Nov 12, 2024
c944ea6
fix: override setuptools_scm to nearest tag; align CMake version check
AlexyPellegrini Oct 21, 2025
883bc08
feat: support CPython 3.10–3.13 (drop 3.8–3.9)
AlexyPellegrini Jul 3, 2025
7b5570d
fix: add Linux aarch64 manylinux platform tag
AlexyPellegrini Jul 3, 2025
56e7c3b
test: add integration test for VTK find_package support
AlexyPellegrini Mar 28, 2024
6643afe
fix(test): skip non-module/OpenXR components during resolution
AlexyPellegrini Jul 3, 2025
39f888c
docs(test): Add comment and docstrings to `test_find_package`
jcfr Oct 21, 2025
f6e0c26
chore: Display SKBUILD_SOABI and Python_SOABI
jcfr Oct 21, 2025
9289239
ci: Update CI workflow to exercise cibuildwheel for all platforms
jcfr Oct 21, 2025
22aeec0
fix: Ensure platform_tag is properly set on macOS
jcfr Oct 21, 2025
762f572
fix: Skip Windows 32bit builds
jcfr Oct 21, 2025
20a96fe
ci: Update CD workflow to explicitly use "macos-15-intel" for macOS x…
jcfr Oct 21, 2025
e256ac3
chore: Fix typo in cmake/vtk-sdk-urls.cmake
jcfr Oct 21, 2025
6aed185
chore: Fix setting of isolated_flags in tests/test_find_package.py
jcfr Oct 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 56 additions & 6 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,20 +30,74 @@ 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.10", "3.11", "3.12", "3.13"]

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 }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
os: [ubuntu-latest, windows-latest, macos-15-intel]
arch: ["auto"]

include:
- os: macos-14
arch: "arm64"

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

- uses: pypa/[email protected]
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
CIBW_ARCHS: "${{ matrix.arch }}"
CIBW_REPAIR_WHEEL_COMMAND: ""

- name: Upload wheels
uses: actions/upload-artifact@v4
Expand All @@ -52,7 +106,7 @@ jobs:
path: wheelhouse/*.whl

upload_all:
needs: [build_wheels, make_sdist]
needs: [check_dist]
environment: pypi
permissions:
id-token: write
Expand All @@ -67,7 +121,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/
45 changes: 41 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,23 +40,34 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]

include:
- python-version: pypy-3.10
runs-on: ubuntu-latest
- os: macos-14
arch: "arm64"

steps:
- uses: actions/checkout@v5
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 }}
allow-prereleases: true

- name: Install OpenGL libraries
if: ${{ matrix.runs-on == 'ubuntu-latest' }}
run: sudo apt-get install --fix-missing libgl-dev

- name: Install package
run: python -m pip install .[test]

Expand All @@ -69,3 +80,29 @@ jobs:
uses: codecov/[email protected]
with:
token: ${{ secrets.CODECOV_TOKEN }}

checks-cibw:
name: >
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
arch: "arm64"

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

- uses: pypa/[email protected]
env:
CIBW_BUILD: "cp310-* cp311-* cp312-* cp313-*"
CIBW_ARCHS: "${{ matrix.arch }}"
CIBW_REPAIR_WHEEL_COMMAND: ""
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ repos:
args: []
additional_dependencies:
- pytest
- virtualenv

- repo: https://github.com/codespell-project/codespell
rev: "v2.2.6"
Expand Down
92 changes: 86 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,88 @@
cmake_minimum_required(VERSION 3.15...3.26)
project(${SKBUILD_PROJECT_NAME} LANGUAGES CXX)
cmake_minimum_required(VERSION 3.21...4.0)

set(PYBIND11_FINDPYTHON ON)
find_package(pybind11 CONFIG REQUIRED)
# 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()

pybind11_add_module(_core MODULE src/main.cpp)
install(TARGETS _core DESTINATION ${SKBUILD_PROJECT_NAME})
project(
vtk-sdk
VERSION ${VTK_VERSION}
DESCRIPTION "VTK SDK python distributions"
HOMEPAGE_URL "https://github.com/Kitware/vtk-sdk-python-distributions"
LANGUAGES NONE)

find_package(
Python
COMPONENTS Interpreter Development.Module
REQUIRED)

# ----------------------------------------------------------------------------
# Download and extract vtk-wheel-sdk archive

include(cmake/vtk-sdk-urls.cmake)

set(download_dir ${PROJECT_BINARY_DIR})
set(extract_dir ${PROJECT_BINARY_DIR}/vtk-wheel-sdk)

include(FetchContent)
FetchContent_Populate(
vtkwheelsdk
URL ${VTK_SDK_BINARY_URL}
URL_HASH SHA256=${VTK_SDK_EXPECTED_SHA256}
DOWNLOAD_DIR ${download_dir}
SOURCE_DIR ${extract_dir})

# ----------------------------------------------------------------------------
# Install content of the vtk-wheel-sdk archive

set(VTK_SDK_INSTALL_DIR "content")

# 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}
PATTERN "bin/*" EXCLUDE)

install(
DIRECTORY ${extract_dir}/bin/
DESTINATION vtk_sdk/${VTK_SDK_INSTALL_DIR}/bin
PATTERN
"*"
PERMISSIONS
OWNER_READ
OWNER_WRITE
OWNER_EXECUTE
GROUP_READ
GROUP_EXECUTE
WORLD_READ
WORLD_EXECUTE)

# ----------------------------------------------------------------------------
# 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)

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
${CMAKE_CURRENT_BINARY_DIR}/vtk_sdk/cmake/vtk-config-version.cmake
DESTINATION vtk_sdk/cmake)
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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].

Expand Down
1 change: 1 addition & 0 deletions cmake/vtk-config-version.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/../@VTK_SDK_INSTALL_DIR@/vtk-@[email protected]/headers/cmake/vtk-config-version.cmake)
1 change: 1 addition & 0 deletions cmake/vtk-config.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include(${CMAKE_CURRENT_LIST_DIR}/../@VTK_SDK_INSTALL_DIR@/vtk-@[email protected]/headers/cmake/vtk-config.cmake)
Loading