Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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
70 changes: 31 additions & 39 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: Build, test, package
on: [push,pull_request]

env:
itk-git-tag: "v5.4.0"
itk-wheel-tag: "v5.4.0"
# v5.4.0 + fixes
itk-python-package-tag: "c9bb40bcb9f99938d071435e46f44d3d2b389482"
itk-git-tag: "v5.4.7"
itk-wheel-tag: "v5.4.7"
itk-python-package-tag: "v5.4.7"
itk-python-package-org: "InsightSoftwareConsortium"
ctest-options: ""

Expand All @@ -16,7 +15,7 @@ jobs:
strategy:
max-parallel: 3
matrix:
os: [ubuntu-22.04, windows-2022, macos-13, macos-14]
os: [ubuntu-22.04, windows-2022, macos-15-intel, macos-15]
include:
- os: ubuntu-22.04
c-compiler: "gcc"
Expand All @@ -26,17 +25,17 @@ jobs:
c-compiler: "cl.exe"
cxx-compiler: "cl.exe"
cmake-build-type: "Release"
- os: macos-13
- os: macos-15-intel
c-compiler: "clang"
cxx-compiler: "clang++"
cmake-build-type: "MinSizeRel"
- os: macos-14
- os: macos-15
c-compiler: "clang"
cxx-compiler: "clang++"
cmake-build-type: "MinSizeRel"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Free Disk Space (Ubuntu)
if: matrix.os == 'ubuntu-22.04'
Expand All @@ -45,25 +44,20 @@ jobs:
large-packages: false

- name: Set up Python 3.11
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"

- uses: shogo82148/actions-setup-perl@v1
- uses: ilammy/setup-nasm@v1

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

- name: 'Specific XCode version'
if: matrix.os == 'macos-13'
if: startsWith(matrix.os, 'macos')
run: |
sudo xcode-select -s "/Applications/Xcode_14.3.1.app"

- name: 'Specific XCode version'
if: matrix.os == 'macos-14'
run: |
sudo xcode-select -s "/Applications/Xcode_15.0.1.app"
sudo xcode-select -s "/Applications/Xcode_16.2.app"

