Skip to content
Open
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
40 changes: 40 additions & 0 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,43 @@ jobs:
itk-module-deps: RTKConsortium/RTK@main
secrets:
pypi_password: ${{ secrets.pypi_password }}

test-python-wheel:
needs:
- python-build-workflow
runs-on: self-hosted-linux

steps:
- uses: actions/checkout@v4

- name: Download all wheel artifacts
uses: actions/download-artifact@v4
with:
path: wheels

- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Test python wheel
run: |
# Find wheel for Python 3.11 dynamically
wheel=$(find wheels -name "*cp311*manylinux_2_28_x86_64.whl" -type f | head -1)

pip uninstall -y $(pip list | grep -E '^itk-') || true
echo "Installing wheel: $wheel"
pip install $wheel

pip install pytest matplotlib

# Run tests with warning detection.
# SWIG < 4.4 triggers the Py_LIMITED_API "builtin type swig…" warning when
# Python runs with -Walways; pytest enables that behavior, so we ignore it.
stderr_log=$(mktemp)
pytest $GITHUB_WORKSPACE/test/*.py -vv -s -W "ignore:builtin type swig" 2> "$stderr_log"
if grep -q "Warning" "$stderr_log"; then
echo "Warnings found in stderr, failing the build"
cat "$stderr_log"
exit 1
fi
4 changes: 3 additions & 1 deletion applications/pctfdk/pctfdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,9 @@ def process(args_info: argparse.Namespace):
geometryReader.GenerateOutputInformation()

# Short scan image filter
pssf = pct.DDParkerShortScanImageFilter[ProjectionImageType].New()
pssf = pct.DDParkerShortScanImageFilter[
ProjectionImageType, ProjectionImageType
].New()
pssf.SetInput(reader.GetOutput())
pssf.SetGeometry(geometryReader.GetOutputObject())
pssf.InPlaceOff()
Expand Down
1 change: 0 additions & 1 deletion test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ itk_add_test(NAME pctProtonPairsToDistanceDrivenProjectionTest
if(ITK_WRAP_PYTHON)
itk_python_add_test(NAME pctPythonWrappingInstantiationTest COMMAND pctPythonWrappingInstantiationTest.py)
itk_python_add_test(NAME pctOutputArgumentWrappingTest COMMAND pctOutputArgumentWrapping.py)
itk_python_add_test(NAME pctPairProtonsTest COMMAND pctPairProtonsTest.py)
endif()

#-----------------------------------------------------------------------------
Expand Down
26 changes: 0 additions & 26 deletions test/pctPairProtonsTest.py

This file was deleted.

2 changes: 1 addition & 1 deletion wrapping/pctDDParkerShortScanImageFilter.wrap
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
itk_wrap_class("pct::DDParkerShortScanImageFilter" POINTER)
foreach(t ${WRAP_ITK_REAL})
itk_wrap_template("I${ITKM_${t}}4" "itk::Image<${ITKT_${t}}, 4>")
itk_wrap_template("I${ITKM_${t}}4I${ITKM_${t}}4" "itk::Image<${ITKT_${t}}, 4>, itk::Image<${ITKT_${t}}, 4>")
endforeach()
itk_end_wrap_class()
Loading