Skip to content

Commit c9be6b0

Browse files
authored
Merge pull request #456 from hjmjohnson/fix/ci-itk-pin-and-deps
COMP: Build against ITK main; repair ExternalData, baselines, and docs CI
2 parents 67d5002 + 9ca80aa commit c9be6b0

237 files changed

Lines changed: 879 additions & 405 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-test-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ jobs:
264264
run: |
265265
python -m pip install --upgrade pip
266266
python -m pip install ninja
267-
python -m pip install itk>=5.4rc3
267+
python -m pip install itk>=5.4.6
268268
python -m pip install matplotlib
269269
python -m pip install itkwidgets
270270
# Issues with 5.7.0

.pre-commit-config.yaml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Mirrors ITK's .pre-commit-config.yaml style gates for C++ and Python.
2+
# The clang-format rev must track ITK main's pin (the lint CI job
3+
# resolves its version from ITK main at run time).
4+
fail_fast: true
5+
default_stages: [pre-commit]
6+
repos:
7+
- repo: https://github.com/pre-commit/pre-commit-hooks
8+
rev: v5.0.0
9+
hooks:
10+
- id: check-added-large-files
11+
args: ['--maxkb=200']
12+
- id: check-ast
13+
- id: check-case-conflict
14+
- id: check-illegal-windows-names
15+
- id: check-json
16+
exclude: "\\.ipynb$"
17+
- id: check-merge-conflict
18+
- id: check-toml
19+
- id: check-vcs-permalinks
20+
- id: check-xml
21+
- id: check-yaml
22+
- id: check-shebang-scripts-are-executable
23+
- id: debug-statements
24+
exclude: "^Utilities\\/SphinxExtensions\\/"
25+
- id: destroyed-symlinks
26+
- id: detect-private-key
27+
- id: end-of-file-fixer
28+
exclude: "\\.(md5|sha512|cid|svg|vtk|vtp|ipynb)$|^Superbuild\\/"
29+
- id: forbid-new-submodules
30+
- id: mixed-line-ending
31+
exclude: "\\.(sha512|cid|svg|vtk|vtp|ipynb)$"
32+
- id: no-commit-to-branch
33+
args: ['--branch','main','--branch','dashboard','--branch','gh-pages']
34+
- id: trailing-whitespace
35+
exclude: "\\.(sha512|cid|svg|vtk|vtp|ipynb)$"
36+
- repo: https://github.com/pre-commit/mirrors-clang-format
37+
rev: v19.1.7
38+
hooks:
39+
- id: clang-format
40+
args: ['--style=file']
41+
files: '\.(c|cc|h|cxx|hxx)$'
42+
- repo: https://github.com/psf/black
43+
rev: 25.12.0
44+
hooks:
45+
- id: black
46+
args: ['--target-version', 'py310']
47+
exclude: "^Utilities\\/SphinxExtensions\\/"
48+
- repo: https://github.com/asottile/pyupgrade
49+
rev: v3.21.2
50+
hooks:
51+
- id: pyupgrade
52+
args: [--py310-plus]
53+
exclude: "^Utilities\\/SphinxExtensions\\/"