- name: Download ITK
run: |
Expand Down Expand Up @@ -126,6 +120,8 @@ jobs:
"ld: warning: text-based stub file"
"Wunused-result"
"file: .+ has no symbols"
"ranlib: archive library: .+ the table of contents is empty"
"ld: warning: no platform load command found in"
"Wpointer-bool-conversion"
"note: prefix with the address-of operator to silence this warning"
"warning C4722: 'riegeli::internal::UnreachableStream::~UnreachableStream': destructor never returns, potential memory leak"
Expand Down Expand Up @@ -175,14 +171,14 @@ jobs:
strategy:
max-parallel: 2
matrix:
python3-minor-version: ["8", "9", "10", "11"]
python3-minor-version: ["9", "10", "11"]
manylinux-platform: ["_2_28-x64"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

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

- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@v1.3.1
Expand Down Expand Up @@ -220,7 +216,7 @@ jobs:
./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp3${{ matrix.python3-minor-version }} $CMAKE_OPTIONS

- name: Set up Python 3.11 for Validation
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"

Expand All @@ -242,47 +238,45 @@ jobs:
python -m twine check ${WHEEL_PATTERN}

- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: LinuxWheel3${{ matrix.python3-minor-version }}${{ matrix.manylinux-platform }}
path: dist/*.whl

- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: MacOSWheel3${{ matrix.python3-minor-version }}
path: dist/*.whl

build-macos-arm-py:
runs-on: macos-14
runs-on: macos-15
strategy:
max-parallel: 2
matrix:
python3-minor-version: ["9", "10", "11"]

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: 'Specific XCode version'
run: |
sudo xcode-select -s "/Applications/Xcode_15.0.1.app"
sudo xcode-select -s "/Applications/Xcode_16.2.app"

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

- uses: shogo82148/actions-setup-perl@v1
- uses: ilammy/setup-nasm@v1

- name: 'Fetch build script'
if: matrix.python3-minor-version != '8'
run: |
IPP_DOWNLOAD_GIT_TAG=${{ env.itk-python-package-tag }}
IPP_DOWNLOAD_ORG=${{ env.itk-python-package-org }}
curl -L https://raw.githubusercontent.com/${IPP_DOWNLOAD_ORG:=InsightSoftwareConsortium}/ITKPythonPackage/${IPP_DOWNLOAD_GIT_TAG:=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'
if: matrix.python3-minor-version != '8'
shell: bash
run: |
rm -rf dist
Expand All @@ -296,12 +290,11 @@ jobs:
./macpython-download-cache-and-build-module-wheels.sh $CMAKE_OPTIONS "3.${{ matrix.python3-minor-version }}"

- name: Set up Python 3.11 for Validation
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"

- name: Validate build output
if: matrix.python3-minor-version != '8'
shell: bash
run: |
python -m pip install twine
Expand All @@ -319,8 +312,7 @@ jobs:
python -m twine check ${WHEEL_PATTERN}

- name: Publish Python package as GitHub Artifact
if: matrix.python3-minor-version != '8'
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: MacOSArmWheel3${{ matrix.python3-minor-version }}
path: dist/*.whl
Expand All @@ -330,13 +322,13 @@ jobs:
strategy:
max-parallel: 2
matrix:
python3-minor-version: ["8", "9", "10", "11"]
python3-minor-version: ["9", "10", "11"]

steps:
- name: Get specific version of CMake, Ninja
uses: lukka/get-cmake@v3.29.6
uses: lukka/get-cmake@v4.4.2

- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
path: "im"

Expand Down Expand Up @@ -379,7 +371,7 @@ jobs:
cp 'dist\*.whl' '${{ github.workspace }}\dist'

- name: Set up Python 3.11 for Validation
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.11"

Expand All @@ -395,7 +387,7 @@ jobs:
python -m twine check ${WHEEL_PATTERN}

- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: WindowsWheel3${{ matrix.python3-minor-version }}
path: dist/*.whl
Expand All @@ -409,7 +401,7 @@ jobs:

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

- name: Prepare packages for upload
run: |
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Medical Science Apps.",
"Topic :: Software Development :: Libraries",
]
requires-python = ">=3.8"
requires-python = ">=3.9"
dependencies = [
"itk == 5.4.*",
]
Expand Down
12 changes: 8 additions & 4 deletions src/itkOMEZarrNGFFImageIO.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct TypeList
constexpr TypeList<int8_t, uint8_t, int16_t, uint16_t, int32_t, uint32_t, int64_t, uint64_t, float, double>
supportedPixelTypes{};

IOComponentEnum
constexpr IOComponentEnum
tensorstoreToITKComponentType(const tensorstore::DataType dtype)
{
switch (dtype.id())
Expand Down Expand Up @@ -97,7 +97,7 @@ tensorstoreToITKComponentType(const tensorstore::DataType dtype)
}
}

tensorstore::DataType
constexpr tensorstore::DataType
itkToTensorstoreComponentType(const IOComponentEnum itkComponentType)
{
switch (itkComponentType)
Expand Down Expand Up @@ -172,6 +172,10 @@ MakePath(const int datasetIndex)
return 's' + std::to_string(datasetIndex);
}

// Variable template, ensuring that tensorstoreToITKComponentType is evaluated at compile-time.
template <typename T>
constexpr IOComponentEnum toITKComponentType = tensorstoreToITKComponentType(tensorstore::dtype_v<T>);

// Returns TensorStore KvStore driver name appropriate for this path.
// Options are file, zip. TODO: http, gcs (GoogleCouldStorage), etc.
std::string
Expand Down Expand Up @@ -243,7 +247,7 @@ ReadFromStoreIfTypesMatch(const IOComponentEnum componentType,
const ImageIORegion & storeIORegion,
void * buffer)
{
if (tensorstoreToITKComponentType(tensorstore::dtype_v<TPixel>) == componentType)
if (toITKComponentType<TPixel> == componentType)
{
ReadFromStore(store, storeIORegion, static_cast<TPixel *>(buffer));
return true;
Expand Down Expand Up @@ -274,7 +278,7 @@ WriteToStoreIfTypesMatch(const IOComponentEnum componentType,
const std::vector<int64_t> & shape,
const void * const buffer)
{
if (tensorstoreToITKComponentType(tensorstore::dtype_v<TPixel>) == componentType)
if (toITKComponentType<TPixel> == componentType)
{
std::string dtype;
// we prefer to write using our own endianness, so no conversion is necessary
Expand Down
Loading