CMake/CTestCustom.cmake.in

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,18 @@ set(CTEST_CUSTOM_COVERAGE_EXCLUDE
3737
set(CTEST_CUSTOM_WARNING_EXCEPTION
3838
${CTEST_CUSTOM_WARNING_EXCEPTION}
3939
"has no symbols"
40+
"UseITK\\.cmake"
41+
"This warning is for project developers"
42+
"DirectWarningToFile"
43+
"WITH_MAINTAINER_WARNINGS"
44+
"which will suppress this warning"
45+
"WARNING: Cache entry deserialization failed, entry ignored"
46+
"LabelGeometryImageFilter.*deprecated"
47+
"note: declared here"
48+
"RemovedInSphinx[0-9]+Warning"
49+
# Nightly InsightDoxygen XML is currently missing these classes upstream.
50+
"doxygenclass: Cannot find class"
51+
"Could not find match for .itk::"
4052
"ipo: warning #11053"
4153
"ipo: warning #11053"
4254
"vxl.core.vnl.algo"
@@ -91,3 +103,8 @@ set(CTEST_CUSTOM_WARNING_EXCEPTION
91103
"ld.*warning.*duplicate dylib.*"
92104
)
93105
endif()
106+
107+
set(CTEST_CUSTOM_ERROR_EXCEPTION
108+
${CTEST_CUSTOM_ERROR_EXCEPTION}
109+
"RemovedInSphinx[0-9]+Warning"
110+
)

CMake/DownloadDoxygenTAG.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
file(DOWNLOAD https://github.com/InsightSoftwareConsortium/ITK/releases/download/v5.3.0/InsightDoxygenDocTag-5.3.0.gz
22
${ITKDoxygenTAG_TEMP_DIR}/InsightDoxygen.tag.gz SHOW_PROGRESS
33
)
4-

CMake/ExternalData.cmake

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,6 @@ function(_ExternalData_get_from_object_store hash algo var_obj var_success)
999999
foreach(dir ${ExternalData_OBJECT_STORES})
10001000
set(obj "${dir}/${algo}/${hash}")
10011001
if(EXISTS "${obj}")
1002-
message(STATUS "Found object: \"${obj}\"")
10031002
set("${var_obj}" "${obj}" PARENT_SCOPE)
10041003
set("${var_success}" 1 PARENT_SCOPE)
10051004
return()
@@ -1013,7 +1012,6 @@ function(_ExternalData_download_object name hash algo var_obj var_success var_er
10131012
foreach(dir ${ExternalData_OBJECT_STORES})
10141013
set(obj "${dir}/${algo}/${hash}")
10151014
if(EXISTS "${obj}")
1016-
message(STATUS "Found object: \"${obj}\"")
10171015
set("${var_obj}" "${obj}" PARENT_SCOPE)
10181016
set("${var_success}" "${success}" PARENT_SCOPE)
10191017
return()

CMake/ITKDoxygen.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ add_custom_command(OUTPUT ${ITKDoxygen_DIR}/index.html
1212

1313
add_custom_target(ITKDoxygen ${CMAKE_COMMAND} -E echo "Finished obtaining Doxygen"
1414
DEPENDS ${ITKDoxygen_DIR}/index.html)
15-

CMake/ITKDoxygenTAG.cmake

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,3 @@ add_custom_command(OUTPUT ${ITKDoxygenTAG_DIR}/InsightDoxygen.tag
1515
)
1616
add_custom_target(ITKDoxygenTAG ${CMAKE_COMMAND} -E echo "Finished obtaining Doxygen TAG"
1717
DEPENDS ${ITKDoxygenTAG_DIR}/InsightDoxygen.tag)
18-

CMake/ITKSphinxExamplesExternalData.cmake

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
set(ExternalData_SOURCE_ROOT "${PROJECT_SOURCE_DIR}")
12
get_filename_component(_ITKExternalData_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
23
include(${_ITKExternalData_DIR}/ExternalData.cmake)
34

@@ -18,52 +19,39 @@ if(NOT ExternalData_OBJECT_STORES)
1819
endif()
1920
list(APPEND ExternalData_OBJECT_STORES
2021
# Local data store populated by the ITK pre-commit hook
21-
"${CMAKE_SOURCE_DIR}/.ExternalData"
22+
"${PROJECT_SOURCE_DIR}/.ExternalData"
2223
)
2324

24-
set(ITK_SPHINX_EXAMPLES_DATA_RELEASED_ROOT_CID bafybeib6yijwyl52gkalx6griio2wsibowlrt3v5wmkkuqlnuvku64c3ra)
25+
# Tests reference staged data at ${CMAKE_CURRENT_BINARY_DIR}/<Example>/<file>,
26+
# which requires the default ExternalData_BINARY_ROOT (${CMAKE_BINARY_DIR}).
2527

28+
# Expands %(algo:lower)
2629
set(ExternalData_URL_ALGO_CID_lower cid)
30+
set(ExternalData_URL_ALGO_MD5_lower md5)
2731
set(ExternalData_URL_TEMPLATES "" CACHE STRING
2832
"Additional URL templates for the ExternalData CMake script to look for testing data. E.g.
2933
file:///var/bigharddrive/%(algo)/%(hash)")
3034
mark_as_advanced(ExternalData_URL_TEMPLATES)
3135
if(NOT ITK_FORBID_DOWNLOADS)
3236
list(APPEND ExternalData_URL_TEMPLATES
37+
# Data published on GitHub Pages
38+
"https://insightsoftwareconsortium.github.io/ITKTestingData/%(algo)/%(hash)"
3339
# Local IPFS gateway
3440
"http://127.0.0.1:8080/ipfs/%(hash)"
35-
36-
# Data published on GitHub Pages (note: not complete due to file size
37-
# limit)
38-
"https://insightsoftwareconsortium.github.io/ITKTestingData/%(algo)/%(hash)"
39-
40-
# Released data rsync'd to Kitware's Apache web server
41-
"https://itk.org/files/ExternalData/%(algo)/%(hash)"
42-
43-
# Restricted gateway with released data
44-
"https://itk.mypinata.cloud/ipfs/${ITK_SPHINX_EXAMPLES_DATA_RELEASED_ROOT_CID}/Objects/CID/%(hash)"
45-
46-
# New data on web3.storage
47-
"https://w3s.link/ipfs/%(hash)"
48-
49-
# Released data on web3.storage
50-
"https://${ITK_SPHINX_EXAMPLES_DATA_RELEASED_ROOT_CID}.ipfs.w3s.link/Objects/CID/%(hash)"
51-
52-
# Released data on estuary.tech
53-
"https://api.estuary.tech/gw/ipfs/${ITK_SPHINX_EXAMPLES_DATA_RELEASED_ROOT_CID}/Objects/CID/%(hash)"
54-
55-
# Protocol Labs gateway
56-
"https://${ITK_SPHINX_EXAMPLES_DATA_RELEASED_ROOT_CID}.ipfs.dweb.link/Objects/CID/%(hash)"
57-
58-
# Gateway for arbitrary new files, uploaded to web3.storage
59-
"https://dweb.link/ipfs/%(hash)"
60-
6141
# Protocol Labs gateway
6242
"https://ipfs.io/ipfs/%(hash)"
63-
43+
# Filebase gateway
44+
"https://ipfs.filebase.io/ipfs/%(hash)"
45+
# Gateway for data pinned on pinata
46+
"https://gateway.pinata.cloud/ipfs/%(hash)"
6447
# Cloudflare gateway
6548
"https://cloudflare-ipfs.com/ipfs/%(hash)"
66-
49+
# Additional gateway (modern but has redirect)
50+
"https://dweb.link/ipfs/%(hash)"
51+
# Data published on Girder
52+
"https://data.kitware.com:443/api/v1/file/hashsum/%(algo)/%(hash)/download"
53+
# Data published by developers using git-gerrit-push.
54+
"https://itk.org/files/ExternalData/%(algo)/%(hash)"
6755
# DataLad repository on gin.g-node.org
6856
"https://gin.g-node.org/InsightSoftwareConsortium/ITKSphinxExamplesData/raw/main/Objects/CID/%(hash)"
6957
)
@@ -73,7 +61,7 @@ endif()
7361
set(ExternalData_LINK_CONTENT CID)
7462

7563
# Emscripten currently has difficulty reading symlinks.
76-
if(EMSCRIPTEN)
64+
if(EMSCRIPTEN OR WASI)
7765
set(ExternalData_NO_SYMLINKS 1)
7866
endif()
7967

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ITKSphinxExamples_BINARY_DIR}/bin)
9999
include(CTest)
100100
# Tests are added with add_test() can be run with the 'ctest' command line program.
101101
enable_testing()
102-
configure_file(CMake/CTestCustom.cmake.in CTestCustom.cmake)
102+
configure_file(CMake/CTestCustom.cmake.in CTestCustom.cmake COPYONLY)
103103

104104
# ExternalData setup. We use the CMake ExternalData features to download binary
105105
# files from a configurable location(s) -- including the local filesystem -- to

Documentation/Build/index.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,3 @@ VV
247247
.. _Qt: https://www.qt.io/developers/
248248
.. _VTK: https://vtk.org/
249249
.. _VV: https://www.creatis.insa-lyon.fr/rio/vv
250-

0 commit comments

Comments
 (0)