From 8bf5670eb6f513013163b2e66d7c6c972df28a8f Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 23 Dec 2017 11:45:43 -0500 Subject: [PATCH 001/151] DOC: Put CI badges in a table with an OS description --- README.rst | 13 +++++++++---- {{cookiecutter.project_name}}/README.rst | 12 +++++++++--- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/README.rst b/README.rst index caecc2b..d75438c 100644 --- a/README.rst +++ b/README.rst @@ -1,16 +1,21 @@ ITKModuleTemplate ================= - -.. image:: https://circleci.com/gh/InsightSoftwareConsortium/ITKModuleTemplate.svg?style=shield +.. |CircleCI| image:: https://circleci.com/gh/InsightSoftwareConsortium/ITKModuleTemplate.svg?style=shield :target: https://circleci.com/gh/InsightSoftwareConsortium/ITKModuleTemplate -.. image:: https://travis-ci.org/InsightSoftwareConsortium/ITKModuleTemplate.svg?branch=master +.. |TravisCI| image:: https://travis-ci.org/InsightSoftwareConsortium/ITKModuleTemplate.svg?branch=master :target: https://travis-ci.org/InsightSoftwareConsortium/ITKModuleTemplate -.. image:: https://img.shields.io/appveyor/ci/itkrobot/itkmoduletemplate.svg +.. |AppVeyor| image:: https://img.shields.io/appveyor/ci/itkrobot/itkmoduletemplate.svg :target: https://ci.appveyor.com/project/itkrobot/itkmoduletemplate +=========== =========== =========== + Linux macOS Windows +=========== =========== =========== +|CircleCI| |TravisCI| |AppVeyor| +=========== =========== =========== + This is a module for the `Insight Toolkit (ITK) `_ for segmentation and registration. It is designed to work with the ITKv4 modular system. diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 345a3d3..492f27f 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -1,15 +1,21 @@ {{ cookiecutter.project_name }} ================================= -.. image:: https://circleci.com/gh/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?style=shield +.. |CircleCI| image:: https://circleci.com/gh/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?style=shield :target: https://circleci.com/gh/InsightSoftwareConsortium/{{ cookiecutter.project_name }} -.. image:: https://travis-ci.org/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?branch=master +.. |TravisCI| image:: https://travis-ci.org/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?branch=master :target: https://travis-ci.org/InsightSoftwareConsortium/{{ cookiecutter.project_name }} -.. image:: https://img.shields.io/appveyor/ci/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.lower() }}.svg +.. |AppVeyor| image:: https://img.shields.io/appveyor/ci/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.lower() }}.svg :target: https://ci.appveyor.com/project/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.lower() }} +=========== =========== =========== + Linux macOS Windows +=========== =========== =========== +|CircleCI| |TravisCI| |AppVeyor| +=========== =========== =========== + {{ cookiecutter.project_short_description }} {{ cookiecutter.project_long_description }} From 9de4de623d2694b57994187607fb872680b07e44 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 23 Dec 2017 19:10:00 -0500 Subject: [PATCH 002/151] BUG: Install cookiecutter via homebrew on TravisCI macOS Python does not have pip. --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7cdbdf6..f610dde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: directories: - "$HOME/Library/Caches/Homebrew" script: -- python -m pip install cookiecutter +- brew install cookiecutter - cookiecutter --no-input . - cd ITKModuleTemplate - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O From 64daf39f2ddd900d86c27972ba4fdf300af1422f Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 23 Apr 2018 11:40:48 -0400 Subject: [PATCH 003/151] BUG: Switch from filebin.ca to file.io filebin.ca has been throwing errors. --- .travis.yml | 2 +- {{cookiecutter.project_name}}/.travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index f610dde..b4c2433 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,4 +15,4 @@ script: - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ -- curl -F file="@dist.tar.gz" https://filebin.ca/upload.php +- curl -F file="@dist.tar.gz" https://file.io diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml index 4289354..fefe98c 100644 --- a/{{cookiecutter.project_name}}/.travis.yml +++ b/{{cookiecutter.project_name}}/.travis.yml @@ -12,4 +12,4 @@ script: - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ -- curl -F file="@dist.tar.gz" https://filebin.ca/upload.php +- curl -F file="@dist.tar.gz" https://file.io From cef0d4d0e936f31670ac4b36aab0094c08c1065c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 23 Apr 2018 13:42:35 -0400 Subject: [PATCH 004/151] BUG: Install cookiecutter with pip Avoid brew installation issues. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index b4c2433..6e1bc6e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,9 @@ cache: directories: - "$HOME/Library/Caches/Homebrew" script: -- brew install cookiecutter +- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py +- sudo python get-pip.py +- sudo python -m pip install cookiecutter - cookiecutter --no-input . - cd ITKModuleTemplate - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O From d1b1d94144e5dfbf9103195f2f66adf6251afb2d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 25 Apr 2018 14:36:44 -0400 Subject: [PATCH 005/151] DOC: Use "ITK" instead of "ITKv4" to refer to the module system To avoid confusion with ITKv5. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index d75438c..227c363 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ ITKModuleTemplate =========== =========== =========== This is a module for the `Insight Toolkit (ITK) `_ for -segmentation and registration. It is designed to work with the ITKv4 modular +segmentation and registration. It is designed to work with the ITK modular system. This module is a template to be used as a starting point for a new ITK module. From 3e21887d98eb6810c600c6b202d4765c7a818489 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 29 Apr 2018 23:09:45 -0400 Subject: [PATCH 006/151] BUG: Build the release branch on AppVeyor If available. --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index f06e4cc..d83d67e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,6 +1,7 @@ branches: only: - master + - release version: "0.0.1.{build}" From 6ef3ab566641bc4354974ac0ef9f543db899a697 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Mon, 28 May 2018 15:39:48 -0400 Subject: [PATCH 007/151] ENH: Updates Multithreading API calls to be updated for ITKv5.0 --- .../include/itkNormalDistributionImageSource.h | 2 +- .../include/itkNormalDistributionImageSource.hxx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h index 76e94ff..9e2f4a9 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h @@ -70,7 +70,7 @@ class NormalDistributionImageSource: public GenerateImageSource< TImage > typedef typename ImageType::RegionType OutputRegionType; - virtual void ThreadedGenerateData( const OutputRegionType & outputRegion, ThreadIdType threadId ) ITK_OVERRIDE; + virtual void DynamicThreadedGenerateData( const OutputRegionType & outputRegion ) ITK_OVERRIDE; private: ITK_DISALLOW_COPY_AND_ASSIGN(NormalDistributionImageSource); diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx index ef98746..ff95c7a 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx @@ -46,7 +46,7 @@ NormalDistributionImageSource< TImage > template< typename TImage > void NormalDistributionImageSource< TImage > -::ThreadedGenerateData( const OutputRegionType & outputRegion, ThreadIdType threadId ) +::DynamicThreadedGenerateData( const OutputRegionType & outputRegion ) { ImageType * output = this->GetOutput(); @@ -63,7 +63,7 @@ NormalDistributionImageSource< TImage > typedef ImageScanlineIterator< ImageType > IteratorType; IteratorType it( output, outputRegion ); - ProgressReporter progress( this, threadId, numberOfLinesToProcess ); + ProgressReporter progress( this, 0, numberOfLinesToProcess ); while( !it.IsAtEnd() ) { From d48c63092aba3f70928fd9a5ca802ca12962ae84 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Tue, 29 May 2018 10:16:53 -0400 Subject: [PATCH 008/151] ENH: Remove pixelwise progress report To match the latest progress report style due to the MultiThreader update, the pixelwise progress report is removed from the itkNormalDistributionImageSource filter. Progress report is now handled at the thread level, not at the pixel level. --- .../include/itkNormalDistributionImageSource.hxx | 3 --- 1 file changed, 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx index ff95c7a..b35eb4d 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx @@ -22,7 +22,6 @@ #include "itkNormalVariateGenerator.h" #include "itkImageScanlineIterator.h" -#include "itkProgressReporter.h" namespace itk { @@ -63,7 +62,6 @@ NormalDistributionImageSource< TImage > typedef ImageScanlineIterator< ImageType > IteratorType; IteratorType it( output, outputRegion ); - ProgressReporter progress( this, 0, numberOfLinesToProcess ); while( !it.IsAtEnd() ) { @@ -73,7 +71,6 @@ NormalDistributionImageSource< TImage > ++it; } it.NextLine(); - progress.CompletedPixel(); } } From c4e10c3e21068583c84e31bc588d661e43acef1e Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Mon, 21 May 2018 15:25:10 -0400 Subject: [PATCH 009/151] ENH: Add a very simple template filter The new template example can be modified easily by a developer to start developing a new filter: * The user will start with a skeleton of a filter with files and classes already named appropriatly. * A test is already implemented and can easily be modified. * A wrapper is automatically created --- cookiecutter.json | 1 + .../include/itk{{cookiecutter.filter_name}}.h | 86 +++++++++++++++ .../itk{{cookiecutter.filter_name}}.hxx | 66 ++++++++++++ ...ecutter.filter_name}}TestOutput.mha.sha512 | 1 + .../test/CMakeLists.txt | 10 ++ .../itk{{cookiecutter.filter_name}}Test.cxx | 102 ++++++++++++++++++ .../itk{{cookiecutter.filter_name}}.wrap | 4 + 7 files changed, 270 insertions(+) create mode 100644 {{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h create mode 100644 {{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx create mode 100644 {{cookiecutter.project_name}}/test/Baseline/itk{{cookiecutter.filter_name}}TestOutput.mha.sha512 create mode 100644 {{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx create mode 100644 {{cookiecutter.project_name}}/wrapping/itk{{cookiecutter.filter_name}}.wrap diff --git a/cookiecutter.json b/cookiecutter.json index b16db1a..9551731 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -4,6 +4,7 @@ "github_username": "itkrobot", "project_name": "ITKModuleTemplate", "module_name": "{{ cookiecutter.project_name[3:] }}", + "filter_name": "MyFilter", "python_package_name": "itk-{{ cookiecutter.project_name[3:].lower() }}", "download_url": "https://github.com/InsightSoftwareConsortium/{{ cookiecutter.project_name }}", "project_short_description": "This is a template that serves as a starting point for a new module.", diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h new file mode 100644 index 0000000..a0d33fa --- /dev/null +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -0,0 +1,86 @@ +/*========================================================================= + * + * Copyright Insight Software Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ +#ifndef itk{{ cookiecutter.filter_name }}_h +#define itk{{ cookiecutter.filter_name }}_h + +#include "itkImageToImageFilter.h" + +namespace itk +{ + +/** \class {{ cookiecutter.filter_name }} + * + * \brief Filters a image by iterating over its pixels. + * + * Filters a image by iterating over its pixels in a multi-threaded way + * and {to be completed by the developer}. + * + * \ingroup {{ cookiecutter.module_name }} + * + */ +template< typename TInputImage, typename TOutputImage > +class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TOutputImage > +{ +public: + ITK_DISALLOW_COPY_AND_ASSIGN({{ cookiecutter.filter_name }}); + + static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension; + static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension; + + using InputImageType = TInputImage; + using OutputImageType = TInputImage; + using InputPixelType = typename InputImageType::PixelType; + using OutputPixelType = typename OutputImageType::PixelType; + + /** Standard class typedefs. */ + using Self = {{ cookiecutter.filter_name }}< InputImageType, OutputImageType >; + using Superclass = ImageToImageFilter< InputImageType, OutputImageType >; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; + + /** Run-time type information. */ + itkTypeMacro( {{ cookiecutter.filter_name }}, ImageToImageFilter ); + + /** Standard New macro. */ + itkNewMacro( Self ); + +protected: + {{ cookiecutter.filter_name }}(); + virtual ~{{ cookiecutter.filter_name }}() override {} + + void PrintSelf( std::ostream& os, Indent indent ) const override; + + typedef typename OutputImageType::RegionType OutputRegionType; + + virtual void DynamicThreadedGenerateData( const OutputRegionType & outputRegion) override; + +private: + + +#ifdef ITK_USE_CONCEPT_CHECKING + // Add concept checking such as + // itkConceptMacro( FloatingPointPixel, ( itk::Concept::IsFloatingPoint< typename InputImageType::PixelType > ) ); +#endif +}; +} + +#ifndef ITK_MANUAL_INSTANTIATION +#include "itk{{ cookiecutter.filter_name }}.hxx" +#endif + +#endif // itk{{ cookiecutter.filter_name }} diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx new file mode 100644 index 0000000..a0b5f5b --- /dev/null +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx @@ -0,0 +1,66 @@ +/*========================================================================= + * + * Copyright Insight Software Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ +#ifndef itk{{ cookiecutter.filter_name }}_hxx +#define itk{{ cookiecutter.filter_name }}_hxx + +#include "itk{{ cookiecutter.filter_name }}.h" + +#include "itkImageRegionIterator.h" +#include "itkImageRegionConstIterator.h" + +namespace itk +{ + +template< typename TInputImage, typename TOutputImage > +{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > +::{{ cookiecutter.filter_name }}() +{ +} + + +template< typename TInputImage, typename TOutputImage > +void +{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > +::PrintSelf( std::ostream& os, Indent indent ) const +{ + Superclass::PrintSelf( os, indent ); +} + + +template< typename TInputImage, typename TOutputImage > +void +{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > +::DynamicThreadedGenerateData( const OutputRegionType & outputRegion) +{ + OutputImageType * output = this->GetOutput(); + const InputImageType * input = this->GetInput(); + using InputRegionType = typename InputImageType::RegionType; + InputRegionType inputRegion = InputRegionType(outputRegion.GetSize()); + + itk::ImageRegionConstIterator in(input, inputRegion); + itk::ImageRegionIterator out(output, outputRegion); + + for (in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd() && !out.IsAtEnd(); ++in, ++out) + { + out.Set( in.Get() ); + } +} + +} // end namespace itk + +#endif // itk{{ cookiecutter.filter_name }}_hxx diff --git a/{{cookiecutter.project_name}}/test/Baseline/itk{{cookiecutter.filter_name}}TestOutput.mha.sha512 b/{{cookiecutter.project_name}}/test/Baseline/itk{{cookiecutter.filter_name}}TestOutput.mha.sha512 new file mode 100644 index 0000000..c811785 --- /dev/null +++ b/{{cookiecutter.project_name}}/test/Baseline/itk{{cookiecutter.filter_name}}TestOutput.mha.sha512 @@ -0,0 +1 @@ +34cdd2aafce413dcf7efc692a707d53b7b57ebb006d0fbc20ecb42343f8a078b2252eff2137b17d3ab583d133f780438e247241ebf213c3289bd9ba1525081b7 diff --git a/{{cookiecutter.project_name}}/test/CMakeLists.txt b/{{cookiecutter.project_name}}/test/CMakeLists.txt index cde5454..bcb5399 100644 --- a/{{cookiecutter.project_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/test/CMakeLists.txt @@ -3,6 +3,7 @@ itk_module_test() set({{ cookiecutter.module_name }}Tests itkMinimalStandardRandomVariateGeneratorTest.cxx itkNormalDistributionImageSourceTest.cxx + itk{{ cookiecutter.filter_name }}Test.cxx ) CreateTestDriver({{ cookiecutter.module_name }} "${{ '{' }}{{ cookiecutter.module_name -}}-Test_LIBRARIES}" "${{ '{' }}{{ cookiecutter.module_name }}Tests}") @@ -11,6 +12,15 @@ itk_add_test(NAME itkMinimalStandardRandomVariateGeneratorTest COMMAND {{ cookiecutter.module_name }}TestDriver itkMinimalStandardRandomVariateGeneratorTest ) +itk_add_test(NAME itk{{ cookiecutter.filter_name }}Test + COMMAND {{ cookiecutter.module_name }}TestDriver + --compare + ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha + DATA{Baseline/itk{{ cookiecutter.filter_name }}TestOutput.mha} + itk{{ cookiecutter.filter_name }}Test + ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha + ) + itk_add_test(NAME itkNormalDistributionImageSourceTest COMMAND {{ cookiecutter.module_name }}TestDriver --without-threads --compare diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx new file mode 100644 index 0000000..0d63eb6 --- /dev/null +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -0,0 +1,102 @@ +/*========================================================================= + * + * Copyright Insight Software Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ + +#include "itk{{cookiecutter.filter_name}}.h" + +#include "itkCommand.h" +#include "itkImageFileWriter.h" +#include "itkTestingMacros.h" + +namespace{ +class ShowProgress : public itk::Command +{ +public: + itkNewMacro( ShowProgress ); + + void + Execute( itk::Object* caller, const itk::EventObject& event ) override + { + Execute( (const itk::Object*)caller, event ); + } + + void + Execute( const itk::Object* caller, const itk::EventObject& event ) override + { + if ( !itk::ProgressEvent().CheckEvent( &event ) ) + { + return; + } + const auto* processObject = dynamic_cast< const itk::ProcessObject* >( caller ); + if ( !processObject ) + { + return; + } + std::cout << " " << processObject->GetProgress(); + } +}; +} + +int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) +{ + if( argc < 2 ) + { + std::cerr << "Usage: " << argv[0]; + std::cerr << " outputImage"; + std::cerr << std::endl; + return EXIT_FAILURE; + } + const char * outputImageFileName = argv[1]; + + const unsigned int Dimension = 2; + using PixelType = float; + using ImageType = itk::Image< PixelType, Dimension >; + + using FilterType = itk::{{cookiecutter.filter_name}}< ImageType, ImageType >; + FilterType::Pointer filter = FilterType::New(); + + EXERCISE_BASIC_OBJECT_METHODS( filter, {{cookiecutter.filter_name}}, ImageToImageFilter ); + + // Create input image to avoid test dependencies. + ImageType::SizeType size; + size.Fill( 128 ); + ImageType::Pointer image = ImageType::New(); + image->SetRegions( size ); + image->Allocate(); + image->FillBuffer(1.1f); + + ShowProgress::Pointer showProgress = ShowProgress::New(); + filter->AddObserver( itk::ProgressEvent(), showProgress ); + filter->SetInput(image); + + typedef itk::ImageFileWriter< ImageType > WriterType; + WriterType::Pointer writer = WriterType::New(); + writer->SetFileName( outputImageFileName ); + writer->SetInput( filter->GetOutput() ); + writer->SetUseCompression(true); + try + { + writer->Update(); + } + catch( itk::ExceptionObject & error ) + { + std::cerr << "Error: " << error << std::endl; + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} diff --git a/{{cookiecutter.project_name}}/wrapping/itk{{cookiecutter.filter_name}}.wrap b/{{cookiecutter.project_name}}/wrapping/itk{{cookiecutter.filter_name}}.wrap new file mode 100644 index 0000000..ffa5e79 --- /dev/null +++ b/{{cookiecutter.project_name}}/wrapping/itk{{cookiecutter.filter_name}}.wrap @@ -0,0 +1,4 @@ +itk_wrap_class("itk::{{ cookiecutter.filter_name }}" POINTER) + itk_wrap_image_filter("${WRAP_ITK_SCALAR}" 2) +itk_end_wrap_class() + From 4f592ecbaf2db7b132049fc2c17ddd2bd6479e68 Mon Sep 17 00:00:00 2001 From: Jon Haitz Legarreta Date: Thu, 31 May 2018 16:27:13 +0200 Subject: [PATCH 010/151] COMP: Set the minimum required CMake version to 3.10.2. As agreed in: https://discourse.itk.org/t/cmake-update/870/ Set the `cmake_minimum_required` to version **3.10.2**. --- {{cookiecutter.project_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/CMakeLists.txt b/{{cookiecutter.project_name}}/CMakeLists.txt index d93d807..1010226 100644 --- a/{{cookiecutter.project_name}}/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.10.2) project({{ cookiecutter.module_name }}) set({{ cookiecutter.module_name }}_LIBRARIES {{ cookiecutter.module_name }}) From 06016b754c9e070e2b07c4671e31a6a4395a496a Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 8 Jun 2018 10:19:23 -0400 Subject: [PATCH 011/151] DOC: Describe the cookiecutter parameters --- README.rst | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 227c363..5dc149b 100644 --- a/README.rst +++ b/README.rst @@ -32,10 +32,58 @@ The following will get an external module started in a new repository:: python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate # Fill in the information requested at the prompts +Reasonable defaults will be provided for all of the parameters. The parameters are: + +*full_name* + Your full name. + +*email* + Your email. + +*github_username* + Your GitHub username. + +*project_name* + This is a name for the project, which is *ITK* followed by the + module name, by convention. Examples include *ITKIsotropicWavelets* or + *ITKBoneMorphometry*. + +*module_name* + This is the name of the module. Since this is an external module, it does + not start with the *ITK* prefix. It is in CamelCase, by convention. Examples + include *IsotropicWavelets* and *BoneMorphometry*. + +*filter_name* + The skeleton of an ``itk::ImageToImageFilter`` will be created by default. + Optionally specify this value, if you will be adding an + ``itk::ImageToImageFilter`` to your module. + +*python_package_name* + This is the name of the Python package that will be created from the module. + By convention, this is *itk-*. For example, + *itk-isotropicwavelets* or *itk-bonemorphometry*. + +*download_url* + This is the download url added to the Python package metadata. This can be + the GitHub repository URL. + +*project_short_description* + A short description to use in the project README, module Doxygen + documentation, and Python package documentation. + +*project_long_description* + A long description to use in the project README, module Doxygen + documentation, and Python package documentation. + +The output of the cookiecutter is a buildable ITK external module with example +classes. Remove or replace the classes with your new classes. Push your new +module to GitHub, and enable builds on `CircleCI `_, +`TravisCI `_, and `AppVeyor +`. + Documentation on `how to populate the module `_ -can be found in the `ITK Software Guide -`_. +can be found in the `ITK Software Guide `_. From 131f2ba06ec8e5e4e0740456c7648d9a56d5ff60 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 5 Jul 2018 12:03:01 -0400 Subject: [PATCH 012/151] DOC: Fix Appveyor link format --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5dc149b..d6994b3 100644 --- a/README.rst +++ b/README.rst @@ -79,7 +79,7 @@ The output of the cookiecutter is a buildable ITK external module with example classes. Remove or replace the classes with your new classes. Push your new module to GitHub, and enable builds on `CircleCI `_, `TravisCI `_, and `AppVeyor -`. +`_. Documentation on `how to populate the module `_ From df8414b2415ac27254d31731ec87640b0b269fd7 Mon Sep 17 00:00:00 2001 From: Pablo Hernandez-Cerdan Date: Mon, 16 Jul 2018 14:37:44 -0400 Subject: [PATCH 013/151] DOCS: Update readme on how to keep a ITKv4 branch. Pointing to the discourse conversation: https://discourse.itk.org/t/itk-external-module-github-builds-for-4-x-and-5-x/900 --- README.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.rst b/README.rst index d6994b3..19c07f3 100644 --- a/README.rst +++ b/README.rst @@ -114,6 +114,15 @@ and `uploaded to the Python Package Index (PyPI) `_. +ITKv4 Branch +------------ +In the transition to the major release of ITKv5 your module might want to be compatible with both versions: ITKv4 and ITKv5. +In order to do that, keep the master branch for development with ITKv5, and create another branch, named ``ITKv4``, or ``release``, +that is compatible with the version 4.13 of ITK. +For examples and updated information on how to do this: please `check the discourse conversation +`_. + + License ------- From 8af4a1c02f87ba42c073ac2ea4a1e91e5369b5a6 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 19 Sep 2018 15:35:07 -0400 Subject: [PATCH 014/151] BUG: Use transfer.sh for macOS package upload filebin.ca is no longer reliable. --- .travis.yml | 2 +- {{cookiecutter.project_name}}/.travis.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6e1bc6e..1ec081b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,4 @@ script: - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ -- curl -F file="@dist.tar.gz" https://file.io +- curl --upload-file dist.tar.gz https://transfer.sh/dist.tar.gz diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml index fefe98c..fcd5383 100644 --- a/{{cookiecutter.project_name}}/.travis.yml +++ b/{{cookiecutter.project_name}}/.travis.yml @@ -12,4 +12,4 @@ script: - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ -- curl -F file="@dist.tar.gz" https://file.io +- curl --upload-file dist.tar.gz https://transfer.sh/dist.tar.gz From cee6199ead42d9c183852b4de48c3bd0918f47ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 21 Sep 2018 16:10:55 -0400 Subject: [PATCH 015/151] COMP: make sure that the current ITK build is found --- {{cookiecutter.project_name}}/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/{{cookiecutter.project_name}}/CMakeLists.txt b/{{cookiecutter.project_name}}/CMakeLists.txt index 1010226..09a341b 100644 --- a/{{cookiecutter.project_name}}/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/CMakeLists.txt @@ -8,5 +8,6 @@ if(NOT ITK_SOURCE_DIR) list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR}) include(ITKModuleExternal) else() + set(ITK_DIR ${CMAKE_BINARY_DIR}) itk_module_impl() endif() From 7ce20f0e89719842b6c77c712c94f3d08d43cbeb Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 15 Aug 2018 12:28:07 -0400 Subject: [PATCH 016/151] DOC: Suggest adding itk-module to GitHub Topics --- README.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.rst b/README.rst index 19c07f3..28ac32c 100644 --- a/README.rst +++ b/README.rst @@ -85,6 +85,10 @@ Documentation on `how to populate the module `_ can be found in the `ITK Software Guide `_. +To improve the discoverability of your module on GitHub, first push the +associated repository, then add `itk-module +`_ to the project's `GitHub Topics +`_ . Remote Module From bb692c7526016ff3729eda2a2f05b29b160f338e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 11 Oct 2018 13:50:44 -0400 Subject: [PATCH 017/151] COMP: Do not use rawgit.com It is no longer supported. --- .circleci/config.yml | 2 +- .travis.yml | 2 +- appveyor.yml | 2 +- {{cookiecutter.project_name}}/.circleci/config.yml | 2 +- {{cookiecutter.project_name}}/.travis.yml | 2 +- {{cookiecutter.project_name}}/appveyor.yml | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 5f479a7..84eec87 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,7 @@ jobs: name: Fetch build script command: | cd ~/ITKModuleTemplate - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - run: name: Build Python packages diff --git a/.travis.yml b/.travis.yml index 1ec081b..4479da0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ script: - sudo python -m pip install cookiecutter - cookiecutter --no-input . - cd ITKModuleTemplate -- curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O +- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ diff --git a/appveyor.yml b/appveyor.yml index d83d67e..239dfdb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,7 +10,7 @@ install: - python -m pip install cookiecutter - cookiecutter --no-input . - cd ITKModuleTemplate - - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - ps: .\windows-download-cache-and-build-module-wheels.ps1 build: off diff --git a/{{cookiecutter.project_name}}/.circleci/config.yml b/{{cookiecutter.project_name}}/.circleci/config.yml index 1371317..ed7b410 100644 --- a/{{cookiecutter.project_name}}/.circleci/config.yml +++ b/{{cookiecutter.project_name}}/.circleci/config.yml @@ -44,7 +44,7 @@ jobs: - run: name: Fetch build script command: | - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - run: name: Build Python packages diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml index fcd5383..c0a5d09 100644 --- a/{{cookiecutter.project_name}}/.travis.yml +++ b/{{cookiecutter.project_name}}/.travis.yml @@ -8,7 +8,7 @@ cache: directories: - "$HOME/Library/Caches/Homebrew" script: -- curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O +- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - ./macpython-download-cache-and-build-module-wheels.sh - tar -zcvf dist.tar.gz dist/ diff --git a/{{cookiecutter.project_name}}/appveyor.yml b/{{cookiecutter.project_name}}/appveyor.yml index fa24b5d..99c62fc 100644 --- a/{{cookiecutter.project_name}}/appveyor.yml +++ b/{{cookiecutter.project_name}}/appveyor.yml @@ -6,7 +6,7 @@ version: "0.0.1.{build}" install: - - curl -L https://rawgit.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - ps: .\windows-download-cache-and-build-module-wheels.ps1 build: off From 9a404d49e2a64c0821a44aeea3efa8677d763ec7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Fri, 26 Oct 2018 22:54:26 -0400 Subject: [PATCH 018/151] DOC; Change reference to wiki for SWG reference. Update the reference concerning the `Contributing with a Remote Module` section: change the reference to the wiki for a reference to the Software Guide. This part of the toolkit documentation was migrated to the SWG in order to reduce the number of sites to look at when searching documentation. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 227c363..fb835e8 100644 --- a/README.rst +++ b/README.rst @@ -44,7 +44,7 @@ Remote Module After an `Insight Journal `_ article has been submitted, the module can be included in ITK as a `remote module -`_. +`_. Add a file in "ITK/Modules/Remote" called "YourModule.remote.cmake", for this module it would be "ExternalExample.remote.cmake" with the followlowing contents:: From 45c56bf953839881e79d1406f93207d1b287f4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 23 Dec 2018 16:35:56 -0500 Subject: [PATCH 019/151] ENH: Use the `TRY_EXPECT_NO_EXCEPTION` macro in testing. Use the `TRY_EXPECT_NO_EXCEPTION` macro to save typing/avoid boilerplate code with `try/catch` block. --- .../test/itkNormalDistributionImageSourceTest.cxx | 12 +++--------- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 12 +++--------- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx b/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx index c246f66..751b451 100644 --- a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx @@ -52,15 +52,9 @@ int itkNormalDistributionImageSourceTest( int argc, char * argv[] ) WriterType::Pointer writer = WriterType::New(); writer->SetFileName( outputImageFileName ); writer->SetInput( distributionSource->GetOutput() ); - try - { - writer->Update(); - } - catch( itk::ExceptionObject & error ) - { - std::cerr << "Error: " << error << std::endl; - return EXIT_FAILURE; - } + + TRY_EXPECT_NO_EXCEPTION( writer->Update() ); + return EXIT_SUCCESS; } diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 0d63eb6..71b6b8d 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -88,15 +88,9 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) writer->SetFileName( outputImageFileName ); writer->SetInput( filter->GetOutput() ); writer->SetUseCompression(true); - try - { - writer->Update(); - } - catch( itk::ExceptionObject & error ) - { - std::cerr << "Error: " << error << std::endl; - return EXIT_FAILURE; - } + + TRY_EXPECT_NO_EXCEPTION( writer->Update() ); + return EXIT_SUCCESS; } From 2d1b2cbea83c4afabb2fd15e7d70ddfee7ebf65d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 23 Dec 2018 17:11:17 -0500 Subject: [PATCH 020/151] STYLE: Remove unnecessary white space before comma. Remove unnecessary white space before comma in function argument list. --- .../test/itkNormalDistributionImageSourceTest.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx b/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx index c246f66..269286f 100644 --- a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx @@ -39,7 +39,7 @@ int itkNormalDistributionImageSourceTest( int argc, char * argv[] ) typedef itk::NormalDistributionImageSource< ImageType > DistributionSourceType; DistributionSourceType::Pointer distributionSource = DistributionSourceType::New(); - EXERCISE_BASIC_OBJECT_METHODS( distributionSource, NormalDistributionImageSource , GenerateImageSource ); + EXERCISE_BASIC_OBJECT_METHODS( distributionSource, NormalDistributionImageSource, GenerateImageSource ); ImageType::SizeType size; From f921d3fd162c55280df956494e47d444c6c08964 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 17 Feb 2019 23:20:14 -0500 Subject: [PATCH 021/151] BUG: Fix NormalDistributionImageSource test git bisect reveals that the test started failing with InsightSoftwareConsortium/ITK@4627a89f15e8cf6fc5f0fe6c3ff7e9221ce32db3 which is related to the number of work units used in the pool multi-threader. Simply consistent output generation by removing threading from the example filter. --- .../include/itkNormalDistributionImageSource.h | 2 +- .../include/itkNormalDistributionImageSource.hxx | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h index 9e2f4a9..bc5b44e 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h @@ -70,7 +70,7 @@ class NormalDistributionImageSource: public GenerateImageSource< TImage > typedef typename ImageType::RegionType OutputRegionType; - virtual void DynamicThreadedGenerateData( const OutputRegionType & outputRegion ) ITK_OVERRIDE; + virtual void GenerateData() ITK_OVERRIDE; private: ITK_DISALLOW_COPY_AND_ASSIGN(NormalDistributionImageSource); diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx index b35eb4d..fe1a4d7 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx @@ -45,9 +45,11 @@ NormalDistributionImageSource< TImage > template< typename TImage > void NormalDistributionImageSource< TImage > -::DynamicThreadedGenerateData( const OutputRegionType & outputRegion ) +::GenerateData() { + this->AllocateOutputs(); ImageType * output = this->GetOutput(); + const OutputRegionType & outputRegion = output->GetRequestedRegion(); typedef itk::Statistics::NormalVariateGenerator NormalGeneratorType; NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); From adae03f916d3c2ecf157d2193f0fe62da0259830 Mon Sep 17 00:00:00 2001 From: Francois Budin Date: Tue, 12 Mar 2019 20:38:25 -0400 Subject: [PATCH 022/151] Add azure-pipelines.yml to enable CI on Azure Pipeline --- .../azure-pipelines.yml | 216 ++++++++++++++++++ 1 file changed, 216 insertions(+) create mode 100644 {{cookiecutter.project_name}}/azure-pipelines.yml diff --git a/{{cookiecutter.project_name}}/azure-pipelines.yml b/{{cookiecutter.project_name}}/azure-pipelines.yml new file mode 100644 index 0000000..37f7f45 --- /dev/null +++ b/{{cookiecutter.project_name}}/azure-pipelines.yml @@ -0,0 +1,216 @@ +variables: + ITKGitTag: v5.0rc01 + CMakeBuildType: MinSizeRel + +trigger: + batch: true + branches: + include: + - master + +jobs: + +- job: 'Test' + displayName: "Build and test" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + + strategy: + matrix: + Linux: + imageName: 'ubuntu-16.04' + cCompiler: gcc + cxxCompiler: g++ + compilerInitialization: '' + macOS: + imageName: 'macos-10.13' + cCompiler: clang + cxxCompiler: clang++ + compilerInitialization: '' + Windows: + imageName: 'vs2017-win2016' + cCompiler: cl.exe + cxxCompiler: cl.exe + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + + pool: + vmImage: $(imageName) + + steps: + - bash: | + set -x + if [ -n "$(System.PullRequest.SourceCommitId)" ]; then + git checkout $(System.PullRequest.SourceCommitId) + fi + displayName: 'Checkout pull request HEAD' + + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install scikit-ci-addons + python -m pip install ninja + displayName: 'Install build dependencies' + + - script: | + git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Download ITK' + + - script: | + mkdir ITK-build + cd ITK-build + $(compilerInitialization) + cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Build ITK' + + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O + displayName: 'Fetch CTest driver script' + + - bash: | + cat > dashboard.cmake << EOF + set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) + set(dashboard_source_name "$(Build.Repository.Name)") + if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) + set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") + set(dashboard_model "Experimental") + elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") + set(branch "-master") + set(dashboard_model "Continuous") + else() + set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") + set(dashboard_model "Experimental") + endif() + if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) + set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") + else() + set(pr "") + endif() + set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") + set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) + set(CTEST_BUILD_CONFIGURATION "Release") + set(CTEST_CMAKE_GENERATOR "Ninja") + set(CTEST_CUSTOM_WARNING_EXCEPTION + \${CTEST_CUSTOM_WARNING_EXCEPTION} + # macOS Azure Pipelines + "ld: warning: text-based stub file" + ) + set(dashboard_no_clean 1) + set(ENV{CC} $(cCompiler)) + set(ENV{CXX} $(cxxCompiler)) + set(dashboard_cache " + ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build + BUILD_TESTING:BOOL=ON + ") + string(TIMESTAMP build_date "%Y-%m-%d") + message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") + message("CTEST_SITE = \${CTEST_SITE}") + include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) + EOF + cat dashboard.cmake + displayName: 'Configure CTest script' + + - script: | + $(compilerInitialization) + ctest -j 2 -V -S dashboard.cmake + displayName: 'Build and test' + + - script: | + sudo pip3 install --upgrade pip + sudo pip3 install --upgrade setuptools + sudo pip3 install scikit-ci-addons + ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml + condition: succeededOrFailed() + displayName: 'Format CTest output in JUnit format' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" + testRunTitle: 'CTest $(Agent.OS)' + condition: succeededOrFailed() + displayName: 'Publish test results' + + +- job: 'PackageLinux' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + displayName: "Build Linux Python packages" + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'LinuxWheels' + targetPath: './dist' + + +- job: 'PackageMacOS' + displayName: "Build macOS Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'macos-10.13' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./macpython-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'MacOSWheels' + targetPath: './dist' + + +- job: 'PackageWindows' + displayName: "Build Windows Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'vs2017-win2016' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + displayName: 'Fetch build script' + + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set ITK_PACKAGE_VERSION=$(ITKGitTag) + set CC=cl.exe + set CXX=cl.exe + powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'WindowsWheels' + targetPath: './dist' From d779509be161c1c39c9c65e271b78fc1027fe966 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 17 Mar 2019 12:44:05 -0400 Subject: [PATCH 023/151] STYLE: Prefer C++11 type alias over typedef. Prefer C++11 type alias over `typedef` for the reasons stated here: http://review.source.kitware.com/#/c/23103/ --- .../itkMinimalStandardRandomVariateGenerator.h | 12 ++++++------ .../include/itkNormalDistributionImageSource.hxx | 4 ++-- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 6f66bc1..e498a1e 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -55,14 +55,14 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato { public: /** Standard class typedefs. */ - typedef MinimalStandardRandomVariateGenerator Self; - typedef RandomVariateGeneratorBase Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; + using Self = MinimalStandardRandomVariateGenerator; + using Superclass = RandomVariateGeneratorBase; + using Pointer = SmartPointer< Self >; + using ConstPointer = SmartPointer< const Self >; - typedef uint32_t IntegerType; + using IntegerType = uint32_t; - typedef itk::Statistics::NormalVariateGenerator NormalGeneratorType; + using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; /** Run-time type information (and related methods). */ itkTypeMacro( MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx index fe1a4d7..e53451d 100644 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx +++ b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx @@ -51,7 +51,7 @@ NormalDistributionImageSource< TImage > ImageType * output = this->GetOutput(); const OutputRegionType & outputRegion = output->GetRequestedRegion(); - typedef itk::Statistics::NormalVariateGenerator NormalGeneratorType; + using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); normalGenerator->Initialize( 101 ); @@ -62,7 +62,7 @@ NormalDistributionImageSource< TImage > } const SizeValueType numberOfLinesToProcess = outputRegion.GetNumberOfPixels() / size0; - typedef ImageScanlineIterator< ImageType > IteratorType; + using IteratorType = ImageScanlineIterator< ImageType >; IteratorType it( output, outputRegion ); while( !it.IsAtEnd() ) diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index a0d33fa..ff79a29 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -65,7 +65,7 @@ class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TO void PrintSelf( std::ostream& os, Indent indent ) const override; - typedef typename OutputImageType::RegionType OutputRegionType; + using OutputRegionType = typename OutputImageType::RegionType; virtual void DynamicThreadedGenerateData( const OutputRegionType & outputRegion) override; From fda3cea917b5a88bf99cff31cc091062032e601d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 17 Mar 2019 12:51:14 -0400 Subject: [PATCH 024/151] COMP: Use C++11 override directly. Use C++11 override directly. --- .../include/itkMinimalStandardRandomVariateGenerator.h | 4 ++-- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 6f66bc1..bdad4c4 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -74,13 +74,13 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato void Initialize(int randomSeed); /** Get a variate in the range [0, 1] */ - virtual double GetVariate() ITK_OVERRIDE; + double GetVariate() override; protected: MinimalStandardRandomVariateGenerator(); virtual ~MinimalStandardRandomVariateGenerator() {} - virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE; + void PrintSelf(std::ostream & os, Indent indent) const override; private: ITK_DISALLOW_COPY_AND_ASSIGN(MinimalStandardRandomVariateGenerator); diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index a0d33fa..e6b343a 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -67,7 +67,7 @@ class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TO typedef typename OutputImageType::RegionType OutputRegionType; - virtual void DynamicThreadedGenerateData( const OutputRegionType & outputRegion) override; + void DynamicThreadedGenerateData( const OutputRegionType & outputRegion) override; private: From 9d16d5ac59e610e52043aaddf1b563429acb7dc0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 17 Mar 2019 12:39:59 -0400 Subject: [PATCH 025/151] COMP: Use and move ITK_DISALLOW_COPY_AND_ASSIGN calls to public section. Use the `ITK_DISALLOW_COPY_AND_ASSIGN` macro to enhance consistency across the the toolkit when disallowing the copy constructor and the assign operator. Move the `ITK_DISALLOW_COPY_AND_ASSIGN` calls to public section following the discussion in https://discourse.itk.org/t/itk-disallow-copy-and-assign/648 --- .../include/itkMinimalStandardRandomVariateGenerator.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 6f66bc1..12e02d1 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -54,6 +54,8 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato public RandomVariateGeneratorBase { public: + ITK_DISALLOW_COPY_AND_ASSIGN(MinimalStandardRandomVariateGenerator); + /** Standard class typedefs. */ typedef MinimalStandardRandomVariateGenerator Self; typedef RandomVariateGeneratorBase Superclass; @@ -83,7 +85,6 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato virtual void PrintSelf(std::ostream & os, Indent indent) const ITK_OVERRIDE; private: - ITK_DISALLOW_COPY_AND_ASSIGN(MinimalStandardRandomVariateGenerator); NormalGeneratorType::Pointer m_NormalGenerator; }; From 81b9f56225ebb0eb3395b4103231d91a2014a68b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 17 Mar 2019 12:57:24 -0400 Subject: [PATCH 026/151] STYLE: Pefer = default to explicitly trivial implementations. This check replaces default bodies of special member functions with = default;. The explicitly defaulted function declarations enable more opportunities in optimization, because the compiler might treat explicitly defaulted functions as trivial. Additionally, the C++11 use of = default more clearly expreses the intent for the special member functions. --- .../include/itkMinimalStandardRandomVariateGenerator.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index a93727b..bfaa69b 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -80,7 +80,7 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato protected: MinimalStandardRandomVariateGenerator(); - virtual ~MinimalStandardRandomVariateGenerator() {} + ~MinimalStandardRandomVariateGenerator() override = default; void PrintSelf(std::ostream & os, Indent indent) const override; diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index b9cb446..f8905ff 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -61,7 +61,7 @@ class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TO protected: {{ cookiecutter.filter_name }}(); - virtual ~{{ cookiecutter.filter_name }}() override {} + ~{{ cookiecutter.filter_name }}() override = default; void PrintSelf( std::ostream& os, Indent indent ) const override; From adb119cf06836158abd7ad6378a109f2d141d10b Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 17 Mar 2019 16:32:56 -0400 Subject: [PATCH 027/151] ENH: Remove NormalDistributionImageSource We now have the MyFilter class, and this class is superfluous. Remove to reduce clutter when cleaning template output and reduce maintenance burden. --- .../itkNormalDistributionImageSource.h | 88 ------------------- .../itkNormalDistributionImageSource.hxx | 81 ----------------- ...stributionImageSourceTestOutput.mha.sha512 | 1 - .../test/CMakeLists.txt | 10 --- .../itkNormalDistributionImageSourceTest.cxx | 60 ------------- .../itkNormalDistributionImageSource.wrap | 7 -- 6 files changed, 247 deletions(-) delete mode 100644 {{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h delete mode 100644 {{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx delete mode 100644 {{cookiecutter.project_name}}/test/Baseline/itkNormalDistributionImageSourceTestOutput.mha.sha512 delete mode 100644 {{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx delete mode 100644 {{cookiecutter.project_name}}/wrapping/itkNormalDistributionImageSource.wrap diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h deleted file mode 100644 index bc5b44e..0000000 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.h +++ /dev/null @@ -1,88 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *=========================================================================*/ -#ifndef itkNormalDistributionImageSource_h -#define itkNormalDistributionImageSource_h - -#include "itkGenerateImageSource.h" - -namespace itk -{ - -/** \class NormalDistributionImageSource - * - * \brief Generate a image of pixels sampled from a normal distribution. - * - * Real-valued pixels are sampled from a normal distribution. - * - * The pixels, \f$x > 0\f$ follow - * - * \f[ - * f(x) = \frac{1}{sx\sqrt{2 \pi}} e^{\left( \frac{-(ln x - m)^2}{2s^2} \right)} - * \f] - * - * where \f$s\f$ is the StandardDeviation and \f$m\f$ is the Mean of the - * underlying normal distribution. - * - * \ingroup {{ cookiecutter.module_name }} - * - */ -template< typename TImage > -class NormalDistributionImageSource: public GenerateImageSource< TImage > -{ -public: - typedef TImage ImageType; - typedef typename ImageType::PixelType PixelType; - - /** Standard class typedefs. */ - typedef NormalDistributionImageSource Self; - typedef GenerateImageSource< ImageType > Superclass; - typedef SmartPointer< Self > Pointer; - typedef SmartPointer< const Self > ConstPointer; - - itkStaticConstMacro( ImageDimension, unsigned int, ImageType::ImageDimension ); - - /** Run-time type information. */ - itkTypeMacro( NormalDistributionImageSource, GenerateImageSource ); - - /** Standard New macro. */ - itkNewMacro( Self ); - -protected: - NormalDistributionImageSource(); - virtual ~NormalDistributionImageSource() {} - - void PrintSelf( std::ostream& os, Indent indent ) const ITK_OVERRIDE; - - typedef typename ImageType::RegionType OutputRegionType; - - virtual void GenerateData() ITK_OVERRIDE; - -private: - ITK_DISALLOW_COPY_AND_ASSIGN(NormalDistributionImageSource); - -#ifdef ITK_USE_CONCEPT_CHECKING - itkConceptMacro( FloatingPointPixel, ( itk::Concept::IsFloatingPoint< typename ImageType::PixelType > ) ); -#endif -}; -} - -#ifndef ITK_MANUAL_INSTANTIATION -#include "itkNormalDistributionImageSource.hxx" -#endif - -#endif // itkNormalDistributionImageSource_h diff --git a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx b/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx deleted file mode 100644 index e53451d..0000000 --- a/{{cookiecutter.project_name}}/include/itkNormalDistributionImageSource.hxx +++ /dev/null @@ -1,81 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *=========================================================================*/ -#ifndef itkNormalDistributionImageSource_hxx -#define itkNormalDistributionImageSource_hxx - -#include "itkNormalDistributionImageSource.h" -#include "itkNormalVariateGenerator.h" - -#include "itkImageScanlineIterator.h" - -namespace itk -{ - -template< typename TImage > -NormalDistributionImageSource< TImage > -::NormalDistributionImageSource() -{ -} - - -template< typename TImage > -void -NormalDistributionImageSource< TImage > -::PrintSelf( std::ostream& os, Indent indent ) const -{ - Superclass::PrintSelf( os, indent ); -} - - -template< typename TImage > -void -NormalDistributionImageSource< TImage > -::GenerateData() -{ - this->AllocateOutputs(); - ImageType * output = this->GetOutput(); - const OutputRegionType & outputRegion = output->GetRequestedRegion(); - - using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; - NormalGeneratorType::Pointer normalGenerator = NormalGeneratorType::New(); - normalGenerator->Initialize( 101 ); - - const SizeValueType size0 = outputRegion.GetSize( 0 ); - if( size0 == 0 ) - { - return; - } - const SizeValueType numberOfLinesToProcess = outputRegion.GetNumberOfPixels() / size0; - - using IteratorType = ImageScanlineIterator< ImageType >; - IteratorType it( output, outputRegion ); - - while( !it.IsAtEnd() ) - { - while( !it.IsAtEndOfLine() ) - { - it.Set( normalGenerator->GetVariate() ); - ++it; - } - it.NextLine(); - } -} - -} // end namespace itk - -#endif // itkNormalDistributionImageSource_hxx diff --git a/{{cookiecutter.project_name}}/test/Baseline/itkNormalDistributionImageSourceTestOutput.mha.sha512 b/{{cookiecutter.project_name}}/test/Baseline/itkNormalDistributionImageSourceTestOutput.mha.sha512 deleted file mode 100644 index 5091c18..0000000 --- a/{{cookiecutter.project_name}}/test/Baseline/itkNormalDistributionImageSourceTestOutput.mha.sha512 +++ /dev/null @@ -1 +0,0 @@ -38a102c75d4e30f57834fd3dc1ba61e30943714da9a9d27e4b77ee5fb58c1e34269a44c2af3cfd3a0b738de0f5ea293f0f609b8a66eede3f299703548ed57608 \ No newline at end of file diff --git a/{{cookiecutter.project_name}}/test/CMakeLists.txt b/{{cookiecutter.project_name}}/test/CMakeLists.txt index bcb5399..e90170b 100644 --- a/{{cookiecutter.project_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/test/CMakeLists.txt @@ -2,7 +2,6 @@ itk_module_test() set({{ cookiecutter.module_name }}Tests itkMinimalStandardRandomVariateGeneratorTest.cxx - itkNormalDistributionImageSourceTest.cxx itk{{ cookiecutter.filter_name }}Test.cxx ) @@ -20,12 +19,3 @@ itk_add_test(NAME itk{{ cookiecutter.filter_name }}Test itk{{ cookiecutter.filter_name }}Test ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha ) - -itk_add_test(NAME itkNormalDistributionImageSourceTest - COMMAND {{ cookiecutter.module_name }}TestDriver --without-threads - --compare - ${ITK_TEST_OUTPUT_DIR}/itkNormalDistributionImageSourceTestOutput.mha - DATA{Baseline/itkNormalDistributionImageSourceTestOutput.mha} - itkNormalDistributionImageSourceTest - ${ITK_TEST_OUTPUT_DIR}/itkNormalDistributionImageSourceTestOutput.mha - ) diff --git a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx b/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx deleted file mode 100644 index 483dd03..0000000 --- a/{{cookiecutter.project_name}}/test/itkNormalDistributionImageSourceTest.cxx +++ /dev/null @@ -1,60 +0,0 @@ -/*========================================================================= - * - * Copyright Insight Software Consortium - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0.txt - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - * - *=========================================================================*/ - -#include "itkNormalDistributionImageSource.h" - -#include "itkImageFileWriter.h" -#include "itkTestingMacros.h" - -int itkNormalDistributionImageSourceTest( int argc, char * argv[] ) -{ - if( argc < 2 ) - { - std::cerr << "Usage: " << argv[0]; - std::cerr << " outputImage"; - std::cerr << std::endl; - return EXIT_FAILURE; - } - const char * outputImageFileName = argv[1]; - - const unsigned int Dimension = 2; - typedef float PixelType; - typedef itk::Image< PixelType, Dimension > ImageType; - - typedef itk::NormalDistributionImageSource< ImageType > DistributionSourceType; - DistributionSourceType::Pointer distributionSource = DistributionSourceType::New(); - - EXERCISE_BASIC_OBJECT_METHODS( distributionSource, NormalDistributionImageSource, GenerateImageSource ); - - - ImageType::SizeType size; - size.Fill( 128 ); - distributionSource->SetSize( size ); - - std::cout << distributionSource << std::endl; - - typedef itk::ImageFileWriter< ImageType > WriterType; - WriterType::Pointer writer = WriterType::New(); - writer->SetFileName( outputImageFileName ); - writer->SetInput( distributionSource->GetOutput() ); - - TRY_EXPECT_NO_EXCEPTION( writer->Update() ); - - - return EXIT_SUCCESS; -} diff --git a/{{cookiecutter.project_name}}/wrapping/itkNormalDistributionImageSource.wrap b/{{cookiecutter.project_name}}/wrapping/itkNormalDistributionImageSource.wrap deleted file mode 100644 index 44c934f..0000000 --- a/{{cookiecutter.project_name}}/wrapping/itkNormalDistributionImageSource.wrap +++ /dev/null @@ -1,7 +0,0 @@ -itk_wrap_class("itk::NormalDistributionImageSource" POINTER) - foreach(d ${ITK_WRAP_IMAGE_DIMS}) - itk_wrap_template("${ITKM_I${ITKM_F}${d}}" - "${ITKT_I${ITKM_F}${d}}") - - endforeach() -itk_end_wrap_class() From 693755de3671bf6d9753e39d27cbe09dd438c3ea Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 18 Mar 2019 12:24:16 -0400 Subject: [PATCH 028/151] ENH: Move azure-pipelines.yml in the test/ directory Remove clutter on the top level. --- {{cookiecutter.project_name}}/{ => test}/azure-pipelines.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {{cookiecutter.project_name}}/{ => test}/azure-pipelines.yml (100%) diff --git a/{{cookiecutter.project_name}}/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml similarity index 100% rename from {{cookiecutter.project_name}}/azure-pipelines.yml rename to {{cookiecutter.project_name}}/test/azure-pipelines.yml From 4a2477af0a9341e8e07fbd72db15b6c1618ec211 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 18 Mar 2019 12:25:02 -0400 Subject: [PATCH 029/151] ENH: Use Release CMAKE_BUILD_TYPE for Azure Pipelines builds For test builds, the build time difference is not significant relative to the Azure Pipelines timeout, and Release is the more common desired build type. --- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index 37f7f45..6c350a6 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: ITKGitTag: v5.0rc01 - CMakeBuildType: MinSizeRel + CMakeBuildType: Release trigger: batch: true From ca90e9017db6ca171e0ab693d65b8348b41f8c65 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 18 Mar 2019 18:12:04 -0400 Subject: [PATCH 030/151] BUG: Python packages will require itk>=5.0rc1 --- {{cookiecutter.project_name}}/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 4225e8d..8bf6171 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -44,6 +44,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk' + r'itk>=5.0rc1' ] ) From a587ac1a7e209fc0eaa4eef020dc57a840a857ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 23 Mar 2019 10:19:41 -0400 Subject: [PATCH 031/151] ENH: Add Azure Pipelines CI. Add Azure Pipelines CI, which supersedes Appveyor, Circle and Travis CI. Update the README file badges accordingly. --- .circleci/config.yml | 86 ------- .travis.yml | 20 -- README.rst | 18 +- appveyor.yml | 25 -- azure-pipelines.yml | 222 ++++++++++++++++++ .../.circleci/config.yml | 63 ----- {{cookiecutter.project_name}}/.travis.yml | 15 -- {{cookiecutter.project_name}}/README.rst | 18 +- {{cookiecutter.project_name}}/appveyor.yml | 21 -- .../azure-pipelines.yml | 216 +++++++++++++++++ 10 files changed, 448 insertions(+), 256 deletions(-) delete mode 100644 .circleci/config.yml delete mode 100644 .travis.yml delete mode 100644 appveyor.yml create mode 100644 azure-pipelines.yml delete mode 100644 {{cookiecutter.project_name}}/.circleci/config.yml delete mode 100644 {{cookiecutter.project_name}}/.travis.yml delete mode 100644 {{cookiecutter.project_name}}/appveyor.yml create mode 100644 {{cookiecutter.project_name}}/azure-pipelines.yml diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index 84eec87..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,86 +0,0 @@ -version: 2 -jobs: - build-and-test: - working_directory: /ITKModuleTemplate-build - docker: - - image: insighttoolkit/module-ci:latest - steps: - - checkout: - path: /ITKModuleTemplateCookieCutter - - run: - name: Fetch CTest driver script - command: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - - run: - name: Evaluate template - command: | - python -m pip install cookiecutter - cd / - python -m cookiecutter --no-input /ITKModuleTemplateCookieCutter - - run: - name: Configure CTest script - command: | - SHASNIP=$(echo $CIRCLE_SHA1 | cut -c1-7) - - # Only for testing the template - mkdir -p /ITKModuleTemplate/.git - - cat > dashboard.cmake << EOF - set(CTEST_SITE "CircleCI") - set(CTEST_BUILD_NAME "External-ITKModuleTemplate-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}-${SHASNIP}") - set(CTEST_BUILD_CONFIGURATION "MinSizeRel") - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - set(CTEST_BUILD_FLAGS: "-j5") - set(CTEST_SOURCE_DIRECTORY /ITKModuleTemplate) - set(CTEST_BINARY_DIRECTORY /ITKModuleTemplate-build) - set(dashboard_model Experimental) - set(dashboard_no_clean 1) - - # Only for testing the template - set(dashboard_no_update 1) - - set(dashboard_cache " - ITK_DIR:PATH=/ITK-build - BUILD_TESTING:BOOL=ON - ") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - - run: - name: Build and Test - no_output_timeout: 1.0h - command: | - ctest -j 2 -VV -S dashboard.cmake - package: - working_directory: ~/ - machine: true - steps: - - checkout: - path: ~/ITKModuleTemplateCookieCutter - - run: - name: Evaluate template - command: | - python -m pip install cookiecutter - cd ~/ - python -m cookiecutter --no-input ~/ITKModuleTemplateCookieCutter - - run: - name: Fetch build script - command: | - cd ~/ITKModuleTemplate - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - - run: - name: Build Python packages - no_output_timeout: 1.0h - command: | - cd ~/ITKModuleTemplate - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh - - store_artifacts: - path: dist - destination: dist - -workflows: - version: 2 - build-test-package: - jobs: - - build-and-test - - package diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 4479da0..0000000 --- a/.travis.yml +++ /dev/null @@ -1,20 +0,0 @@ -sudo: true -language: cpp -os: -- osx -compiler: -- gcc -cache: - directories: - - "$HOME/Library/Caches/Homebrew" -script: -- curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py -- sudo python get-pip.py -- sudo python -m pip install cookiecutter -- cookiecutter --no-input . -- cd ITKModuleTemplate -- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O -- chmod u+x macpython-download-cache-and-build-module-wheels.sh -- ./macpython-download-cache-and-build-module-wheels.sh -- tar -zcvf dist.tar.gz dist/ -- curl --upload-file dist.tar.gz https://transfer.sh/dist.tar.gz diff --git a/README.rst b/README.rst index fa04d2d..738d30a 100644 --- a/README.rst +++ b/README.rst @@ -1,20 +1,12 @@ ITKModuleTemplate ================= -.. |CircleCI| image:: https://circleci.com/gh/InsightSoftwareConsortium/ITKModuleTemplate.svg?style=shield - :target: https://circleci.com/gh/InsightSoftwareConsortium/ITKModuleTemplate +.. image:: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/InsightSoftwareConsortium.ITKModuleTemplate?branchName=master + :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=8&branchName=master + :alt: Build Status -.. |TravisCI| image:: https://travis-ci.org/InsightSoftwareConsortium/ITKModuleTemplate.svg?branch=master - :target: https://travis-ci.org/InsightSoftwareConsortium/ITKModuleTemplate - -.. |AppVeyor| image:: https://img.shields.io/appveyor/ci/itkrobot/itkmoduletemplate.svg - :target: https://ci.appveyor.com/project/itkrobot/itkmoduletemplate - -=========== =========== =========== - Linux macOS Windows -=========== =========== =========== -|CircleCI| |TravisCI| |AppVeyor| -=========== =========== =========== +Overview +-------- This is a module for the `Insight Toolkit (ITK) `_ for segmentation and registration. It is designed to work with the ITK modular diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 239dfdb..0000000 --- a/appveyor.yml +++ /dev/null @@ -1,25 +0,0 @@ -branches: - only: - - master - - release - -version: "0.0.1.{build}" - -install: - - - python -m pip install cookiecutter - - cookiecutter --no-input . - - cd ITKModuleTemplate - - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - - ps: .\windows-download-cache-and-build-module-wheels.ps1 - -build: off - -test: off - -artifacts: - - # pushing entire folder as a zip archive - - path: dist\* - -deploy: off diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..1d87c75 --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,222 @@ +variables: + ITKGitTag: v5.0rc01 + CMakeBuildType: MinSizeRel + +trigger: + batch: true + branches: + include: + - master + +jobs: + +- job: 'Test' + displayName: "Build and test" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + + strategy: + matrix: + Linux: + imageName: 'ubuntu-16.04' + cCompiler: gcc + cxxCompiler: g++ + compilerInitialization: '' + macOS: + imageName: 'macos-10.13' + cCompiler: clang + cxxCompiler: clang++ + compilerInitialization: '' + Windows: + imageName: 'vs2017-win2016' + cCompiler: cl.exe + cxxCompiler: cl.exe + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + + pool: + vmImage: $(imageName) + + steps: + - bash: | + set -x + if [ -n "$(System.PullRequest.SourceCommitId)" ]; then + git checkout $(System.PullRequest.SourceCommitId) + fi + displayName: 'Checkout pull request HEAD' + + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install scikit-ci-addons + python -m pip install ninja + displayName: 'Install build dependencies' + + - script: | + git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Download ITK' + + - script: | + mkdir ITK-build + cd ITK-build + $(compilerInitialization) + cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Build ITK' + + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O + displayName: 'Fetch CTest driver script' + + - script: | + python -m pip install cookiecutter + cd / + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory)/ITKModuleTemplate $(Agent.SourcesDirectory) + displayName: 'Evaluate template' + + - bash: | + cat > dashboard.cmake << EOF + set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) + set(dashboard_source_name "$(Build.Repository.Name)") + if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) + set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") + set(dashboard_model "Experimental") + elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") + set(branch "-master") + set(dashboard_model "Continuous") + else() + set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") + set(dashboard_model "Experimental") + endif() + if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) + set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") + else() + set(pr "") + endif() + set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") + set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) + set(CTEST_BUILD_CONFIGURATION "Release") + set(CTEST_CMAKE_GENERATOR "Ninja") + set(CTEST_CUSTOM_WARNING_EXCEPTION + \${CTEST_CUSTOM_WARNING_EXCEPTION} + # macOS Azure Pipelines + "ld: warning: text-based stub file" + ) + set(dashboard_no_clean 1) + set(ENV{CC} $(cCompiler)) + set(ENV{CXX} $(cxxCompiler)) + set(dashboard_cache " + ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build + BUILD_TESTING:BOOL=ON + ") + string(TIMESTAMP build_date "%Y-%m-%d") + message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") + message("CTEST_SITE = \${CTEST_SITE}") + include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) + EOF + cat dashboard.cmake + displayName: 'Configure CTest script' + + - script: | + $(compilerInitialization) + ctest -j 2 -V -S dashboard.cmake + displayName: 'Build and test' + + - script: | + sudo pip3 install --upgrade pip + sudo pip3 install --upgrade setuptools + sudo pip3 install scikit-ci-addons + ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml + condition: succeededOrFailed() + displayName: 'Format CTest output in JUnit format' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" + testRunTitle: 'CTest $(Agent.OS)' + condition: succeededOrFailed() + displayName: 'Publish test results' + + +- job: 'PackageLinux' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + displayName: "Build Linux Python packages" + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'LinuxWheels' + targetPath: './dist' + + +- job: 'PackageMacOS' + displayName: "Build macOS Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'macos-10.13' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./macpython-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'MacOSWheels' + targetPath: './dist' + + +- job: 'PackageWindows' + displayName: "Build Windows Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'vs2017-win2016' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + displayName: 'Fetch build script' + + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set ITK_PACKAGE_VERSION=$(ITKGitTag) + set CC=cl.exe + set CXX=cl.exe + powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'WindowsWheels' + targetPath: './dist' diff --git a/{{cookiecutter.project_name}}/.circleci/config.yml b/{{cookiecutter.project_name}}/.circleci/config.yml deleted file mode 100644 index ed7b410..0000000 --- a/{{cookiecutter.project_name}}/.circleci/config.yml +++ /dev/null @@ -1,63 +0,0 @@ -version: 2 -jobs: - build-and-test: - working_directory: /{{ cookiecutter.project_name }}-build - docker: - - image: insighttoolkit/module-ci:latest - steps: - - checkout: - path: /{{ cookiecutter.project_name }} - - run: - name: Fetch CTest driver script - command: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - - run: - name: Configure CTest script - command: | - SHASNIP=$(echo $CIRCLE_SHA1 | cut -c1-7) - cat > dashboard.cmake << EOF - set(CTEST_SITE "CircleCI") - set(CTEST_BUILD_NAME "External-{{ cookiecutter.project_name }}-${CIRCLE_BRANCH}-${CIRCLE_BUILD_NUM}-${SHASNIP}") - set(CTEST_BUILD_CONFIGURATION "MinSizeRel") - set(CTEST_CMAKE_GENERATOR "Unix Makefiles") - set(CTEST_BUILD_FLAGS: "-j5") - set(CTEST_SOURCE_DIRECTORY /{{ cookiecutter.project_name }}) - set(CTEST_BINARY_DIRECTORY /{{ cookiecutter.project_name }}-build) - set(dashboard_model Experimental) - set(dashboard_no_clean 1) - set(dashboard_cache " - ITK_DIR:PATH=/ITK-build - BUILD_TESTING:BOOL=ON - ") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - - run: - name: Build and Test - no_output_timeout: 1.0h - command: | - ctest -j 2 -VV -S dashboard.cmake - package: - working_directory: ~/{{ cookiecutter.project_name }} - machine: true - steps: - - checkout - - run: - name: Fetch build script - command: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - - run: - name: Build Python packages - no_output_timeout: 1.0h - command: | - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh - - store_artifacts: - path: dist - destination: dist - -workflows: - version: 2 - build-test-package: - jobs: - - build-and-test - - package diff --git a/{{cookiecutter.project_name}}/.travis.yml b/{{cookiecutter.project_name}}/.travis.yml deleted file mode 100644 index c0a5d09..0000000 --- a/{{cookiecutter.project_name}}/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: true -language: cpp -os: -- osx -compiler: -- gcc -cache: - directories: - - "$HOME/Library/Caches/Homebrew" -script: -- curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O -- chmod u+x macpython-download-cache-and-build-module-wheels.sh -- ./macpython-download-cache-and-build-module-wheels.sh -- tar -zcvf dist.tar.gz dist/ -- curl --upload-file dist.tar.gz https://transfer.sh/dist.tar.gz diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 492f27f..1a54fe8 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -1,20 +1,12 @@ {{ cookiecutter.project_name }} ================================= -.. |CircleCI| image:: https://circleci.com/gh/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?style=shield - :target: https://circleci.com/gh/InsightSoftwareConsortium/{{ cookiecutter.project_name }} +.. image:: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/{{ cookiecutter.project_name.lower() }}?branchName=master + :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=8&branchName=master + :alt: Build Status -.. |TravisCI| image:: https://travis-ci.org/InsightSoftwareConsortium/{{ cookiecutter.project_name }}.svg?branch=master - :target: https://travis-ci.org/InsightSoftwareConsortium/{{ cookiecutter.project_name }} - -.. |AppVeyor| image:: https://img.shields.io/appveyor/ci/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.lower() }}.svg - :target: https://ci.appveyor.com/project/{{ cookiecutter.github_username }}/{{ cookiecutter.project_name.lower() }} - -=========== =========== =========== - Linux macOS Windows -=========== =========== =========== -|CircleCI| |TravisCI| |AppVeyor| -=========== =========== =========== +Overview +-------- {{ cookiecutter.project_short_description }} diff --git a/{{cookiecutter.project_name}}/appveyor.yml b/{{cookiecutter.project_name}}/appveyor.yml deleted file mode 100644 index 99c62fc..0000000 --- a/{{cookiecutter.project_name}}/appveyor.yml +++ /dev/null @@ -1,21 +0,0 @@ -branches: - only: - - master - -version: "0.0.1.{build}" - -install: - - - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - - ps: .\windows-download-cache-and-build-module-wheels.ps1 - -build: off - -test: off - -artifacts: - - # pushing entire folder as a zip archive - - path: dist\* - -deploy: off diff --git a/{{cookiecutter.project_name}}/azure-pipelines.yml b/{{cookiecutter.project_name}}/azure-pipelines.yml new file mode 100644 index 0000000..37f7f45 --- /dev/null +++ b/{{cookiecutter.project_name}}/azure-pipelines.yml @@ -0,0 +1,216 @@ +variables: + ITKGitTag: v5.0rc01 + CMakeBuildType: MinSizeRel + +trigger: + batch: true + branches: + include: + - master + +jobs: + +- job: 'Test' + displayName: "Build and test" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + + strategy: + matrix: + Linux: + imageName: 'ubuntu-16.04' + cCompiler: gcc + cxxCompiler: g++ + compilerInitialization: '' + macOS: + imageName: 'macos-10.13' + cCompiler: clang + cxxCompiler: clang++ + compilerInitialization: '' + Windows: + imageName: 'vs2017-win2016' + cCompiler: cl.exe + cxxCompiler: cl.exe + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + + pool: + vmImage: $(imageName) + + steps: + - bash: | + set -x + if [ -n "$(System.PullRequest.SourceCommitId)" ]; then + git checkout $(System.PullRequest.SourceCommitId) + fi + displayName: 'Checkout pull request HEAD' + + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + python -m pip install --upgrade pip + python -m pip install --upgrade setuptools + python -m pip install scikit-ci-addons + python -m pip install ninja + displayName: 'Install build dependencies' + + - script: | + git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Download ITK' + + - script: | + mkdir ITK-build + cd ITK-build + $(compilerInitialization) + cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + workingDirectory: $(Agent.BuildDirectory) + displayName: 'Build ITK' + + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O + displayName: 'Fetch CTest driver script' + + - bash: | + cat > dashboard.cmake << EOF + set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) + set(dashboard_source_name "$(Build.Repository.Name)") + if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) + set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") + set(dashboard_model "Experimental") + elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") + set(branch "-master") + set(dashboard_model "Continuous") + else() + set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") + set(dashboard_model "Experimental") + endif() + if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) + set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") + else() + set(pr "") + endif() + set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") + set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) + set(CTEST_BUILD_CONFIGURATION "Release") + set(CTEST_CMAKE_GENERATOR "Ninja") + set(CTEST_CUSTOM_WARNING_EXCEPTION + \${CTEST_CUSTOM_WARNING_EXCEPTION} + # macOS Azure Pipelines + "ld: warning: text-based stub file" + ) + set(dashboard_no_clean 1) + set(ENV{CC} $(cCompiler)) + set(ENV{CXX} $(cxxCompiler)) + set(dashboard_cache " + ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build + BUILD_TESTING:BOOL=ON + ") + string(TIMESTAMP build_date "%Y-%m-%d") + message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") + message("CTEST_SITE = \${CTEST_SITE}") + include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) + EOF + cat dashboard.cmake + displayName: 'Configure CTest script' + + - script: | + $(compilerInitialization) + ctest -j 2 -V -S dashboard.cmake + displayName: 'Build and test' + + - script: | + sudo pip3 install --upgrade pip + sudo pip3 install --upgrade setuptools + sudo pip3 install scikit-ci-addons + ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml + condition: succeededOrFailed() + displayName: 'Format CTest output in JUnit format' + + - task: PublishTestResults@2 + inputs: + testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" + testRunTitle: 'CTest $(Agent.OS)' + condition: succeededOrFailed() + displayName: 'Publish test results' + + +- job: 'PackageLinux' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + displayName: "Build Linux Python packages" + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'LinuxWheels' + targetPath: './dist' + + +- job: 'PackageMacOS' + displayName: "Build macOS Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'macos-10.13' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKGitTag) + ./macpython-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'MacOSWheels' + targetPath: './dist' + + +- job: 'PackageWindows' + displayName: "Build Windows Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'vs2017-win2016' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + displayName: 'Fetch build script' + + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set ITK_PACKAGE_VERSION=$(ITKGitTag) + set CC=cl.exe + set CXX=cl.exe + powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'WindowsWheels' + targetPath: './dist' From e14100c1420ef2f33a8994e152a9105e4dd42728 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 25 Mar 2019 13:14:21 -0400 Subject: [PATCH 032/151] DOC: Update Azure Pipelines README badge definition id --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 738d30a..c595a53 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ ITKModuleTemplate ================= .. image:: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/InsightSoftwareConsortium.ITKModuleTemplate?branchName=master - :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=8&branchName=master + :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=19&branchName=master :alt: Build Status Overview From a45db94bcced3ae8e28587b68d9b84526a07d1a7 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 25 Mar 2019 14:40:20 -0400 Subject: [PATCH 033/151] BUG: Fix Azure Build.SourcesDirectory variable name Also prevent itk_common.cmake from deleting the source directory because it does not think it is a Git repository. Evaluate the cookie cutter for the Python builds, also. --- azure-pipelines.yml | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1d87c75..1b33b03 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -53,6 +53,7 @@ jobs: python -m pip install --upgrade pip python -m pip install --upgrade setuptools python -m pip install scikit-ci-addons + python -m pip install cookiecutter python -m pip install ninja displayName: 'Install build dependencies' @@ -74,10 +75,9 @@ jobs: curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O displayName: 'Fetch CTest driver script' - - script: | - python -m pip install cookiecutter - cd / - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory)/ITKModuleTemplate $(Agent.SourcesDirectory) + - bash: | + python -m cookiecutter --no-input --output-dir "$(Agent.BuildDirectory)" "$(Build.SourcesDirectory)" + mkdir "$(Agent.BuildDirectory)/ITKModuleTemplate/.git" displayName: 'Evaluate template' - bash: | @@ -136,7 +136,7 @@ jobs: sudo pip3 install --upgrade pip sudo pip3 install --upgrade setuptools sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml + ci_addons ctest_junit_formatter "$(Agent.BuildDirectory)/build" > "$(Agent.BuildDirectory)/JUnitTestResults.xml" condition: succeededOrFailed() displayName: 'Format CTest output in JUnit format' @@ -161,15 +161,26 @@ jobs: chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Fetch build script' + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + cd $(Agent.BuildDirectory)/ITKModuleTemplate export ITK_PACKAGE_VERSION=$(ITKGitTag) - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh + $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' - task: PublishPipelineArtifact@0 inputs: artifactName: 'LinuxWheels' - targetPath: './dist' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - job: 'PackageMacOS' @@ -186,14 +197,20 @@ jobs: displayName: 'Fetch build script' - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + cd $(Agent.BuildDirectory)/ITKModuleTemplate export ITK_PACKAGE_VERSION=$(ITKGitTag) - ./macpython-download-cache-and-build-module-wheels.sh + $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' - task: PublishPipelineArtifact@0 inputs: artifactName: 'MacOSWheels' - targetPath: './dist' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - job: 'PackageWindows' @@ -208,15 +225,21 @@ jobs: curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O displayName: 'Fetch build script' + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cd $(Agent.BuildDirectory)\ITKModuleTemplate set ITK_PACKAGE_VERSION=$(ITKGitTag) set CC=cl.exe set CXX=cl.exe - powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 + powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 displayName: 'Build Python packages' - task: PublishPipelineArtifact@0 inputs: artifactName: 'WindowsWheels' - targetPath: './dist' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' From 3789d8147023714b190993bad34b8ab4e991d910 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 23 Dec 2018 17:06:56 -0500 Subject: [PATCH 034/151] STYLE: Conform to the ITK SW Guide when reporting in tests. Conform to the ITK SW Guide when reporting in tests: - Write explicitly that arguments are missing. - Write explicitly that the test has finished. --- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 71b6b8d..e74450e 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -55,6 +55,7 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) { if( argc < 2 ) { + std::cerr << "Missing parameters." << std::endl; std::cerr << "Usage: " << argv[0]; std::cerr << " outputImage"; std::cerr << std::endl; @@ -92,5 +93,6 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) TRY_EXPECT_NO_EXCEPTION( writer->Update() ); + std::cout << "Test finished." << std::endl; return EXIT_SUCCESS; } From 1a70e13cce183ccabc4ca1b15f5e9ba0abeae89c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 30 Mar 2019 21:57:24 -0400 Subject: [PATCH 035/151] BUG: Remove duplicate azure-pipelines.yml We now use test/azure-pipelines.yml. --- .../azure-pipelines.yml | 216 ------------------ 1 file changed, 216 deletions(-) delete mode 100644 {{cookiecutter.project_name}}/azure-pipelines.yml diff --git a/{{cookiecutter.project_name}}/azure-pipelines.yml b/{{cookiecutter.project_name}}/azure-pipelines.yml deleted file mode 100644 index 37f7f45..0000000 --- a/{{cookiecutter.project_name}}/azure-pipelines.yml +++ /dev/null @@ -1,216 +0,0 @@ -variables: - ITKGitTag: v5.0rc01 - CMakeBuildType: MinSizeRel - -trigger: - batch: true - branches: - include: - - master - -jobs: - -- job: 'Test' - displayName: "Build and test" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - - strategy: - matrix: - Linux: - imageName: 'ubuntu-16.04' - cCompiler: gcc - cxxCompiler: g++ - compilerInitialization: '' - macOS: - imageName: 'macos-10.13' - cCompiler: clang - cxxCompiler: clang++ - compilerInitialization: '' - Windows: - imageName: 'vs2017-win2016' - cCompiler: cl.exe - cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' - - pool: - vmImage: $(imageName) - - steps: - - bash: | - set -x - if [ -n "$(System.PullRequest.SourceCommitId)" ]; then - git checkout $(System.PullRequest.SourceCommitId) - fi - displayName: 'Checkout pull request HEAD' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install scikit-ci-addons - python -m pip install ninja - displayName: 'Install build dependencies' - - - script: | - git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Download ITK' - - - script: | - mkdir ITK-build - cd ITK-build - $(compilerInitialization) - cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK - ninja - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Build ITK' - - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - displayName: 'Fetch CTest driver script' - - - bash: | - cat > dashboard.cmake << EOF - set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) - set(dashboard_source_name "$(Build.Repository.Name)") - if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) - set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") - set(dashboard_model "Experimental") - elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") - set(branch "-master") - set(dashboard_model "Continuous") - else() - set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") - set(dashboard_model "Experimental") - endif() - if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) - set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") - else() - set(pr "") - endif() - set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") - set(CTEST_UPDATE_VERSION_ONLY 1) - set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) - set(CTEST_BUILD_CONFIGURATION "Release") - set(CTEST_CMAKE_GENERATOR "Ninja") - set(CTEST_CUSTOM_WARNING_EXCEPTION - \${CTEST_CUSTOM_WARNING_EXCEPTION} - # macOS Azure Pipelines - "ld: warning: text-based stub file" - ) - set(dashboard_no_clean 1) - set(ENV{CC} $(cCompiler)) - set(ENV{CXX} $(cxxCompiler)) - set(dashboard_cache " - ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build - BUILD_TESTING:BOOL=ON - ") - string(TIMESTAMP build_date "%Y-%m-%d") - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") - message("CTEST_SITE = \${CTEST_SITE}") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - cat dashboard.cmake - displayName: 'Configure CTest script' - - - script: | - $(compilerInitialization) - ctest -j 2 -V -S dashboard.cmake - displayName: 'Build and test' - - - script: | - sudo pip3 install --upgrade pip - sudo pip3 install --upgrade setuptools - sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml - condition: succeededOrFailed() - displayName: 'Format CTest output in JUnit format' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" - testRunTitle: 'CTest $(Agent.OS)' - condition: succeededOrFailed() - displayName: 'Publish test results' - - -- job: 'PackageLinux' - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - displayName: "Build Linux Python packages" - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag) - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LinuxWheels' - targetPath: './dist' - - -- job: 'PackageMacOS' - displayName: "Build macOS Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'macos-10.13' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag) - ./macpython-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MacOSWheels' - targetPath: './dist' - - -- job: 'PackageWindows' - displayName: "Build Windows Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'vs2017-win2016' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - displayName: 'Fetch build script' - - - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set ITK_PACKAGE_VERSION=$(ITKGitTag) - set CC=cl.exe - set CXX=cl.exe - powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WindowsWheels' - targetPath: './dist' From cde1c91314a096bfcf110a27b5652e36778f2291 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 30 Mar 2019 21:59:37 -0400 Subject: [PATCH 036/151] BUG: Remove github_username parameter This was required for AppVeyor, but it is no longer needed. --- README.rst | 3 --- cookiecutter.json | 1 - 2 files changed, 4 deletions(-) diff --git a/README.rst b/README.rst index c595a53..b8fb6c3 100644 --- a/README.rst +++ b/README.rst @@ -32,9 +32,6 @@ Reasonable defaults will be provided for all of the parameters. The parameters a *email* Your email. -*github_username* - Your GitHub username. - *project_name* This is a name for the project, which is *ITK* followed by the module name, by convention. Examples include *ITKIsotropicWavelets* or diff --git a/cookiecutter.json b/cookiecutter.json index 9551731..a7568fc 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -1,7 +1,6 @@ { "full_name": "Insight Software Consortium", "email": "itk+community@discourse.itk.org", - "github_username": "itkrobot", "project_name": "ITKModuleTemplate", "module_name": "{{ cookiecutter.project_name[3:] }}", "filter_name": "MyFilter", From 640c147709880266d01357e7a56377fc5a402067 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 31 Mar 2019 19:15:57 -0400 Subject: [PATCH 037/151] DOC: Add PyPI and License badge to template README --- {{cookiecutter.project_name}}/README.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 1a54fe8..5218ef7 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -5,6 +5,14 @@ :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=8&branchName=master :alt: Build Status +.. image:: https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg + :target: https://pypi.python.org/pypi/{{ cookiecutter.python_package_name }} + :alt: PyPI Version + +.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg + :target: {{ cookiecutter.download_url }}/blob/master/LICENSE) + :alt: License + Overview -------- From 2bf881572eca277e42e8d0a8d41e92cd99336a77 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 12 Jun 2019 20:56:57 -0400 Subject: [PATCH 038/151] ENH: Build against ITK 5.0.0.post1 --- azure-pipelines.yml | 12 +++++++----- .../test/azure-pipelines.yml | 11 ++++++----- 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1b33b03..4feb816 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,7 @@ variables: - ITKGitTag: v5.0rc01 - CMakeBuildType: MinSizeRel + ITKGitTag: v5.0.0 + ITKPythonPost: '.post1' + CMakeBuildType: Release trigger: batch: true @@ -173,6 +174,7 @@ jobs: - script: | cd $(Agent.BuildDirectory)/ITKModuleTemplate + export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) export ITK_PACKAGE_VERSION=$(ITKGitTag) $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -188,7 +190,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'macos-10.13' + vmImage: 'macos-10.14' steps: - script: | @@ -203,7 +205,7 @@ jobs: - script: | cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKGitTag) + export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -233,7 +235,7 @@ jobs: - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd $(Agent.BuildDirectory)\ITKModuleTemplate - set ITK_PACKAGE_VERSION=$(ITKGitTag) + set ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) set CC=cl.exe set CXX=cl.exe powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index 6c350a6..b971e84 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,5 +1,6 @@ variables: - ITKGitTag: v5.0rc01 + ITKGitTag: v5.0.0 + ITKPythonPost: '.post1' CMakeBuildType: Release trigger: @@ -156,7 +157,7 @@ jobs: displayName: 'Fetch build script' - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag) + export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) ./dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -171,7 +172,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'macos-10.13' + vmImage: 'macos-10.14' steps: - script: | @@ -180,7 +181,7 @@ jobs: displayName: 'Fetch build script' - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag) + export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) ./macpython-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -204,7 +205,7 @@ jobs: - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set ITK_PACKAGE_VERSION=$(ITKGitTag) + set ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) set CC=cl.exe set CXX=cl.exe powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 From 702fd1ed02252c67f3cbb193eeceafe981dc487e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 13 Jun 2019 10:21:38 -0400 Subject: [PATCH 039/151] BUG: Python packages require itk>=5.0.0.post1 --- {{cookiecutter.project_name}}/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 8bf6171..00b54fb 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -44,6 +44,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.0rc1' + r'itk>=5.0.0.post1' ] ) From 11d94d14b66c469cf654d4ad545defef1bf59273 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 15 Jun 2019 14:30:08 -0400 Subject: [PATCH 040/151] ENH: Use separate ITK Git tags for C++ and Python CI By separating the tags, we can use different versions of ITK for C++ and Python builds. In this way, we can use, for example, a Git commit hash for the C++ version, and an unrelated tag name for the Python version. --- azure-pipelines.yml | 11 +++++------ .../test/azure-pipelines.yml | 10 +++++----- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4feb816..4e07740 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.0.0 - ITKPythonPost: '.post1' + ITKGitTag: 'v5.0.0' + ITKPythonGitTag: 'v5.0.0.post1' CMakeBuildType: Release trigger: @@ -174,8 +174,7 @@ jobs: - script: | cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) - export ITK_PACKAGE_VERSION=$(ITKGitTag) + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -205,7 +204,7 @@ jobs: - script: | cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -235,7 +234,7 @@ jobs: - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd $(Agent.BuildDirectory)\ITKModuleTemplate - set ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) + set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) set CC=cl.exe set CXX=cl.exe powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index b971e84..fd81e77 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.0.0 - ITKPythonPost: '.post1' + ITKGitTag: 'v5.0.0' + ITKPythonGitTag: 'v5.0.0.post1' CMakeBuildType: Release trigger: @@ -157,7 +157,7 @@ jobs: displayName: 'Fetch build script' - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) ./dockcross-manylinux-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -181,7 +181,7 @@ jobs: displayName: 'Fetch build script' - script: | - export ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) ./macpython-download-cache-and-build-module-wheels.sh displayName: 'Build Python packages' @@ -205,7 +205,7 @@ jobs: - script: | call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set ITK_PACKAGE_VERSION=$(ITKGitTag)$(ITKPythonPost) + set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) set CC=cl.exe set CXX=cl.exe powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 From d66d3df9c14e091763784cd0c8020f48d6542cb3 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 19 Jun 2019 11:31:09 -0400 Subject: [PATCH 041/151] BUG: Remove quotes from ITK version in Azure configuration These are optional and they interfere with the ITK/Utilities/Maintenance/UpdateRequiredITKVersionInRemoteModules.sh script. --- azure-pipelines.yml | 4 ++-- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4e07740..847741a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: 'v5.0.0' - ITKPythonGitTag: 'v5.0.0.post1' + ITKGitTag: v5.0.0 + ITKPythonGitTag: v5.0.0.post1 CMakeBuildType: Release trigger: diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index fd81e77..1d12788 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: 'v5.0.0' - ITKPythonGitTag: 'v5.0.0.post1' + ITKGitTag: v5.0.0 + ITKPythonGitTag: v5.0.0.post1 CMakeBuildType: Release trigger: From 9eb346da7e247700b014532acad2ae6449a288f9 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 23 Jul 2019 15:17:36 -0400 Subject: [PATCH 042/151] ENH: Support arbitrary ITK version for C++ CI testing So we can choose an arbitrary ITK Git hash to build a given remote module against. --- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index 1d12788..bcf6376 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -58,7 +58,9 @@ jobs: displayName: 'Install build dependencies' - script: | - git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git + git clone https://github.com/InsightSoftwareConsortium/ITK.git + cd ITK + git checkout $(ITKGitTag) workingDirectory: $(Agent.BuildDirectory) displayName: 'Download ITK' From ec2850f544564656563283c5676b9c8f749ba8bf Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 29 Jul 2019 23:41:09 -0400 Subject: [PATCH 043/151] STYLE: Convert README from reStructuredText to Markdown With pandoc. First step towards breaking up the ITKModuleTemplate documentation into multiple files and adding documentation on how to configure Azure Pipelines for CI / CD. --- README.md | 129 ++++++++++++++++++++++++++++++++++++++++++++++++++++ README.rst | 131 ----------------------------------------------------- 2 files changed, 129 insertions(+), 131 deletions(-) create mode 100644 README.md delete mode 100644 README.rst diff --git a/README.md b/README.md new file mode 100644 index 0000000..fe08fb0 --- /dev/null +++ b/README.md @@ -0,0 +1,129 @@ +ITKModuleTemplate +================= + +[![Build Status](https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/InsightSoftwareConsortium.ITKModuleTemplate?branchName=master)](https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=19&branchName=master) + +Overview +-------- + +This is a module for the [Insight Toolkit (ITK)](http://itk.org) for +segmentation and registration. It is designed to work with the ITK +modular system. + +This module is a template to be used as a starting point for a new ITK +module. + +Getting Started +--------------- + +The following will get an external module started in a new repository: + + python -m pip install cookiecutter + python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate + # Fill in the information requested at the prompts + +Reasonable defaults will be provided for all of the parameters. The +parameters are: + +*full\_name* +Your full name. + +*email* +Your email. + +*project\_name* +This is a name for the project, which is *ITK* followed by the module +name, by convention. Examples include *ITKIsotropicWavelets* or +*ITKBoneMorphometry*. + +*module\_name* +This is the name of the module. Since this is an external module, it +does not start with the *ITK* prefix. It is in CamelCase, by convention. +Examples include *IsotropicWavelets* and *BoneMorphometry*. + +*filter\_name* +The skeleton of an `itk::ImageToImageFilter` will be created by default. +Optionally specify this value, if you will be adding an +`itk::ImageToImageFilter` to your module. + +*python\_package\_name* +This is the name of the Python package that will be created from the +module. By convention, this is *itk-\*. +For example, *itk-isotropicwavelets* or *itk-bonemorphometry*. + +*download\_url* +This is the download url added to the Python package metadata. This can +be the GitHub repository URL. + +*project\_short\_description* +A short description to use in the project README, module Doxygen +documentation, and Python package documentation. + +*project\_long\_description* +A long description to use in the project README, module Doxygen +documentation, and Python package documentation. + +The output of the cookiecutter is a buildable ITK external module with +example classes. Remove or replace the classes with your new classes. +Push your new module to GitHub, and enable builds on +[CircleCI](https://circleci.com/), [TravisCI](https://travis-ci.org/), +and [AppVeyor](https://www.appveyor.com/). + +Documentation on [how to populate the +module](https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1430009) +can be found in the [ITK Software +Guide](https://itk.org/ITKSoftwareGuide/html/). + +To improve the discoverability of your module on GitHub, first push the +associated repository, then add +[itk-module](https://github.com/topics/itk-module) to the project's +[GitHub Topics](https://help.github.com/articles/about-topics/) . + +Remote Module +------------- + +After an [Insight Journal](http://www.insight-journal.org/) article has +been submitted, the module can be included in ITK as a [remote +module](https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x55-1640009.7). +Add a file in "ITK/Modules/Remote" called "YourModule.remote.cmake", for +this module it would be "ExternalExample.remote.cmake" with the +followlowing contents: + + itk_fetch_module(MyModule + "A description of the a module." + GIT_REPOSITORY http://github.com/myuser/ITKMyModule.git + GIT_TAG abcdef012345 + ) + +Python Packages +--------------- + +Continuous integration service configurations are included to build +Python packages for Linux, macOS, and Windows. These packages can be +[downloaded](https://itkpythonpackage.readthedocs.io/en/latest/Build_ITK_Module_Python_packages.html#github-automated-ci-package-builds) +and [uploaded to the Python Package Index +(PyPI)](https://itkpythonpackage.readthedocs.io/en/latest/Build_ITK_Module_Python_packages.html#upload-the-packages-to-pypi). + +ITKv4 Branch +------------ + +In the transition to the major release of ITKv5 your module might want +to be compatible with both versions: ITKv4 and ITKv5. In order to do +that, keep the master branch for development with ITKv5, and create +another branch, named `ITKv4`, or `release`, that is compatible with the +version 4.13 of ITK. For examples and updated information on how to do +this: please [check the discourse +conversation](https://discourse.itk.org/t/itk-external-module-github-builds-for-4-x-and-5-x/900). + +License +------- + +This software is distributed under the Apache 2.0 license. Please see +the *LICENSE* file for details. + +Authors +------- + +- Bradley Lowekamp +- Matt McCormick +- Jean-Baptiste VIMORT diff --git a/README.rst b/README.rst deleted file mode 100644 index b8fb6c3..0000000 --- a/README.rst +++ /dev/null @@ -1,131 +0,0 @@ -ITKModuleTemplate -================= - -.. image:: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/InsightSoftwareConsortium.ITKModuleTemplate?branchName=master - :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=19&branchName=master - :alt: Build Status - -Overview --------- - -This is a module for the `Insight Toolkit (ITK) `_ for -segmentation and registration. It is designed to work with the ITK modular -system. - -This module is a template to be used as a starting point for a new ITK module. - - -Getting Started ---------------- - -The following will get an external module started in a new repository:: - - python -m pip install cookiecutter - python -m cookiecutter gh:InsightSoftwareConsortium/ITKModuleTemplate - # Fill in the information requested at the prompts - -Reasonable defaults will be provided for all of the parameters. The parameters are: - -*full_name* - Your full name. - -*email* - Your email. - -*project_name* - This is a name for the project, which is *ITK* followed by the - module name, by convention. Examples include *ITKIsotropicWavelets* or - *ITKBoneMorphometry*. - -*module_name* - This is the name of the module. Since this is an external module, it does - not start with the *ITK* prefix. It is in CamelCase, by convention. Examples - include *IsotropicWavelets* and *BoneMorphometry*. - -*filter_name* - The skeleton of an ``itk::ImageToImageFilter`` will be created by default. - Optionally specify this value, if you will be adding an - ``itk::ImageToImageFilter`` to your module. - -*python_package_name* - This is the name of the Python package that will be created from the module. - By convention, this is *itk-*. For example, - *itk-isotropicwavelets* or *itk-bonemorphometry*. - -*download_url* - This is the download url added to the Python package metadata. This can be - the GitHub repository URL. - -*project_short_description* - A short description to use in the project README, module Doxygen - documentation, and Python package documentation. - -*project_long_description* - A long description to use in the project README, module Doxygen - documentation, and Python package documentation. - -The output of the cookiecutter is a buildable ITK external module with example -classes. Remove or replace the classes with your new classes. Push your new -module to GitHub, and enable builds on `CircleCI `_, -`TravisCI `_, and `AppVeyor -`_. - -Documentation on `how to populate the module -`_ -can be found in the `ITK Software Guide `_. - -To improve the discoverability of your module on GitHub, first push the -associated repository, then add `itk-module -`_ to the project's `GitHub Topics -`_ . - - -Remote Module -------------- - -After an `Insight Journal `_ article has been -submitted, the module can be included in ITK as a `remote module -`_. -Add a file in "ITK/Modules/Remote" called "YourModule.remote.cmake", for this -module it would be "ExternalExample.remote.cmake" with the followlowing -contents:: - - itk_fetch_module(MyModule - "A description of the a module." - GIT_REPOSITORY http://github.com/myuser/ITKMyModule.git - GIT_TAG abcdef012345 - ) - - -Python Packages ---------------- - -Continuous integration service configurations are included to build Python -packages for Linux, macOS, and Windows. These packages can be `downloaded -`_ -and `uploaded to the Python Package Index (PyPI) -`_. - - -ITKv4 Branch ------------- -In the transition to the major release of ITKv5 your module might want to be compatible with both versions: ITKv4 and ITKv5. -In order to do that, keep the master branch for development with ITKv5, and create another branch, named ``ITKv4``, or ``release``, -that is compatible with the version 4.13 of ITK. -For examples and updated information on how to do this: please `check the discourse conversation -`_. - - -License -------- - -This software is distributed under the Apache 2.0 license. Please see -the *LICENSE* file for details. - - -Authors -------- - -* Bradley Lowekamp -* Matt McCormick -* Jean-Baptiste VIMORT From 6d293920a6c14a4858656d361a2ffaf0ebce0b33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Mon, 8 Apr 2019 23:52:19 -0400 Subject: [PATCH 044/151] ENH: Use the `itkNameOfTestExecutableMacro` to get the test name Use the `itkNameOfTestExecutableMacro` to get the test name and prevent the the test from crashing when `argv[0]` is null, as recommended in: https://github.com/InsightSoftwareConsortium/ITK/pull/564 --- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index e74450e..725c89f 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -56,7 +56,7 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) if( argc < 2 ) { std::cerr << "Missing parameters." << std::endl; - std::cerr << "Usage: " << argv[0]; + std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv); std::cerr << " outputImage"; std::cerr << std::endl; return EXIT_FAILURE; From 29bd3dad7a529508d41975771a3a3cf1d64d0906 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 29 Jul 2019 23:56:06 -0400 Subject: [PATCH 045/151] ENH: Build against ITK 5.0.1 --- azure-pipelines.yml | 4 ++-- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 847741a..eb03826 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.0.0 - ITKPythonGitTag: v5.0.0.post1 + ITKGitTag: v5.0.1 + ITKPythonGitTag: v5.0.1 CMakeBuildType: Release trigger: diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index bcf6376..07de04c 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.0.0 - ITKPythonGitTag: v5.0.0.post1 + ITKGitTag: v5.0.1 + ITKPythonGitTag: v5.0.1 CMakeBuildType: Release trigger: From 66bfc0a25cc076e4537e5aa816e3f281f203b360 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 18 Aug 2019 22:13:09 -0400 Subject: [PATCH 046/151] STYLE: Use definition list for markup of parameters --- README.md | 58 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index fe08fb0..db6806b 100644 --- a/README.md +++ b/README.md @@ -25,43 +25,45 @@ The following will get an external module started in a new repository: Reasonable defaults will be provided for all of the parameters. The parameters are: -*full\_name* -Your full name. +
+
full_name
+
Your full name.
-*email* -Your email. +
email
+
Your email.
-*project\_name* -This is a name for the project, which is *ITK* followed by the module -name, by convention. Examples include *ITKIsotropicWavelets* or -*ITKBoneMorphometry*. +
project_name
+
This is a name for the project, which is ITK followed by the module +name, by convention. Examples include ITKIsotropicWavelets or +ITKBoneMorphometry.
-*module\_name* -This is the name of the module. Since this is an external module, it -does not start with the *ITK* prefix. It is in CamelCase, by convention. -Examples include *IsotropicWavelets* and *BoneMorphometry*. +
module_name
+
This is the name of the module. Since this is an external module, it +does not start with the ITK prefix. It is in CamelCase, by convention. +Examples include IsotropicWavelets and BoneMorphometry.
-*filter\_name* -The skeleton of an `itk::ImageToImageFilter` will be created by default. +
filter_name
+
The skeleton of an itk::ImageToImageFilter will be created by default. Optionally specify this value, if you will be adding an -`itk::ImageToImageFilter` to your module. +itk::ImageToImageFilter to your module. -*python\_package\_name* -This is the name of the Python package that will be created from the -module. By convention, this is *itk-\*. -For example, *itk-isotropicwavelets* or *itk-bonemorphometry*. +
python_package_name
+
This is the name of the Python package that will be created from the +module. By convention, this is itk- +For example, itk-isotropicwavelets or itk-bonemorphometry.
-*download\_url* -This is the download url added to the Python package metadata. This can -be the GitHub repository URL. +
download_url
+
This is the download url added to the Python package metadata. This can +be the GitHub repository URL.
-*project\_short\_description* -A short description to use in the project README, module Doxygen -documentation, and Python package documentation. +
project_short_description
+
A short description to use in the project README, module Doxygen +documentation, and Python package documentation.
-*project\_long\_description* -A long description to use in the project README, module Doxygen -documentation, and Python package documentation. +
project_long_description
+
A long description to use in the project README, module Doxygen +documentation, and Python package documentation.
+
The output of the cookiecutter is a buildable ITK external module with example classes. Remove or replace the classes with your new classes. From c43dd833ff1ae0c09f0c024c12e3c377e3ad1d31 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 31 Aug 2019 17:35:05 -0400 Subject: [PATCH 047/151] STYLE: C++11 style in filter test --- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 725c89f..5593e2c 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -61,9 +61,9 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) std::cerr << std::endl; return EXIT_FAILURE; } - const char * outputImageFileName = argv[1]; + const char * outputImageFileName = argv[1]; - const unsigned int Dimension = 2; + constexpr unsigned int Dimension = 2; using PixelType = float; using ImageType = itk::Image< PixelType, Dimension >; @@ -84,7 +84,7 @@ int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) filter->AddObserver( itk::ProgressEvent(), showProgress ); filter->SetInput(image); - typedef itk::ImageFileWriter< ImageType > WriterType; + using WriterType = itk::ImageFileWriter< ImageType >; WriterType::Pointer writer = WriterType::New(); writer->SetFileName( outputImageFileName ); writer->SetInput( filter->GetOutput() ); From 1f392929fde7efb6f5e2651dc1481faee39e5064 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 1 Dec 2019 16:37:38 -0500 Subject: [PATCH 048/151] STYLE: Use ITK clang-format style --- ...itkMinimalStandardRandomVariateGenerator.h | 12 ++-- .../include/itk{{cookiecutter.filter_name}}.h | 26 ++++----- .../itk{{cookiecutter.filter_name}}.hxx | 27 +++++---- ...kMinimalStandardRandomVariateGenerator.cxx | 16 ++---- ...imalStandardRandomVariateGeneratorTest.cxx | 13 +++-- .../itk{{cookiecutter.filter_name}}Test.cxx | 57 ++++++++++--------- 6 files changed, 72 insertions(+), 79 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index bfaa69b..1e5ea67 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -50,8 +50,7 @@ namespace Statistics * * \ingroup {{ cookiecutter.module_name }} */ -class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerator: - public RandomVariateGeneratorBase +class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerator : public RandomVariateGeneratorBase { public: ITK_DISALLOW_COPY_AND_ASSIGN(MinimalStandardRandomVariateGenerator); @@ -59,18 +58,18 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato /** Standard class typedefs. */ using Self = MinimalStandardRandomVariateGenerator; using Superclass = RandomVariateGeneratorBase; - using Pointer = SmartPointer< Self >; - using ConstPointer = SmartPointer< const Self >; + using Pointer = SmartPointer; + using ConstPointer = SmartPointer; using IntegerType = uint32_t; using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; /** Run-time type information (and related methods). */ - itkTypeMacro( MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); + itkTypeMacro(MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); /** Method for creation through the object factory. */ - itkNewMacro( Self ); + itkNewMacro(Self); /** initialize with a simple IntegerType */ void Initialize(int randomSeed); @@ -85,7 +84,6 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato void PrintSelf(std::ostream & os, Indent indent) const override; private: - NormalGeneratorType::Pointer m_NormalGenerator; }; diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index f8905ff..dfc7482 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -33,8 +33,8 @@ namespace itk * \ingroup {{ cookiecutter.module_name }} * */ -template< typename TInputImage, typename TOutputImage > -class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TOutputImage > +template +class {{ cookiecutter.filter_name }} : public ImageToImageFilter { public: ITK_DISALLOW_COPY_AND_ASSIGN({{ cookiecutter.filter_name }}); @@ -48,39 +48,37 @@ class {{ cookiecutter.filter_name }}: public ImageToImageFilter< TInputImage, TO using OutputPixelType = typename OutputImageType::PixelType; /** Standard class typedefs. */ - using Self = {{ cookiecutter.filter_name }}< InputImageType, OutputImageType >; - using Superclass = ImageToImageFilter< InputImageType, OutputImageType >; - using Pointer = SmartPointer< Self >; - using ConstPointer = SmartPointer< const Self >; + using Self = {{ cookiecutter.filter_name }}; + using Superclass = ImageToImageFilter; + using Pointer = SmartPointer; + using ConstPointer = SmartPointer; /** Run-time type information. */ - itkTypeMacro( {{ cookiecutter.filter_name }}, ImageToImageFilter ); + itkTypeMacro({{ cookiecutter.filter_name }}, ImageToImageFilter); /** Standard New macro. */ - itkNewMacro( Self ); + itkNewMacro(Self); protected: {{ cookiecutter.filter_name }}(); ~{{ cookiecutter.filter_name }}() override = default; - void PrintSelf( std::ostream& os, Indent indent ) const override; + void PrintSelf(std::ostream & os, Indent indent) const override; using OutputRegionType = typename OutputImageType::RegionType; - void DynamicThreadedGenerateData( const OutputRegionType & outputRegion) override; + void DynamicThreadedGenerateData(const OutputRegionType & outputRegion) override; private: - - #ifdef ITK_USE_CONCEPT_CHECKING // Add concept checking such as // itkConceptMacro( FloatingPointPixel, ( itk::Concept::IsFloatingPoint< typename InputImageType::PixelType > ) ); #endif }; -} +} // namespace itk #ifndef ITK_MANUAL_INSTANTIATION -#include "itk{{ cookiecutter.filter_name }}.hxx" +# include "itk{{ cookiecutter.filter_name }}.hxx" #endif #endif // itk{{ cookiecutter.filter_name }} diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx index a0b5f5b..aec3c54 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx @@ -26,38 +26,37 @@ namespace itk { -template< typename TInputImage, typename TOutputImage > -{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > +template +{{ cookiecutter.filter_name }} ::{{ cookiecutter.filter_name }}() -{ -} +{} -template< typename TInputImage, typename TOutputImage > +template void -{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > -::PrintSelf( std::ostream& os, Indent indent ) const +{{ cookiecutter.filter_name }} +::PrintSelf(std::ostream & os, Indent indent) const { - Superclass::PrintSelf( os, indent ); + Superclass::PrintSelf(os, indent); } -template< typename TInputImage, typename TOutputImage > +template void -{{ cookiecutter.filter_name }}< TInputImage, TOutputImage > -::DynamicThreadedGenerateData( const OutputRegionType & outputRegion) +{{ cookiecutter.filter_name }} +::DynamicThreadedGenerateData(const OutputRegionType & outputRegion) { - OutputImageType * output = this->GetOutput(); + OutputImageType * output = this->GetOutput(); const InputImageType * input = this->GetInput(); using InputRegionType = typename InputImageType::RegionType; InputRegionType inputRegion = InputRegionType(outputRegion.GetSize()); itk::ImageRegionConstIterator in(input, inputRegion); - itk::ImageRegionIterator out(output, outputRegion); + itk::ImageRegionIterator out(output, outputRegion); for (in.GoToBegin(), out.GoToBegin(); !in.IsAtEnd() && !out.IsAtEnd(); ++in, ++out) { - out.Set( in.Get() ); + out.Set(in.Get()); } } diff --git a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx index a9ce459..69d32cd 100644 --- a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx +++ b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx @@ -22,32 +22,28 @@ namespace itk namespace Statistics { -MinimalStandardRandomVariateGenerator -::MinimalStandardRandomVariateGenerator() +MinimalStandardRandomVariateGenerator ::MinimalStandardRandomVariateGenerator() { this->m_NormalGenerator = NormalGeneratorType::New(); - this->Initialize( 1 ); + this->Initialize(1); } void -MinimalStandardRandomVariateGenerator -::Initialize(int randomSeed) +MinimalStandardRandomVariateGenerator ::Initialize(int randomSeed) { - this->m_NormalGenerator->Initialize( randomSeed ); + this->m_NormalGenerator->Initialize(randomSeed); } double -MinimalStandardRandomVariateGenerator -::GetVariate() +MinimalStandardRandomVariateGenerator ::GetVariate() { return this->m_NormalGenerator->GetVariate(); } void -MinimalStandardRandomVariateGenerator -::PrintSelf(std::ostream & os, Indent indent) const +MinimalStandardRandomVariateGenerator ::PrintSelf(std::ostream & os, Indent indent) const { Superclass::PrintSelf(os, indent); } diff --git a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx index fdc2b1f..0ef8f37 100644 --- a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx @@ -21,16 +21,17 @@ #include "itkTestingMacros.h" #include "itkMath.h" -int itkMinimalStandardRandomVariateGeneratorTest( int, char * [] ) +int +itkMinimalStandardRandomVariateGeneratorTest(int, char *[]) { typedef itk::Statistics::MinimalStandardRandomVariateGenerator GeneratorType; - GeneratorType::Pointer generator = GeneratorType::New(); - - EXERCISE_BASIC_OBJECT_METHODS( generator, MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase ); + GeneratorType::Pointer generator = GeneratorType::New(); - generator->Initialize( 324 ); + EXERCISE_BASIC_OBJECT_METHODS(generator, MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); - TEST_EXPECT_TRUE( itk::Math::FloatAlmostEqual( generator->GetVariate(), 1.35581 , 4 , 0.0001)); + generator->Initialize(324); + + TEST_EXPECT_TRUE(itk::Math::FloatAlmostEqual(generator->GetVariate(), 1.35581, 4, 0.0001)); return EXIT_SUCCESS; } diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 5593e2c..a9105d0 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -16,81 +16,82 @@ * *=========================================================================*/ -#include "itk{{cookiecutter.filter_name}}.h" +#include "itk{{ cookiecutter.filter_name }}.h" #include "itkCommand.h" #include "itkImageFileWriter.h" #include "itkTestingMacros.h" -namespace{ +namespace +{ class ShowProgress : public itk::Command { public: - itkNewMacro( ShowProgress ); + itkNewMacro(ShowProgress); void - Execute( itk::Object* caller, const itk::EventObject& event ) override + Execute(itk::Object * caller, const itk::EventObject & event) override { - Execute( (const itk::Object*)caller, event ); + Execute((const itk::Object *)caller, event); } void - Execute( const itk::Object* caller, const itk::EventObject& event ) override + Execute(const itk::Object * caller, const itk::EventObject & event) override { - if ( !itk::ProgressEvent().CheckEvent( &event ) ) - { + if (!itk::ProgressEvent().CheckEvent(&event)) + { return; - } - const auto* processObject = dynamic_cast< const itk::ProcessObject* >( caller ); - if ( !processObject ) - { + } + const auto * processObject = dynamic_cast(caller); + if (!processObject) + { return; - } + } std::cout << " " << processObject->GetProgress(); } }; -} +} // namespace -int itk{{cookiecutter.filter_name}}Test( int argc, char * argv[] ) +int itk{{ cookiecutter.filter_name }}Test(int argc, char * argv[]) { - if( argc < 2 ) - { + if (argc < 2) + { std::cerr << "Missing parameters." << std::endl; std::cerr << "Usage: " << itkNameOfTestExecutableMacro(argv); std::cerr << " outputImage"; std::cerr << std::endl; return EXIT_FAILURE; - } + } const char * outputImageFileName = argv[1]; constexpr unsigned int Dimension = 2; using PixelType = float; - using ImageType = itk::Image< PixelType, Dimension >; + using ImageType = itk::Image; - using FilterType = itk::{{cookiecutter.filter_name}}< ImageType, ImageType >; + using FilterType = itk::{{ cookiecutter.filter_name }}; FilterType::Pointer filter = FilterType::New(); - EXERCISE_BASIC_OBJECT_METHODS( filter, {{cookiecutter.filter_name}}, ImageToImageFilter ); + EXERCISE_BASIC_OBJECT_METHODS(filter, {{ cookiecutter.filter_name }}, ImageToImageFilter); // Create input image to avoid test dependencies. ImageType::SizeType size; - size.Fill( 128 ); + size.Fill(128); ImageType::Pointer image = ImageType::New(); - image->SetRegions( size ); + image->SetRegions(size); image->Allocate(); image->FillBuffer(1.1f); ShowProgress::Pointer showProgress = ShowProgress::New(); - filter->AddObserver( itk::ProgressEvent(), showProgress ); + filter->AddObserver(itk::ProgressEvent(), showProgress); filter->SetInput(image); - using WriterType = itk::ImageFileWriter< ImageType >; + using WriterType = itk::ImageFileWriter; WriterType::Pointer writer = WriterType::New(); - writer->SetFileName( outputImageFileName ); - writer->SetInput( filter->GetOutput() ); + writer->SetFileName(outputImageFileName); + writer->SetInput(filter->GetOutput()); writer->SetUseCompression(true); - TRY_EXPECT_NO_EXCEPTION( writer->Update() ); + TRY_EXPECT_NO_EXCEPTION(writer->Update()); std::cout << "Test finished." << std::endl; From d1d59a6bfee44e602048bf93b82393ac86d648f9 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Thu, 20 Feb 2020 20:25:16 -0600 Subject: [PATCH 049/151] ENH: Updatee azure module for ITK 5.1rc2 --- azure-pipelines.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index eb03826..bb45195 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,6 +1,7 @@ +# The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate variables: - ITKGitTag: v5.0.1 - ITKPythonGitTag: v5.0.1 + ITKGitTag: v5.1rc02 + ITKPythonGitTag: v5.1rc02 CMakeBuildType: Release trigger: From c85bc09b10f0a36a622b63691f42b611a94ea544 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Thu, 20 Feb 2020 20:25:16 -0600 Subject: [PATCH 050/151] ENH: Update azure module for ITK 5.1rc2 --- azure-pipelines.yml | 245 +++++++++++++++++++++++--------------------- 1 file changed, 130 insertions(+), 115 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bb45195..acdfc79 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ -# The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate +# The file template originates from the instructions: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/README.md variables: - ITKGitTag: v5.1rc02 - ITKPythonGitTag: v5.1rc02 + ITKGitTag: v5.1rc02 #Used for choosing branch of ITK to checkout + ITKPythonGitTag: v5.1rc02 #Used to identify the release name for the cached python build environmeent ITKPythonBuilds-linux.tar.zst CMakeBuildType: Release trigger: @@ -19,21 +19,36 @@ jobs: strategy: matrix: - Linux: - imageName: 'ubuntu-16.04' - cCompiler: gcc - cxxCompiler: g++ - compilerInitialization: '' - macOS: - imageName: 'macos-10.13' - cCompiler: clang - cxxCompiler: clang++ - compilerInitialization: '' - Windows: - imageName: 'vs2017-win2016' - cCompiler: cl.exe - cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' +# Linux1604: +# imageName: 'ubuntu-16.04' +# cCompiler: gcc +# cxxCompiler: g++ +# compilerInitialization: '' + Linux1804: + imageName: 'ubuntu-18.04' + cCompiler: gcc + cxxCompiler: g++ + compilerInitialization: '' + macOS1015: + imageName: 'macos-10.15' + cCompiler: clang + cxxCompiler: clang++ + compilerInitialization: '' +# macOS1014: +# imageName: 'macos-10.14' +# cCompiler: clang +# cxxCompiler: clang++ +# compilerInitialization: '' +# Windows2017: +# imageName: 'vs2017-win2016' +# cCompiler: cl.exe +# cxxCompiler: cl.exe +# compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + Windows2019: + imageName: 'windows-2019' + cCompiler: cl.exe + cxxCompiler: cl.exe + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' pool: vmImage: $(imageName) @@ -60,7 +75,10 @@ jobs: displayName: 'Install build dependencies' - script: | + #git clone https://github.com/InsightSoftwareConsortium/ITK.git git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git + cd ITK + git checkout $(ITKGitTag) workingDirectory: $(Agent.BuildDirectory) displayName: 'Download ITK' @@ -86,7 +104,7 @@ jobs: cat > dashboard.cmake << EOF set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "$(Build.Repository.Name)") if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) @@ -138,7 +156,7 @@ jobs: sudo pip3 install --upgrade pip sudo pip3 install --upgrade setuptools sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter "$(Agent.BuildDirectory)/build" > "$(Agent.BuildDirectory)/JUnitTestResults.xml" + ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml condition: succeededOrFailed() displayName: 'Format CTest output in JUnit format' @@ -150,98 +168,95 @@ jobs: displayName: 'Publish test results' -- job: 'PackageLinux' - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - displayName: "Build Linux Python packages" - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LinuxWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - - -- job: 'PackageMacOS' - displayName: "Build macOS Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'macos-10.14' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MacOSWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - - -- job: 'PackageWindows' - displayName: "Build Windows Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'vs2017-win2016' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cd $(Agent.BuildDirectory)\ITKModuleTemplate - set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - set CC=cl.exe - set CXX=cl.exe - powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WindowsWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' + - job: 'PackageLinux' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + displayName: "Build Linux Python packages" + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'LinuxWheels' + targetPath: './dist' + + + - job: 'PackageMacOS' + displayName: "Build macOS Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'macos-10.14' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + ./macpython-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'MacOSWheels' + targetPath: './dist' + + + - job: 'PackageWindows' + displayName: "Build Windows Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'vs2017-win2016' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + displayName: 'Fetch build script' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + set CC=cl.exe + set CXX=cl.exe + powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'WindowsWheels' + targetPath: './dist' From d8c9764c0e3fa85be2b3b33f967dfea7caeecb8d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 3 Mar 2020 14:14:45 -0500 Subject: [PATCH 051/151] BUG: Revert "ENH: Update azure module for ITK 5.1rc2" This reverts commit c85bc09b10f0a36a622b63691f42b611a94ea544. This is not a valid configuration. --- azure-pipelines.yml | 245 +++++++++++++++++++++----------------------- 1 file changed, 115 insertions(+), 130 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index acdfc79..bb45195 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ -# The file template originates from the instructions: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/README.md +# The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate variables: - ITKGitTag: v5.1rc02 #Used for choosing branch of ITK to checkout - ITKPythonGitTag: v5.1rc02 #Used to identify the release name for the cached python build environmeent ITKPythonBuilds-linux.tar.zst + ITKGitTag: v5.1rc02 + ITKPythonGitTag: v5.1rc02 CMakeBuildType: Release trigger: @@ -19,36 +19,21 @@ jobs: strategy: matrix: -# Linux1604: -# imageName: 'ubuntu-16.04' -# cCompiler: gcc -# cxxCompiler: g++ -# compilerInitialization: '' - Linux1804: - imageName: 'ubuntu-18.04' - cCompiler: gcc - cxxCompiler: g++ - compilerInitialization: '' - macOS1015: - imageName: 'macos-10.15' - cCompiler: clang - cxxCompiler: clang++ - compilerInitialization: '' -# macOS1014: -# imageName: 'macos-10.14' -# cCompiler: clang -# cxxCompiler: clang++ -# compilerInitialization: '' -# Windows2017: -# imageName: 'vs2017-win2016' -# cCompiler: cl.exe -# cxxCompiler: cl.exe -# compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' - Windows2019: - imageName: 'windows-2019' - cCompiler: cl.exe - cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + Linux: + imageName: 'ubuntu-16.04' + cCompiler: gcc + cxxCompiler: g++ + compilerInitialization: '' + macOS: + imageName: 'macos-10.13' + cCompiler: clang + cxxCompiler: clang++ + compilerInitialization: '' + Windows: + imageName: 'vs2017-win2016' + cCompiler: cl.exe + cxxCompiler: cl.exe + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' pool: vmImage: $(imageName) @@ -75,10 +60,7 @@ jobs: displayName: 'Install build dependencies' - script: | - #git clone https://github.com/InsightSoftwareConsortium/ITK.git git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git - cd ITK - git checkout $(ITKGitTag) workingDirectory: $(Agent.BuildDirectory) displayName: 'Download ITK' @@ -104,7 +86,7 @@ jobs: cat > dashboard.cmake << EOF set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "$(Build.Repository.Name)") if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) @@ -156,7 +138,7 @@ jobs: sudo pip3 install --upgrade pip sudo pip3 install --upgrade setuptools sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml + ci_addons ctest_junit_formatter "$(Agent.BuildDirectory)/build" > "$(Agent.BuildDirectory)/JUnitTestResults.xml" condition: succeededOrFailed() displayName: 'Format CTest output in JUnit format' @@ -168,95 +150,98 @@ jobs: displayName: 'Publish test results' - - job: 'PackageLinux' - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - displayName: "Build Linux Python packages" - pool: - vmImage: 'Ubuntu-16.04' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LinuxWheels' - targetPath: './dist' - - - - job: 'PackageMacOS' - displayName: "Build macOS Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'macos-10.14' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - ./macpython-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MacOSWheels' - targetPath: './dist' - - - - job: 'PackageWindows' - displayName: "Build Windows Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'vs2017-win2016' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - set CC=cl.exe - set CXX=cl.exe - powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WindowsWheels' - targetPath: './dist' +- job: 'PackageLinux' + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + displayName: "Build Linux Python packages" + pool: + vmImage: 'Ubuntu-16.04' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - task: UsePythonVersion@0 + inputs: + versionSpec: '3.7' + architecture: 'x64' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + cd $(Agent.BuildDirectory)/ITKModuleTemplate + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'LinuxWheels' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' + + +- job: 'PackageMacOS' + displayName: "Build macOS Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'macos-10.14' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + displayName: 'Fetch build script' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + cd $(Agent.BuildDirectory)/ITKModuleTemplate + export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'MacOSWheels' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' + + +- job: 'PackageWindows' + displayName: "Build Windows Python packages" + timeoutInMinutes: 0 + cancelTimeoutInMinutes: 300 + pool: + vmImage: 'vs2017-win2016' + + steps: + - script: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O + displayName: 'Fetch build script' + + - script: | + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) + displayName: 'Evaluate template' + + - script: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cd $(Agent.BuildDirectory)\ITKModuleTemplate + set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) + set CC=cl.exe + set CXX=cl.exe + powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 + displayName: 'Build Python packages' + + - task: PublishPipelineArtifact@0 + inputs: + artifactName: 'WindowsWheels' + targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' From ce90b2ab7397ec8418393af392ac5458ba2ba930 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 3 Mar 2020 17:03:50 -0500 Subject: [PATCH 052/151] DOC: Update Copyright assignment to NumFOCUS See: https://github.com/InsightSoftwareConsortium/ITK/pull/1598 --- .../include/itkMinimalStandardRandomVariateGenerator.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.hxx | 2 +- .../src/itkMinimalStandardRandomVariateGenerator.cxx | 2 +- .../test/itkMinimalStandardRandomVariateGeneratorTest.cxx | 2 +- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 1e5ea67..d2552aa 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index dfc7482..2f025d0 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx index aec3c54..6d1bfbd 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx index 69d32cd..6c5cc9d 100644 --- a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx +++ b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx index 0ef8f37..48b0996 100644 --- a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index a9105d0..1eee0b4 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -1,6 +1,6 @@ /*========================================================================= * - * Copyright Insight Software Consortium + * Copyright NumFOCUS * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 85e72e93be245d1d3d16b5900670c38987fa291d Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Apr 2020 09:51:11 -0400 Subject: [PATCH 053/151] ENH: CI builds against ITK v5.1rc03 --- azure-pipelines.yml | 4 ++-- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bb45195..da91304 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ # The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate variables: - ITKGitTag: v5.1rc02 - ITKPythonGitTag: v5.1rc02 + ITKGitTag: v5.1rc03 + ITKPythonGitTag: v5.1rc03 CMakeBuildType: Release trigger: diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index 07de04c..fc64b1f 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.0.1 - ITKPythonGitTag: v5.0.1 + ITKGitTag: v5.1rc03 + ITKPythonGitTag: v5.1rc03 CMakeBuildType: Release trigger: From ae7940822231e39db0224d46ed2df0b136098eb4 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 2 Apr 2020 16:29:11 -0400 Subject: [PATCH 054/151] ENH: Update CI Virtual Machine images --- azure-pipelines.yml | 16 ++++++++-------- .../test/azure-pipelines.yml | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index da91304..1fc11be 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,20 +20,20 @@ jobs: strategy: matrix: Linux: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-18.04' cCompiler: gcc cxxCompiler: g++ compilerInitialization: '' macOS: - imageName: 'macos-10.13' + imageName: 'macos-10.15' cCompiler: clang cxxCompiler: clang++ compilerInitialization: '' Windows: - imageName: 'vs2017-win2016' + imageName: 'windows-2019' cCompiler: cl.exe cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' pool: vmImage: $(imageName) @@ -155,7 +155,7 @@ jobs: cancelTimeoutInMinutes: 300 displayName: "Build Linux Python packages" pool: - vmImage: 'Ubuntu-16.04' + vmImage: 'Ubuntu-18.04' steps: - script: | @@ -190,7 +190,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'macos-10.14' + vmImage: 'macos-10.15' steps: - script: | @@ -220,7 +220,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-2019' steps: - script: | @@ -233,7 +233,7 @@ jobs: displayName: 'Evaluate template' - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cd $(Agent.BuildDirectory)\ITKModuleTemplate set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) set CC=cl.exe diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index fc64b1f..9a8c66a 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -19,20 +19,20 @@ jobs: strategy: matrix: Linux: - imageName: 'ubuntu-16.04' + imageName: 'ubuntu-18.04' cCompiler: gcc cxxCompiler: g++ compilerInitialization: '' macOS: - imageName: 'macos-10.13' + imageName: 'macos-10.15' cCompiler: clang cxxCompiler: clang++ compilerInitialization: '' Windows: - imageName: 'vs2017-win2016' + imageName: 'windows-2019' cCompiler: cl.exe cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' + compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' pool: vmImage: $(imageName) @@ -150,7 +150,7 @@ jobs: cancelTimeoutInMinutes: 300 displayName: "Build Linux Python packages" pool: - vmImage: 'Ubuntu-16.04' + vmImage: 'Ubuntu-18.04' steps: - script: | @@ -174,7 +174,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'macos-10.14' + vmImage: 'macos-10.15' steps: - script: | @@ -198,7 +198,7 @@ jobs: timeoutInMinutes: 0 cancelTimeoutInMinutes: 300 pool: - vmImage: 'vs2017-win2016' + vmImage: 'windows-2019' steps: - script: | @@ -206,7 +206,7 @@ jobs: displayName: 'Fetch build script' - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) set CC=cl.exe set CXX=cl.exe From 9126f466b8decec130ce1c04aa4a7488f18fe01a Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 6 Apr 2020 12:36:35 -0400 Subject: [PATCH 055/151] ENH: Add clang-format linter action For more information, see: https://github.com/InsightSoftwareConsortium/ITKClangFormatLinterAction --- .github/workflows/clang-format-linter.yml | 13 +++++++++++++ .../.github/workflows/clang-format-linter.yml | 13 +++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 .github/workflows/clang-format-linter.yml create mode 100644 {{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml new file mode 100644 index 0000000..69166d9 --- /dev/null +++ b/.github/workflows/clang-format-linter.yml @@ -0,0 +1,13 @@ +name: clang-format linter + +on: [push,pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master diff --git a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml new file mode 100644 index 0000000..69166d9 --- /dev/null +++ b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml @@ -0,0 +1,13 @@ +name: clang-format linter + +on: [push,pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + with: + fetch-depth: 1 + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master From b3d1b952aeac4d04e133c0a262b250ba1933361a Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 27 Apr 2020 14:37:51 -0400 Subject: [PATCH 056/151] ENH: CI builds against ITK 5.1.0 --- azure-pipelines.yml | 4 ++-- {{cookiecutter.project_name}}/test/azure-pipelines.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 1fc11be..61146c9 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,7 +1,7 @@ # The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate variables: - ITKGitTag: v5.1rc03 - ITKPythonGitTag: v5.1rc03 + ITKGitTag: v5.1.0 + ITKPythonGitTag: v5.1.0 CMakeBuildType: Release trigger: diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml index 9a8c66a..cdbce14 100644 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ b/{{cookiecutter.project_name}}/test/azure-pipelines.yml @@ -1,6 +1,6 @@ variables: - ITKGitTag: v5.1rc03 - ITKPythonGitTag: v5.1rc03 + ITKGitTag: v5.1.0 + ITKPythonGitTag: v5.1.0 CMakeBuildType: Release trigger: From 0ae5a8b126c55ae5769a68b17a7260f45d2d52e3 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 May 2020 19:02:36 -0400 Subject: [PATCH 057/151] ENH: Add Build, test, package GitHub Action --- .../.github/workflows/build-test-package.yml | 260 ++++++++++++++++++ 1 file changed, 260 insertions(+) create mode 100644 {{cookiecutter.project_name}}/.github/workflows/build-test-package.yml diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml new file mode 100644 index 0000000..4a4a66d --- /dev/null +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -0,0 +1,260 @@ +name: Build, test, package + +on: [push,pull_request] + +jobs: + build-test-cxx: + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 3 + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] + include: + - os: ubuntu-18.04 + c-compiler: "gcc" + cxx-compiler: "g++" + itk-git-tag: "v5.1.0" + cmake-build-type: "MinSizeRel" + - os: windows-2019 + c-compiler: "cl.exe" + cxx-compiler: "cl.exe" + itk-git-tag: "v5.1.0" + cmake-build-type: "Release" + - os: macos-10.15 + c-compiler: "clang" + cxx-compiler: "clang++" + itk-git-tag: "v5.1.0" + cmake-build-type: "MinSizeRel" + + steps: + - uses: actions/checkout@v1 + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ninja + + - name: Download ITK + run: | + cd .. + git clone https://github.com/InsightSoftwareConsortium/ITK.git + cd ITK + git checkout ${{ matrix.itk-git-tag }} + + - name: Build ITK + if: matrix.os != 'windows-2019' + run: | + cd .. + mkdir ITK-build + cd ITK-build + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + + - name: Build ITK + if: matrix.os == 'windows-2019' + run: | + cd .. + mkdir ITK-build + cd ITK-build + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + shell: cmd + + - name: Fetch CTest driver script + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O + + - name: Configure CTest script + shell: bash + run: | + operating_system="${{ matrix.os }}" + cat > dashboard.cmake << EOF + set(CTEST_SITE "GitHubActions") + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) + set(dashboard_source_name "${GITHUB_REPOSITORY}") + if(ENV{GITHUB_REF} MATCHES "master") + set(branch "-master") + set(dashboard_model "Continuous") + else() + set(branch "-${GITHUB_REF}") + set(dashboard_model "Experimental") + endif() + set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}") + set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) + set(CTEST_BUILD_CONFIGURATION "Release") + set(CTEST_CMAKE_GENERATOR "Ninja") + set(CTEST_CUSTOM_WARNING_EXCEPTION + \${CTEST_CUSTOM_WARNING_EXCEPTION} + # macOS Azure VM Warning + "ld: warning: text-based stub file" + ) + set(dashboard_no_clean 1) + set(ENV{CC} ${{ matrix.c-compiler }}) + set(ENV{CXX} ${{ matrix.cxx-compiler }}) + set(dashboard_cache " + ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build + BUILD_TESTING:BOOL=ON + ") + string(TIMESTAMP build_date "%Y-%m-%d") + message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") + message("CTEST_SITE = \${CTEST_SITE}") + include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) + EOF + cat dashboard.cmake + + - name: Build and test + if: matrix.os != 'windows-2019' + run: | + ctest -j 2 -V -S dashboard.cmake + + - name: Build and test + if: matrix.os == 'windows-2019' + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + ctest -j 2 -V -S dashboard.cmake + shell: cmd + + build-linux-python-packages: + runs-on: ubuntu-18.04 + strategy: + max-parallel: 2 + matrix: + python-version: [35, 36, 37, 38] + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Free up disk space' + run: | + # Workaround for https://github.com/actions/virtual-environments/issues/709 + df -h + sudo apt-get clean + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h + + - name: 'Fetch build script' + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + + - name: 'Build 🐍 Python 📦 package' + run: | + export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: LinuxWheel${{ matrix.python-version }} + path: dist + + build-macos-python-packages: + runs-on: macos-10.15 + strategy: + max-parallel: 2 + matrix: + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Fetch build script' + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/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' + run: | + export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + export MACOSX_DEPLOYMENT_TARGET=10.9 + ./macpython-download-cache-and-build-module-wheels.sh + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: MacOSWheels + path: dist + + build-windows-python-packages: + runs-on: windows-2019 + strategy: + max-parallel: 2 + matrix: + python-version-minor: [5, 6, 7, 8] + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Install Python' + run: | + $pythonArch = "64" + $pythonVersion = "3.${{ matrix.python-version-minor }}" + iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) + + - name: 'Fetch build dependencies' + shell: bash + run: | + curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" + 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r + curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" + 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r + curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" + 7z x grep-win.zip -o/c/P/grep -aoa -r + + - name: 'Build 🐍 Python 📦 package' + shell: cmd + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set PATH="C:\P\grep;%PATH%" + set CC=cl.exe + set CXX=cl.exe + C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: WindowWheel3.${{ matrix.python-version-minor }} + path: dist + + publish-python-packages-to-pypi: + needs: + - build-linux-python-packages + - build-macos-python-packages + - build-windows-python-packages + runs-on: ubuntu-18.04 + + steps: + - name: Download Python Packages + uses: actions/download-artifact@v2 + + - name: Prepare packages for upload + run: | + ls -R + for d in */; do + mv ${d}/*.whl . + done + mkdir dist + mv *.whl dist/ + ls dist + + - name: Publish 🐍 Python 📦 package to PyPI + if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + user: __token__ + password: ${{ secrets.pypi_password }} From 976e5cd3abff40a6d30392594a7cd3f9fad70c88 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 May 2020 19:25:22 -0400 Subject: [PATCH 058/151] ENH: Add Build, test, package GitHub Action to run on the template Adds steps to evaluate the template with cookiecutter and the default parameters. --- .github/workflows/build-test-package.yml | 261 +++++++++++++++++++++++ 1 file changed, 261 insertions(+) create mode 100644 .github/workflows/build-test-package.yml diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml new file mode 100644 index 0000000..2fb9ca2 --- /dev/null +++ b/.github/workflows/build-test-package.yml @@ -0,0 +1,261 @@ +name: Build, test, package + +on: [push,pull_request] + +jobs: + build-test-cxx: + runs-on: ${{ matrix.os }} + strategy: + max-parallel: 3 + matrix: + os: [ubuntu-18.04, windows-2019, macos-10.15] + include: + - os: ubuntu-18.04 + c-compiler: "gcc" + cxx-compiler: "g++" + itk-git-tag: "v5.1.0" + cmake-build-type: "MinSizeRel" + - os: windows-2019 + c-compiler: "cl.exe" + cxx-compiler: "cl.exe" + itk-git-tag: "v5.1.0" + cmake-build-type: "Release" + - os: macos-10.15 + c-compiler: "clang" + cxx-compiler: "clang++" + itk-git-tag: "v5.1.0" + cmake-build-type: "MinSizeRel" + + steps: + - uses: actions/checkout@v1 + + - name: Set up Python 3.7 + uses: actions/setup-python@v1 + with: + python-version: 3.7 + + - name: Install build dependencies + run: | + python -m pip install --upgrade pip + python -m pip install ninja + python -m pip install cookiecutter + + - name: Download ITK + run: | + cd .. + git clone https://github.com/InsightSoftwareConsortium/ITK.git + cd ITK + git checkout ${{ matrix.itk-git-tag }} + + - name: Build ITK + if: matrix.os != 'windows-2019' + run: | + cd .. + mkdir ITK-build + cd ITK-build + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + + - name: Build ITK + if: matrix.os == 'windows-2019' + run: | + cd .. + mkdir ITK-build + cd ITK-build + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + ninja + shell: cmd + + - name: Fetch CTest driver script + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O + + - name: Evaluate template + shell: bash + run: | + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/../ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + + - name: Configure CTest script + shell: bash + run: | + operating_system="${{ matrix.os }}" + cat > dashboard.cmake << EOF + set(CTEST_SITE "GitHubActions") + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) + set(dashboard_source_name "${GITHUB_REPOSITORY}") + if(ENV{GITHUB_REF} MATCHES "master") + set(branch "-master") + set(dashboard_model "Continuous") + else() + set(branch "-${GITHUB_REF}") + set(dashboard_model "Experimental") + endif() + set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}") + set(CTEST_UPDATE_VERSION_ONLY 1) + set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) + set(CTEST_BUILD_CONFIGURATION "Release") + set(CTEST_CMAKE_GENERATOR "Ninja") + set(CTEST_CUSTOM_WARNING_EXCEPTION + \${CTEST_CUSTOM_WARNING_EXCEPTION} + # macOS Azure VM Warning + "ld: warning: text-based stub file" + ) + set(dashboard_no_clean 1) + set(ENV{CC} ${{ matrix.c-compiler }}) + set(ENV{CXX} ${{ matrix.cxx-compiler }}) + set(dashboard_cache " + ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build + BUILD_TESTING:BOOL=ON + ") + string(TIMESTAMP build_date "%Y-%m-%d") + message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") + message("CTEST_SITE = \${CTEST_SITE}") + include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) + EOF + cat dashboard.cmake + + - name: Build and test + if: matrix.os != 'windows-2019' + run: | + ctest -j 2 -V -S dashboard.cmake + + - name: Build and test + if: matrix.os == 'windows-2019' + run: | + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + ctest -j 2 -V -S dashboard.cmake + shell: cmd + + build-linux-python-packages: + runs-on: ubuntu-18.04 + strategy: + max-parallel: 2 + matrix: + python-version: [35, 36, 37, 38] + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Free up disk space' + run: | + # Workaround for https://github.com/actions/virtual-environments/issues/709 + df -h + sudo apt-get clean + sudo rm -rf "/usr/local/share/boost" + sudo rm -rf "$AGENT_TOOLSDIRECTORY" + df -h + + - name: Evaluate template + shell: bash + run: | + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplate/.git" + + - name: 'Fetch build script' + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh + + - name: 'Build 🐍 Python 📦 package' + run: | + cd "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" + export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + ../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: LinuxWheel${{ matrix.python-version }} + path: ITKModuleTemplateEvaluated/dist + + build-macos-python-packages: + runs-on: macos-10.15 + strategy: + max-parallel: 2 + matrix: + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Fetch build script' + run: | + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + chmod u+x macpython-download-cache-and-build-module-wheels.sh + + - name: Evaluate template + shell: bash + run: | + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + + - name: 'Build 🐍 Python 📦 package' + run: | + cd "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" + export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + export MACOSX_DEPLOYMENT_TARGET=10.9 + ../macpython-download-cache-and-build-module-wheels.sh + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: MacOSWheels + path: ITKModuleTemplateEvaluated/dist + + build-windows-python-packages: + runs-on: windows-2019 + strategy: + max-parallel: 2 + matrix: + python-version-minor: [5, 6, 7, 8] + include: + - itk-python-git-tag: "v5.1.0" + + steps: + - uses: actions/checkout@v2 + + - name: 'Install Python' + run: | + $pythonArch = "64" + $pythonVersion = "3.${{ matrix.python-version-minor }}" + iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) + + - name: Evaluate template + shell: bash + run: | + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + + - name: 'Fetch build dependencies' + shell: bash + run: | + cd ITKModuleTemplate + curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" + 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r + curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" + 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r + curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" + 7z x grep-win.zip -o/c/P/grep -aoa -r + + - name: 'Build 🐍 Python 📦 package' + shell: cmd + run: | + cd ITKModuleTemplateEvaluated + call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + set PATH="C:\P\grep;%PATH%" + set CC=cl.exe + set CXX=cl.exe + C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" + + - name: Publish Python package as GitHub Artifact + uses: actions/upload-artifact@v1 + with: + name: WindowWheel3.${{ matrix.python-version-minor }} + path: ITKModuleTemplateEvaluated/dist From 6b7c9b9fa441e599a482d4465a8530bdcbdae2d6 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 7 May 2020 00:25:11 -0400 Subject: [PATCH 059/151] BUG: Use PWD for CTest paths in CI This can cause issue with backslash / escapes when there is a library on Windows. --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2fb9ca2..a0aae84 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -83,9 +83,9 @@ jobs: operating_system="${{ matrix.os }}" cat > dashboard.cmake << EOF set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) + file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "${PWD}/ITKModuleTemplateEvaluated" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") if(ENV{GITHUB_REF} MATCHES "master") set(branch "-master") diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 4a4a66d..322a106 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -76,9 +76,9 @@ jobs: operating_system="${{ matrix.os }}" cat > dashboard.cmake << EOF set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "${GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) + file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "${PWD}/" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") if(ENV{GITHUB_REF} MATCHES "master") set(branch "-master") From 0acab856adfa65d411337bb8c1cd55dbb1a3a4b1 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 7 May 2020 10:14:46 -0400 Subject: [PATCH 060/151] BUG: Escape GitHub Actions template markup for cookiecutter --- .../.github/workflows/build-test-package.yml | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 322a106..c8bb334 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,7 +4,7 @@ on: [push,pull_request] jobs: build-test-cxx: - runs-on: ${{ matrix.os }} + runs-on: ${{ "{{" }} matrix.os {{ "}}" }} strategy: max-parallel: 3 matrix: @@ -44,7 +44,7 @@ jobs: cd .. git clone https://github.com/InsightSoftwareConsortium/ITK.git cd ITK - git checkout ${{ matrix.itk-git-tag }} + git checkout ${{ "{{" }} matrix.itk-git-tag {{ "}}" }} - name: Build ITK if: matrix.os != 'windows-2019' @@ -52,7 +52,7 @@ jobs: cd .. mkdir ITK-build cd ITK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ "{{" }} matrix.c-compiler {{ "}}" }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ "{{" }} matrix.cxx-compiler {{ "}}" }}" -DCMAKE_BUILD_TYPE:STRING=${{ "{{" }} matrix.cmake-build-type {{ "}}" }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK ninja - name: Build ITK @@ -62,7 +62,7 @@ jobs: mkdir ITK-build cd ITK-build call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK + cmake -DCMAKE_C_COMPILER:FILEPATH="${{ "{{" }} matrix.c-compiler {{ "}}" }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ "{{" }} matrix.cxx-compiler {{ "}}" }}" -DCMAKE_BUILD_TYPE:STRING=${{ "{{" }} matrix.cmake-build-type {{ "}}" }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK ninja shell: cmd @@ -73,7 +73,7 @@ jobs: - name: Configure CTest script shell: bash run: | - operating_system="${{ matrix.os }}" + operating_system="${{ "{{" }} matrix.os {{ "}}" }}" cat > dashboard.cmake << EOF set(CTEST_SITE "GitHubActions") file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) @@ -98,8 +98,8 @@ jobs: "ld: warning: text-based stub file" ) set(dashboard_no_clean 1) - set(ENV{CC} ${{ matrix.c-compiler }}) - set(ENV{CXX} ${{ matrix.cxx-compiler }}) + set(ENV{CC} ${{ "{{" }} matrix.c-compiler {{ "}}" }}) + set(ENV{CXX} ${{ "{{" }} matrix.cxx-compiler {{ "}}" }}) set(dashboard_cache " ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build BUILD_TESTING:BOOL=ON @@ -151,13 +151,13 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + export ITK_PACKAGE_VERSION=${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }} + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 with: - name: LinuxWheel${{ matrix.python-version }} + name: LinuxWheel${{ "{{" }} matrix.python-version {{ "}}" }} path: dist build-macos-python-packages: @@ -178,7 +178,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + export ITK_PACKAGE_VERSION=${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }} export MACOSX_DEPLOYMENT_TARGET=10.9 ./macpython-download-cache-and-build-module-wheels.sh @@ -203,13 +203,13 @@ jobs: - name: 'Install Python' run: | $pythonArch = "64" - $pythonVersion = "3.${{ matrix.python-version-minor }}" + $pythonVersion = "3.${{ "{{" }} matrix.python-version-minor {{ "}}" }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - name: 'Fetch build dependencies' shell: bash run: | - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" + curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r @@ -223,12 +223,12 @@ jobs: set PATH="C:\P\grep;%PATH%" set CC=cl.exe set CXX=cl.exe - C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" + C:\Python3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64" - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 with: - name: WindowWheel3.${{ matrix.python-version-minor }} + name: WindowWheel3.${{ "{{" }} matrix.python-version-minor {{ "}}" }} path: dist publish-python-packages-to-pypi: @@ -257,4 +257,4 @@ jobs: uses: pypa/gh-action-pypi-publish@master with: user: __token__ - password: ${{ secrets.pypi_password }} + password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} From a9fb30570bb88b6195f2363be480401f038d4ace Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 7 May 2020 10:18:35 -0400 Subject: [PATCH 061/151] BUG: Set evaluated template directories in CI --- .github/workflows/build-test-package.yml | 47 +++++++++++-------- .../.github/workflows/build-test-package.yml | 6 +-- 2 files changed, 30 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index a0aae84..4d4e308 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -74,8 +74,8 @@ jobs: - name: Evaluate template shell: bash run: | - python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/../ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" - mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/../Evaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/../Evaluated/ITKModuleTemplate/.git" - name: Configure CTest script shell: bash @@ -83,9 +83,9 @@ jobs: operating_system="${{ matrix.os }}" cat > dashboard.cmake << EOF set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "${PWD}/ITKModuleTemplateEvaluated" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../Evaluated/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") if(ENV{GITHUB_REF} MATCHES "master") set(branch "-master") @@ -154,8 +154,9 @@ jobs: - name: Evaluate template shell: bash run: | - python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" - mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplate/.git" + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/Evaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate/.git" - name: 'Fetch build script' run: | @@ -164,15 +165,15 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | - cd "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" + cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} - ../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 with: name: LinuxWheel${{ matrix.python-version }} - path: ITKModuleTemplateEvaluated/dist + path: Evaluated/ITKModuleTemplate/dist build-macos-python-packages: runs-on: macos-10.15 @@ -193,21 +194,22 @@ jobs: - name: Evaluate template shell: bash run: | - python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" - mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/Evaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate/.git" - name: 'Build 🐍 Python 📦 package' run: | - cd "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" + cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} export MACOSX_DEPLOYMENT_TARGET=10.9 - ../macpython-download-cache-and-build-module-wheels.sh + ../../macpython-download-cache-and-build-module-wheels.sh - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 with: name: MacOSWheels - path: ITKModuleTemplateEvaluated/dist + path: Evaluated/ITKModuleTemplate/dist build-windows-python-packages: runs-on: windows-2019 @@ -227,16 +229,21 @@ jobs: $pythonVersion = "3.${{ matrix.python-version-minor }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) + - uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Evaluate template shell: bash run: | - python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated" "${GITHUB_WORKSPACE}" - mkdir "${GITHUB_WORKSPACE}/ITKModuleTemplateEvaluated/.git" + python -m pip install cookiecutter + python -m cookiecutter --no-input --output-dir "${GITHUB_WORKSPACE}/Evaluated" "${GITHUB_WORKSPACE}" + mkdir "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate/.git" - name: 'Fetch build dependencies' shell: bash run: | - cd ITKModuleTemplate + cd Evaluated/ITKModuleTemplate curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" @@ -247,7 +254,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' shell: cmd run: | - cd ITKModuleTemplateEvaluated + cd Evaluated/ITKModuleTemplate call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set PATH="C:\P\grep;%PATH%" set CC=cl.exe @@ -258,4 +265,4 @@ jobs: uses: actions/upload-artifact@v1 with: name: WindowWheel3.${{ matrix.python-version-minor }} - path: ITKModuleTemplateEvaluated/dist + path: Evaluated/ITKModuleTemplate/dist diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index c8bb334..bd12147 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -76,9 +76,9 @@ jobs: operating_system="${{ "{{" }} matrix.os {{ "}}" }}" cat > dashboard.cmake << EOF set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "${PWD}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "${PWD}/" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "${PWD}/../build" CTEST_BINARY_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY) + file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") if(ENV{GITHUB_REF} MATCHES "master") set(branch "-master") From 81696aa6eb0a6d321c728035ef87aa3f6b9b5200 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 11 May 2020 17:45:07 -0400 Subject: [PATCH 062/151] DOC: Add GitHub Actions badge --- README.md | 2 +- {{cookiecutter.project_name}}/README.rst | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index db6806b..c2f0de3 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ITKModuleTemplate ================= -[![Build Status](https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/InsightSoftwareConsortium.ITKModuleTemplate?branchName=master)](https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=19&branchName=master) +![](https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/workflows/Build,%20test,%20package/badge.svg) Overview -------- diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 5218ef7..c7ca5d0 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -1,8 +1,7 @@ {{ cookiecutter.project_name }} ================================= -.. image:: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_apis/build/status/{{ cookiecutter.project_name.lower() }}?branchName=master - :target: https://dev.azure.com/InsightSoftwareConsortium/ITKModules/_build/latest?definitionId=8&branchName=master +.. image:: https://github.com/InsightSoftwareConsortium/{{ cookiecutter.project_name }}/workflows/Build,%20test,%20package/badge.svg :alt: Build Status .. image:: https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg From d9a5a90f9c36aead0a233b0627940d0644d5e359 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 11 May 2020 21:18:01 -0400 Subject: [PATCH 063/151] ENH: Add --output-on-failure to GitHub Actions ctest call --- .github/workflows/build-test-package.yml | 4 ++-- .../.github/workflows/build-test-package.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 4d4e308..a3a5733 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -121,13 +121,13 @@ jobs: - name: Build and test if: matrix.os != 'windows-2019' run: | - ctest -j 2 -V -S dashboard.cmake + ctest --output-on-failure -j 2 -V -S dashboard.cmake - name: Build and test if: matrix.os == 'windows-2019' run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -j 2 -V -S dashboard.cmake + ctest --output-on-failure -j 2 -V -S dashboard.cmake shell: cmd build-linux-python-packages: diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index bd12147..8ee2bac 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -114,13 +114,13 @@ jobs: - name: Build and test if: matrix.os != 'windows-2019' run: | - ctest -j 2 -V -S dashboard.cmake + ctest --output-on-failure -j 2 -V -S dashboard.cmake - name: Build and test if: matrix.os == 'windows-2019' run: | call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest -j 2 -V -S dashboard.cmake + ctest --output-on-failure -j 2 -V -S dashboard.cmake shell: cmd build-linux-python-packages: From 816e281162c070327a99f2742d47e4bc71b55ef4 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 13 May 2020 11:27:32 -0400 Subject: [PATCH 064/151] DOC: Update Python package documentation for GitHub Actions --- README.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c2f0de3..de5f5c5 100644 --- a/README.md +++ b/README.md @@ -97,14 +97,15 @@ followlowing contents: GIT_TAG abcdef012345 ) -Python Packages ---------------- +CI Testing and Python Packages +------------------------------ Continuous integration service configurations are included to build +and test the C++ core of packages across platforms and build binary Python packages for Linux, macOS, and Windows. These packages can be -[downloaded](https://itkpythonpackage.readthedocs.io/en/latest/Build_ITK_Module_Python_packages.html#github-automated-ci-package-builds) +[downloaded](https://itkpythonpackage.readthedocs.io/en/master/Build_ITK_Module_Python_packages.html#github-automated-ci-package-builds) and [uploaded to the Python Package Index -(PyPI)](https://itkpythonpackage.readthedocs.io/en/latest/Build_ITK_Module_Python_packages.html#upload-the-packages-to-pypi). +(PyPI)](https://itkpythonpackage.readthedocs.io/en/master/Build_ITK_Module_Python_packages.html#upload-the-packages-to-pypi). ITKv4 Branch ------------ From 6563eec700b5c4e60e1debf37d1881178e79fe3b Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 13 May 2020 15:39:57 -0400 Subject: [PATCH 065/151] COMP: Reduce build path for Windows Python packages builds Avoid Visual Studio line length limitations for modules with a long name. --- .../.github/workflows/build-test-package.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 8ee2bac..bdb063e 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -199,6 +199,8 @@ jobs: steps: - uses: actions/checkout@v2 + with: + path: "im" - name: 'Install Python' run: | @@ -209,6 +211,8 @@ jobs: - name: 'Fetch build dependencies' shell: bash run: | + mv im ../../ + cd ../../ curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" @@ -219,6 +223,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' shell: cmd run: | + cd ../../im call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set PATH="C:\P\grep;%PATH%" set CC=cl.exe @@ -229,7 +234,7 @@ jobs: uses: actions/upload-artifact@v1 with: name: WindowWheel3.${{ "{{" }} matrix.python-version-minor {{ "}}" }} - path: dist + path: ../../im/dist publish-python-packages-to-pypi: needs: From 55ce52ff8b3250d8fa6f8e4ba450b387d678afd7 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 14 May 2020 08:48:42 -0400 Subject: [PATCH 066/151] BUG: Add --no-clean flag to Windows Python package generation step In CI, this is unnecessary now because every Python package version is generated in a clean virtual machine instance. On some packages that use CMake FetchContent, the cleanup step can fail with: Adding 'itk_elastix-0.6.0.dist-info/RECORD' removing _skbuild\win-amd64-3.5\setuptools\bdist.win-amd64\wheel C:\P\IPP\venv-35-x64\lib\site-packages\wheel\pep425tags.py:82: RuntimeWarning: Config variable 'Py_DEBUG' is unset, Python ABI tag may be incorrect warn=(impl == 'cp')): C:\P\IPP\venv-35-x64\lib\site-packages\wheel\pep425tags.py:87: RuntimeWarning: Config variable 'WITH_PYMALLOC' is unset, Python ABI tag may be incorrect sys.version_info < (3, 8))) \ running clean removing '_skbuild\win-amd64-3.5\cmake-install' removing '_skbuild\win-amd64-3.5\cmake-build' error: [WinError 5] Access is denied: '_skbuild\\win-amd64-3.5\\cmake-build\\_deps\\elx-src\\.git\\objects\\pack\\pack-fe0f18355ee7166ea63b5deefec6fde96d8691fc.idx' SCRIPT_DIR: C:\P\IPP\scripts ROOT_DIR: D:\a\im --- .../.github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index bdb063e..75a4d9e 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -228,7 +228,7 @@ jobs: set PATH="C:\P\grep;%PATH%" set CC=cl.exe set CXX=cl.exe - C:\Python3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64" + C:\Python3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64" --no-cleanup - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 From e0affdfb732c9e865c8887b188678cc8d16050e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 20 May 2020 09:27:14 -0400 Subject: [PATCH 067/151] COMP: prefix testing macros with ITK_ --- .../test/itkMinimalStandardRandomVariateGeneratorTest.cxx | 4 ++-- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx index 48b0996..3bb91a1 100644 --- a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx @@ -27,11 +27,11 @@ itkMinimalStandardRandomVariateGeneratorTest(int, char *[]) typedef itk::Statistics::MinimalStandardRandomVariateGenerator GeneratorType; GeneratorType::Pointer generator = GeneratorType::New(); - EXERCISE_BASIC_OBJECT_METHODS(generator, MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); + ITK_EXERCISE_BASIC_OBJECT_METHODS(generator, MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); generator->Initialize(324); - TEST_EXPECT_TRUE(itk::Math::FloatAlmostEqual(generator->GetVariate(), 1.35581, 4, 0.0001)); + ITK_TEST_EXPECT_TRUE(itk::Math::FloatAlmostEqual(generator->GetVariate(), 1.35581, 4, 0.0001)); return EXIT_SUCCESS; } diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 1eee0b4..cda4dd2 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -71,7 +71,7 @@ int itk{{ cookiecutter.filter_name }}Test(int argc, char * argv[]) using FilterType = itk::{{ cookiecutter.filter_name }}; FilterType::Pointer filter = FilterType::New(); - EXERCISE_BASIC_OBJECT_METHODS(filter, {{ cookiecutter.filter_name }}, ImageToImageFilter); + ITK_EXERCISE_BASIC_OBJECT_METHODS(filter, {{ cookiecutter.filter_name }}, ImageToImageFilter); // Create input image to avoid test dependencies. ImageType::SizeType size; @@ -91,7 +91,7 @@ int itk{{ cookiecutter.filter_name }}Test(int argc, char * argv[]) writer->SetInput(filter->GetOutput()); writer->SetUseCompression(true); - TRY_EXPECT_NO_EXCEPTION(writer->Update()); + ITK_TRY_EXPECT_NO_EXCEPTION(writer->Update()); std::cout << "Test finished." << std::endl; From c0cdb9d163be3d8aa1fb4dd3417bed563703b1b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Thu, 21 May 2020 09:43:14 -0400 Subject: [PATCH 068/151] STYLE: baseline comes first --- {{cookiecutter.project_name}}/test/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/test/CMakeLists.txt b/{{cookiecutter.project_name}}/test/CMakeLists.txt index e90170b..0f6e566 100644 --- a/{{cookiecutter.project_name}}/test/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/test/CMakeLists.txt @@ -14,8 +14,8 @@ itk_add_test(NAME itkMinimalStandardRandomVariateGeneratorTest itk_add_test(NAME itk{{ cookiecutter.filter_name }}Test COMMAND {{ cookiecutter.module_name }}TestDriver --compare - ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha DATA{Baseline/itk{{ cookiecutter.filter_name }}TestOutput.mha} + ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha itk{{ cookiecutter.filter_name }}Test ${ITK_TEST_OUTPUT_DIR}/itk{{ cookiecutter.filter_name }}TestOutput.mha ) From eada3579e00a63c5e120918e9a6f339d8fa9211b Mon Sep 17 00:00:00 2001 From: Davis Vigneault Date: Thu, 21 May 2020 16:28:00 -0700 Subject: [PATCH 069/151] BUG: Fix 404 Error in License Badge Link An extraneous end parenthesis has been removed, which was resulting in a 404 error when trying to access the LICENSE file via the badge. --- {{cookiecutter.project_name}}/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index c7ca5d0..8b0be1d 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -9,7 +9,7 @@ :alt: PyPI Version .. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg - :target: {{ cookiecutter.download_url }}/blob/master/LICENSE) + :target: {{ cookiecutter.download_url }}/blob/master/LICENSE :alt: License Overview From f050ed48f02bf5c62489f17cf019b8452fbb04a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 22 May 2020 09:40:45 -0400 Subject: [PATCH 070/151] BUG: copy-paste error: input and output types might be different --- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index 2f025d0..51d8b24 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -43,7 +43,7 @@ class {{ cookiecutter.filter_name }} : public ImageToImageFilter Date: Mon, 1 Jun 2020 18:06:46 -0400 Subject: [PATCH 071/151] BUG: Build Python packages against v5.1.0.post2 Adds package improvements. All remote modules should update their CI to build against itk v5.1.0.post2 and their setup.py dependency to itk>=5.1.0.post2 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index a3a5733..dd62a68 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -137,7 +137,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 @@ -181,7 +181,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 @@ -218,7 +218,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 75a4d9e..a481002 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -130,7 +130,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 @@ -195,7 +195,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0" + - itk-python-git-tag: "v5.1.0.post2" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 00b54fb..cac835e 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -44,6 +44,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.0.0.post1' + r'itk>=5.1.0.post2' ] ) From e449483edca95d6a4562d11ff0d76c0c6b7da98f Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 2 Jun 2020 08:36:36 -0400 Subject: [PATCH 072/151] BUG: Remove Azure Pipelines CI configuration This has been replaced by GitHub Actions. --- azure-pipelines.yml | 247 ------------------ .../test/azure-pipelines.yml | 219 ---------------- 2 files changed, 466 deletions(-) delete mode 100644 azure-pipelines.yml delete mode 100644 {{cookiecutter.project_name}}/test/azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index 61146c9..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,247 +0,0 @@ -# The file template originates from: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate -variables: - ITKGitTag: v5.1.0 - ITKPythonGitTag: v5.1.0 - CMakeBuildType: Release - -trigger: - batch: true - branches: - include: - - master - -jobs: - -- job: 'Test' - displayName: "Build and test" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - - strategy: - matrix: - Linux: - imageName: 'ubuntu-18.04' - cCompiler: gcc - cxxCompiler: g++ - compilerInitialization: '' - macOS: - imageName: 'macos-10.15' - cCompiler: clang - cxxCompiler: clang++ - compilerInitialization: '' - Windows: - imageName: 'windows-2019' - cCompiler: cl.exe - cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' - - pool: - vmImage: $(imageName) - - steps: - - bash: | - set -x - if [ -n "$(System.PullRequest.SourceCommitId)" ]; then - git checkout $(System.PullRequest.SourceCommitId) - fi - displayName: 'Checkout pull request HEAD' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install scikit-ci-addons - python -m pip install cookiecutter - python -m pip install ninja - displayName: 'Install build dependencies' - - - script: | - git clone --depth 5 --branch $(ITKGitTag) https://github.com/InsightSoftwareConsortium/ITK.git - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Download ITK' - - - script: | - mkdir ITK-build - cd ITK-build - $(compilerInitialization) - cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK - ninja - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Build ITK' - - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - displayName: 'Fetch CTest driver script' - - - bash: | - python -m cookiecutter --no-input --output-dir "$(Agent.BuildDirectory)" "$(Build.SourcesDirectory)" - mkdir "$(Agent.BuildDirectory)/ITKModuleTemplate/.git" - displayName: 'Evaluate template' - - - bash: | - cat > dashboard.cmake << EOF - set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) - set(dashboard_source_name "$(Build.Repository.Name)") - if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) - set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") - set(dashboard_model "Experimental") - elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") - set(branch "-master") - set(dashboard_model "Continuous") - else() - set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") - set(dashboard_model "Experimental") - endif() - if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) - set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") - else() - set(pr "") - endif() - set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") - set(CTEST_UPDATE_VERSION_ONLY 1) - set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) - set(CTEST_BUILD_CONFIGURATION "Release") - set(CTEST_CMAKE_GENERATOR "Ninja") - set(CTEST_CUSTOM_WARNING_EXCEPTION - \${CTEST_CUSTOM_WARNING_EXCEPTION} - # macOS Azure Pipelines - "ld: warning: text-based stub file" - ) - set(dashboard_no_clean 1) - set(ENV{CC} $(cCompiler)) - set(ENV{CXX} $(cxxCompiler)) - set(dashboard_cache " - ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build - BUILD_TESTING:BOOL=ON - ") - string(TIMESTAMP build_date "%Y-%m-%d") - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") - message("CTEST_SITE = \${CTEST_SITE}") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - cat dashboard.cmake - displayName: 'Configure CTest script' - - - script: | - $(compilerInitialization) - ctest -j 2 -V -S dashboard.cmake - displayName: 'Build and test' - - - script: | - sudo pip3 install --upgrade pip - sudo pip3 install --upgrade setuptools - sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter "$(Agent.BuildDirectory)/build" > "$(Agent.BuildDirectory)/JUnitTestResults.xml" - condition: succeededOrFailed() - displayName: 'Format CTest output in JUnit format' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" - testRunTitle: 'CTest $(Agent.OS)' - condition: succeededOrFailed() - displayName: 'Publish test results' - - -- job: 'PackageLinux' - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - displayName: "Build Linux Python packages" - pool: - vmImage: 'Ubuntu-18.04' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - $(Build.SourcesDirectory)/dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LinuxWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - - -- job: 'PackageMacOS' - displayName: "Build macOS Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'macos-10.15' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - cd $(Agent.BuildDirectory)/ITKModuleTemplate - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - $(Build.SourcesDirectory)/macpython-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MacOSWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' - - -- job: 'PackageWindows' - displayName: "Build Windows Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'windows-2019' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - displayName: 'Fetch build script' - - - script: | - python -m pip install cookiecutter - python -m cookiecutter --no-input --output-dir $(Agent.BuildDirectory) $(Build.SourcesDirectory) - displayName: 'Evaluate template' - - - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cd $(Agent.BuildDirectory)\ITKModuleTemplate - set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - set CC=cl.exe - set CXX=cl.exe - powershell.exe -file $(Build.SourcesDirectory)\windows-download-cache-and-build-module-wheels.ps1 - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WindowsWheels' - targetPath: '$(Agent.BuildDirectory)/ITKModuleTemplate/dist' diff --git a/{{cookiecutter.project_name}}/test/azure-pipelines.yml b/{{cookiecutter.project_name}}/test/azure-pipelines.yml deleted file mode 100644 index cdbce14..0000000 --- a/{{cookiecutter.project_name}}/test/azure-pipelines.yml +++ /dev/null @@ -1,219 +0,0 @@ -variables: - ITKGitTag: v5.1.0 - ITKPythonGitTag: v5.1.0 - CMakeBuildType: Release - -trigger: - batch: true - branches: - include: - - master - -jobs: - -- job: 'Test' - displayName: "Build and test" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - - strategy: - matrix: - Linux: - imageName: 'ubuntu-18.04' - cCompiler: gcc - cxxCompiler: g++ - compilerInitialization: '' - macOS: - imageName: 'macos-10.15' - cCompiler: clang - cxxCompiler: clang++ - compilerInitialization: '' - Windows: - imageName: 'windows-2019' - cCompiler: cl.exe - cxxCompiler: cl.exe - compilerInitialization: 'call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat"' - - pool: - vmImage: $(imageName) - - steps: - - bash: | - set -x - if [ -n "$(System.PullRequest.SourceCommitId)" ]; then - git checkout $(System.PullRequest.SourceCommitId) - fi - displayName: 'Checkout pull request HEAD' - - - task: UsePythonVersion@0 - inputs: - versionSpec: '3.7' - architecture: 'x64' - - - script: | - python -m pip install --upgrade pip - python -m pip install --upgrade setuptools - python -m pip install scikit-ci-addons - python -m pip install ninja - displayName: 'Install build dependencies' - - - script: | - git clone https://github.com/InsightSoftwareConsortium/ITK.git - cd ITK - git checkout $(ITKGitTag) - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Download ITK' - - - script: | - mkdir ITK-build - cd ITK-build - $(compilerInitialization) - cmake -DCMAKE_C_COMPILER:FILEPATH="$(cCompiler)" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="$(cxxCompiler)" -DCMAKE_BUILD_TYPE:STRING=$(CMakeBuildType) -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK - ninja - workingDirectory: $(Agent.BuildDirectory) - displayName: 'Build ITK' - - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - displayName: 'Fetch CTest driver script' - - - bash: | - cat > dashboard.cmake << EOF - set(CTEST_SITE "Azure.\$ENV{AGENT_MACHINENAME}") - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}" CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{BUILD_SOURCESDIRECTORY}" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "\$ENV{AGENT_BUILDDIRECTORY}/build" CTEST_BINARY_DIRECTORY) - set(dashboard_source_name "$(Build.Repository.Name)") - if(DEFINED ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}) - set(branch "-\$ENV{SYSTEM_PULLREQUEST_SOURCEBRANCH}") - set(dashboard_model "Experimental") - elseif(ENV{BUILD_SOURCEBRANCHNAME} STREQUAL "master") - set(branch "-master") - set(dashboard_model "Continuous") - else() - set(branch "-\$ENV{BUILD_SOURCEBRANCHNAME}") - set(dashboard_model "Experimental") - endif() - if(DEFINED ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}) - set(pr "-PR\$ENV{SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}") - else() - set(pr "") - endif() - set(CTEST_BUILD_NAME "$(Build.Repository.Name)-$(Agent.OS)-Build$(Build.BuildId)\${pr}\${branch}") - set(CTEST_UPDATE_VERSION_ONLY 1) - set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) - set(CTEST_BUILD_CONFIGURATION "Release") - set(CTEST_CMAKE_GENERATOR "Ninja") - set(CTEST_CUSTOM_WARNING_EXCEPTION - \${CTEST_CUSTOM_WARNING_EXCEPTION} - # macOS Azure Pipelines - "ld: warning: text-based stub file" - ) - set(dashboard_no_clean 1) - set(ENV{CC} $(cCompiler)) - set(ENV{CXX} $(cxxCompiler)) - set(dashboard_cache " - ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build - BUILD_TESTING:BOOL=ON - ") - string(TIMESTAMP build_date "%Y-%m-%d") - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") - message("CTEST_SITE = \${CTEST_SITE}") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - cat dashboard.cmake - displayName: 'Configure CTest script' - - - script: | - $(compilerInitialization) - ctest -j 2 -V -S dashboard.cmake - displayName: 'Build and test' - - - script: | - sudo pip3 install --upgrade pip - sudo pip3 install --upgrade setuptools - sudo pip3 install scikit-ci-addons - ci_addons ctest_junit_formatter $(Agent.BuildDirectory)/build > $(Agent.BuildDirectory)/JUnitTestResults.xml - condition: succeededOrFailed() - displayName: 'Format CTest output in JUnit format' - - - task: PublishTestResults@2 - inputs: - testResultsFiles: "$(Agent.BuildDirectory)/JUnitTestResults.xml" - testRunTitle: 'CTest $(Agent.OS)' - condition: succeededOrFailed() - displayName: 'Publish test results' - - -- job: 'PackageLinux' - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - displayName: "Build Linux Python packages" - pool: - vmImage: 'Ubuntu-18.04' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'LinuxWheels' - targetPath: './dist' - - -- job: 'PackageMacOS' - displayName: "Build macOS Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'macos-10.15' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O - chmod u+x macpython-download-cache-and-build-module-wheels.sh - displayName: 'Fetch build script' - - - script: | - export ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - ./macpython-download-cache-and-build-module-wheels.sh - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'MacOSWheels' - targetPath: './dist' - - -- job: 'PackageWindows' - displayName: "Build Windows Python packages" - timeoutInMinutes: 0 - cancelTimeoutInMinutes: 300 - pool: - vmImage: 'windows-2019' - - steps: - - script: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/windows-download-cache-and-build-module-wheels.ps1 -O - displayName: 'Fetch build script' - - - script: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set ITK_PACKAGE_VERSION=$(ITKPythonGitTag) - set CC=cl.exe - set CXX=cl.exe - powershell.exe -file .\windows-download-cache-and-build-module-wheels.ps1 - displayName: 'Build Python packages' - - - task: PublishPipelineArtifact@0 - inputs: - artifactName: 'WindowsWheels' - targetPath: './dist' From 7b485064ceb4650a42776a40ad999b1985bc26e2 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 16 Jun 2020 21:54:56 -0400 Subject: [PATCH 073/151] ENH: Bump Python CI builds for v5.1.0.post3 This fixes remote module package use with Dask distributed. --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index dd62a68..848589b 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -137,7 +137,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 @@ -181,7 +181,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 @@ -218,7 +218,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index a481002..806909f 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -130,7 +130,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 @@ -195,7 +195,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0.post2" + - itk-python-git-tag: "v5.1.0.post3" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index cac835e..1ac0c3d 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -44,6 +44,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.1.0.post2' + r'itk>=5.1.0.post3' ] ) From b7f3d460af0720f6a491d62c0f7ac4a23b9bc629 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 11 Aug 2020 11:34:48 -0400 Subject: [PATCH 074/151] ENH: Build against ITK 5.1.1 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 848589b..0ea7d31 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "MinSizeRel" steps: @@ -137,7 +137,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 @@ -181,7 +181,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 @@ -218,7 +218,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 806909f..fbfd760 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.0" + itk-git-tag: "v5.1.1" cmake-build-type: "MinSizeRel" steps: @@ -130,7 +130,7 @@ jobs: matrix: python-version: [35, 36, 37, 38] include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 @@ -195,7 +195,7 @@ jobs: matrix: python-version-minor: [5, 6, 7, 8] include: - - itk-python-git-tag: "v5.1.0.post3" + - itk-python-git-tag: "v5.1.1" steps: - uses: actions/checkout@v2 From 60fbfd5ed580ae36ef81b59400f4deca95ea24e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Mon, 19 Oct 2020 11:32:58 -0400 Subject: [PATCH 075/151] ENH: update minimum Python version from 3.5 to 3.6 --- .github/workflows/build-test-package.yml | 4 ++-- .../.github/workflows/build-test-package.yml | 4 ++-- {{cookiecutter.project_name}}/setup.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 0ea7d31..df38c06 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -135,7 +135,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [35, 36, 37, 38] + python-version: [36, 37, 38] include: - itk-python-git-tag: "v5.1.1" @@ -216,7 +216,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [5, 6, 7, 8] + python-version-minor: [6, 7, 8] include: - itk-python-git-tag: "v5.1.1" diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index fbfd760..65f41d1 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -128,7 +128,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [35, 36, 37, 38] + python-version: [36, 37, 38] include: - itk-python-git-tag: "v5.1.1" @@ -193,7 +193,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [5, 6, 7, 8] + python-version-minor: [6, 7, 8] include: - itk-python-git-tag: "v5.1.1" diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 1ac0c3d..8c696ad 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function from os import sys try: @@ -44,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.1.0.post3' + r'itk>=5.1.1' ] ) From 890b67bc6d59acde7aaccd68a15614c0cbb76a6e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 23 Oct 2020 09:19:54 -0400 Subject: [PATCH 076/151] ENH: Python packages against v5.1.1.post1 for 3.9 support --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index df38c06..fd1c5d5 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -137,7 +137,7 @@ jobs: matrix: python-version: [36, 37, 38] include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 @@ -181,7 +181,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 @@ -218,7 +218,7 @@ jobs: matrix: python-version-minor: [6, 7, 8] include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 65f41d1..d96be17 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -130,7 +130,7 @@ jobs: matrix: python-version: [36, 37, 38] include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 @@ -166,7 +166,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 @@ -195,7 +195,7 @@ jobs: matrix: python-version-minor: [6, 7, 8] include: - - itk-python-git-tag: "v5.1.1" + - itk-python-git-tag: "v5.1.1.post1" steps: - uses: actions/checkout@v2 From 77ec46dbf8886cd5ec4abafe1a0efb7a93544af6 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Thu, 22 Oct 2020 15:47:42 +0200 Subject: [PATCH 077/151] BUG: add ITK runtime output directory to windows PATH --- .github/workflows/build-test-package.yml | 3 +++ .../.github/workflows/build-test-package.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index fd1c5d5..8236001 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -107,6 +107,9 @@ jobs: set(dashboard_no_clean 1) set(ENV{CC} ${{ matrix.c-compiler }}) set(ENV{CXX} ${{ matrix.cxx-compiler }}) + if(WIN32) + set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}") + endif() set(dashboard_cache " ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build BUILD_TESTING:BOOL=ON diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index d96be17..22317a4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -100,6 +100,9 @@ jobs: set(dashboard_no_clean 1) set(ENV{CC} ${{ "{{" }} matrix.c-compiler {{ "}}" }}) set(ENV{CXX} ${{ "{{" }} matrix.cxx-compiler {{ "}}" }}) + if(WIN32) + set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}") + endif() set(dashboard_cache " ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build BUILD_TESTING:BOOL=ON From a32309cd8faa8fb26a8d21dfe73bab0aa2c0b14c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 26 Oct 2020 17:10:37 -0400 Subject: [PATCH 078/151] ENH: Build Python 3.9 Python packages --- .github/workflows/build-test-package.yml | 4 ++-- .../.github/workflows/build-test-package.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 8236001..f031213 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -138,7 +138,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [36, 37, 38] + python-version: [36, 37, 38, 39] include: - itk-python-git-tag: "v5.1.1.post1" @@ -219,7 +219,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [6, 7, 8] + python-version-minor: [6, 7, 8, 9] include: - itk-python-git-tag: "v5.1.1.post1" diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 22317a4..640ce34 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -131,7 +131,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [36, 37, 38] + python-version: [36, 37, 38, 39] include: - itk-python-git-tag: "v5.1.1.post1" @@ -196,7 +196,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [6, 7, 8] + python-version-minor: [6, 7, 8, 9] include: - itk-python-git-tag: "v5.1.1.post1" From 3ad9bb64612664cdc78a55ff70c7a111df98be7c Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 2 Dec 2020 08:20:00 -0500 Subject: [PATCH 079/151] ENH: Update CI to build again ITK 5.1.2 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index f031213..b91fcb3 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "MinSizeRel" steps: @@ -140,7 +140,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 @@ -184,7 +184,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 @@ -221,7 +221,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 640ce34..2b1501c 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.1" + itk-git-tag: "v5.1.2" cmake-build-type: "MinSizeRel" steps: @@ -133,7 +133,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 @@ -169,7 +169,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 @@ -198,7 +198,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.1.1.post1" + - itk-python-git-tag: "v5.1.2" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 8c696ad..0b49708 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.1.1' + r'itk>=5.1.2' ] ) From 4ee7b68e783e558d79947f0d5b87b944290fea26 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 13 Dec 2020 20:12:51 -0500 Subject: [PATCH 080/151] COMP: Use CMake 3.18.3 Work around a regression in CMake 3.19.1 causing configuration errors: CMake Error: install(EXPORT "ITKTargets" ...) includes target "gdcmjpeg8" xref: https://gitlab.kitware.com/cmake/cmake/-/issues/21529 Install CMake 3.18.3. --- .github/workflows/build-test-package.yml | 9 +++++++++ .../.github/workflows/build-test-package.yml | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index b91fcb3..873aaa4 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -40,6 +40,9 @@ jobs: python -m pip install ninja python -m pip install cookiecutter + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: Download ITK run: | cd .. @@ -189,6 +192,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: 'Fetch build script' run: | curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O @@ -236,6 +242,9 @@ jobs: with: python-version: '3.x' + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: Evaluate template shell: bash run: | diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 2b1501c..2f0c1e3 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -39,6 +39,9 @@ jobs: python -m pip install --upgrade pip python -m pip install ninja + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: Download ITK run: | cd .. @@ -174,6 +177,9 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: 'Fetch build script' run: | curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O @@ -201,6 +207,9 @@ jobs: - itk-python-git-tag: "v5.1.2" steps: + - name: Get specific of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - uses: actions/checkout@v2 with: path: "im" From 73d4488015a0103d66a8427d09eddf1a69aa92e1 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 14 Dec 2020 16:47:15 -0500 Subject: [PATCH 081/151] COMP: Install specific XCode version for Python packages To be compatible with the ITKPythonBuilds, which are not built against the same version. xref: https://github.com/actions/virtual-environments/issues/2056 xref: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-10.15-Readme.md#xcode --- .github/workflows/build-test-package.yml | 4 ++++ .../.github/workflows/build-test-package.yml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 873aaa4..027c706 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -192,6 +192,10 @@ jobs: steps: - uses: actions/checkout@v2 + - name: 'Specific XCode version' + run: | + sudo xcode-select -s "/Applications/Xcode_11.7.app" + - name: Get specific of CMake, Ninja uses: lukka/get-cmake@v3.18.3 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 2f0c1e3..e30fa8a 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -177,6 +177,10 @@ jobs: steps: - uses: actions/checkout@v2 + - name: 'Specific XCode version' + run: | + sudo xcode-select -s "/Applications/Xcode_11.7.app" + - name: Get specific of CMake, Ninja uses: lukka/get-cmake@v3.18.3 From 204da830ddeec39375c953d0b552c957d1f07759 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 19 Dec 2020 08:32:58 -0500 Subject: [PATCH 082/151] STYLE: CI specific version description grammar --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 027c706..7ed35b3 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -40,7 +40,7 @@ jobs: python -m pip install ninja python -m pip install cookiecutter - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - name: Download ITK @@ -196,7 +196,7 @@ jobs: run: | sudo xcode-select -s "/Applications/Xcode_11.7.app" - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - name: 'Fetch build script' @@ -246,7 +246,7 @@ jobs: with: python-version: '3.x' - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - name: Evaluate template diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index e30fa8a..5cdd203 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -39,7 +39,7 @@ jobs: python -m pip install --upgrade pip python -m pip install ninja - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - name: Download ITK @@ -181,7 +181,7 @@ jobs: run: | sudo xcode-select -s "/Applications/Xcode_11.7.app" - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - name: 'Fetch build script' @@ -211,7 +211,7 @@ jobs: - itk-python-git-tag: "v5.1.2" steps: - - name: Get specific of CMake, Ninja + - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 - uses: actions/checkout@v2 From de733d7e5ead1d13efec278124519dfe7d712846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 29 Dec 2020 17:57:04 -0500 Subject: [PATCH 083/151] STYLE: rename wheel from WindowWheel3.* to WindowsWheel3.* --- .../.github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 5cdd203..328ed74 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -249,7 +249,7 @@ jobs: - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 with: - name: WindowWheel3.${{ "{{" }} matrix.python-version-minor {{ "}}" }} + name: WindowsWheel3.${{ "{{" }} matrix.python-version-minor {{ "}}" }} path: ../../im/dist publish-python-packages-to-pypi: From c140ff3bae33be3f8acdbfc87d4a9bf3829a8f11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 5 Jan 2021 18:47:00 -0500 Subject: [PATCH 084/151] BUG: fix working directory for remote clone --- .../.github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 328ed74..29c691b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -228,7 +228,7 @@ jobs: shell: bash run: | mv im ../../ - cd ../../ + cd ../../im curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" From 3329acf9da348ee4087a205864a1f8837530a721 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 Jan 2021 12:11:43 -0500 Subject: [PATCH 085/151] ENH: Update CI to build against ITK v5.2rc01 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 7ed35b3..57a5f33 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "MinSizeRel" steps: @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 29c691b..f0faa1b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.1.2" + itk-git-tag: "v5.2rc01" cmake-build-type: "MinSizeRel" steps: @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.1.2" + - itk-python-git-tag: "v5.2rc01" steps: - name: Get specific version of CMake, Ninja From 7ef9e211249f14e1fef5c484b447fa683d632d4f Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 6 Jan 2021 15:08:30 -0500 Subject: [PATCH 086/151] COMP: Update CI itk-git-tag for ITKModuleExternal.cmake build paths Incorporates: https://github.com/InsightSoftwareConsortium/ITK/pull/2240 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 57a5f33..20bcf0f 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "MinSizeRel" steps: diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index f0faa1b..5bc5c08 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc01" + itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" cmake-build-type: "MinSizeRel" steps: From 0885f86d74a7d4c4827680323d28e225b9d4c508 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 8 Jan 2021 21:38:02 -0500 Subject: [PATCH 087/151] BUG: Update ITK Git tag for Windows test execution Incorporates https://github.com/InsightSoftwareConsortium/ITK/pull/2245 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 20bcf0f..657c9f0 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "MinSizeRel" steps: diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 5bc5c08..d02cef5 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "756bf9b97a12dd7d1997ae8f233dba3663b77885" + itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" cmake-build-type: "MinSizeRel" steps: From ddf8381339ca92143b4e39ae6e30d252f58f6e7b Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 11 Jan 2021 10:40:10 -0500 Subject: [PATCH 088/151] BUG: Update Python package dependency to itk>=5.2rc1 --- {{cookiecutter.project_name}}/setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 0b49708..1206dbc 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.1.2' + r'itk>=5.2rc1' ] ) From a4ab3d87b21f57b43aa3b88d611819e5919af3d1 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 12 Feb 2021 15:28:23 -0500 Subject: [PATCH 089/151] ENH: Bump ITK version to 5.2 RC 02 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 657c9f0..c864a6b 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "MinSizeRel" steps: @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index d02cef5..f134a75 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "abd38d5a0040b9a8fbb0ad3127089dbb72a93342" + itk-git-tag: "v5.2rc02" cmake-build-type: "MinSizeRel" steps: @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc01" + - itk-python-git-tag: "v5.2rc02" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 1206dbc..afd9dd1 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2rc1' + r'itk>=5.2rc2' ] ) From 63fe6c520b9aef852c246bff3c124a24da7790f2 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 1 Mar 2021 21:24:35 -0500 Subject: [PATCH 090/151] DOC: Correct GitHub Actions badge for different Organization URLs --- {{cookiecutter.project_name}}/README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 8b0be1d..d18cc6d 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -1,7 +1,7 @@ {{ cookiecutter.project_name }} ================================= -.. image:: https://github.com/InsightSoftwareConsortium/{{ cookiecutter.project_name }}/workflows/Build,%20test,%20package/badge.svg +.. image:: {{ cookiecutter.download_url }}/workflows/Build,%20test,%20package/badge.svg :alt: Build Status .. image:: https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg From ee9ed99bc93f139636b97178c2857de860f0db35 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Thu, 4 Mar 2021 19:03:27 -0500 Subject: [PATCH 091/151] ENH: Bump builds against ITK v5.2rc03 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index c864a6b..ea9846b 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "MinSizeRel" steps: @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index f134a75..91124cc 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc02" + itk-git-tag: "v5.2rc03" cmake-build-type: "MinSizeRel" steps: @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc02" + - itk-python-git-tag: "v5.2rc03" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index afd9dd1..deb7d7e 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2rc2' + r'itk>=5.2rc3' ] ) From e275e84446ea9897b47353da62ba6920ed982150 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 12 Mar 2021 15:56:16 -0500 Subject: [PATCH 092/151] BUG: Do use use shallow version of checkout for clang format linting Recent checks fail to checkout the required commit. --- .github/workflows/clang-format-linter.yml | 3 +-- .../.github/workflows/clang-format-linter.yml | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index 69166d9..c59dd58 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -8,6 +8,5 @@ jobs: steps: - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master diff --git a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml index 69166d9..c59dd58 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml @@ -8,6 +8,5 @@ jobs: steps: - uses: actions/checkout@v1 - with: - fetch-depth: 1 + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master From d23eaeedb9cbaefb6d263089de11f8398f6bfe34 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 5 Apr 2021 10:35:33 -0400 Subject: [PATCH 093/151] ENH: Update CI to ITK v5.2.0 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index ea9846b..40c1b3d 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "MinSizeRel" steps: @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - uses: actions/checkout@v2 @@ -187,7 +187,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - uses: actions/checkout@v2 @@ -231,7 +231,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 91124cc..fd654c9 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2rc03" + itk-git-tag: "v5.2.0" cmake-build-type: "MinSizeRel" steps: @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2rc03" + - itk-python-git-tag: "v5.2.0" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index deb7d7e..ede1ed3 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2rc3' + r'itk>=5.2.0' ] ) From 9db75af198f1d2c9f21da78643c322bf69a4ce42 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 5 Apr 2021 11:36:55 -0400 Subject: [PATCH 094/151] COMP: Install newer Python for cookiecutter testing CI failing with: Collecting cookiecutter Downloading https://files.pythonhosted.org/packages/95/83/83ebf950ec99b02c61719ccb116462844ba2e873df7c4d40afc962494312/cookiecutter-1.7.2-py2.py3-none-any.whl Collecting click>=7.0 (from cookiecutter) Downloading https://files.pythonhosted.org/packages/d2/3d/fa76db83bf75c4f8d338c2fd15c8d33fdd7ad23a9b5e57eb6c5de26b430e/click-7.1.2-py2.py3-none-any.whl (82kB) Collecting jinja2-time>=0.2.0 (from cookiecutter) Downloading https://files.pythonhosted.org/packages/6a/a1/d44fa38306ffa34a7e1af09632b158e13ec89670ce491f8a15af3ebcb4e4/jinja2_time-0.2.0-py2.py3-none-any.whl Collecting python-slugify>=4.0.0 (from cookiecutter) Downloading https://files.pythonhosted.org/packages/9f/42/e336f96a8b6007428df772d0d159b8eee9b2f1811593a4931150660402c0/python-slugify-4.0.1.tar.gz Complete output from command python setup.py egg_info: Traceback (most recent call last): File "", line 1, in ImportError: No module named setuptools --- .github/workflows/build-test-package.yml | 23 +++++++++++++++---- .../.github/workflows/build-test-package.yml | 8 +++---- 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 40c1b3d..4677a46 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -29,10 +29,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install build dependencies run: | @@ -137,7 +137,7 @@ jobs: shell: cmd build-linux-python-packages: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: max-parallel: 2 matrix: @@ -157,6 +157,11 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" df -h + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Evaluate template shell: bash run: | @@ -204,6 +209,11 @@ jobs: curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O chmod u+x macpython-download-cache-and-build-module-wheels.sh + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Evaluate template shell: bash run: | @@ -249,6 +259,11 @@ jobs: - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 + with: + python-version: 3.8 + - name: Evaluate template shell: bash run: | diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index fd654c9..5e77ce4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -29,10 +29,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.7 - uses: actions/setup-python@v1 + - name: Set up Python 3.8 + uses: actions/setup-python@v2 with: - python-version: 3.7 + python-version: 3.8 - name: Install build dependencies run: | @@ -130,7 +130,7 @@ jobs: shell: cmd build-linux-python-packages: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 strategy: max-parallel: 2 matrix: From 73a69055fad42a3f5a92343fad11e3bcc1286077 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 19 Apr 2021 14:32:49 -0400 Subject: [PATCH 095/151] ENH: Update GitHub Actions to checkout v2 --- .github/workflows/build-test-package.yml | 2 +- .../.github/workflows/build-test-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 4677a46..a11a32e 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -27,7 +27,7 @@ jobs: cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python 3.8 uses: actions/setup-python@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 5e77ce4..2120ac4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -27,7 +27,7 @@ jobs: cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up Python 3.8 uses: actions/setup-python@v2 From f09698f858a003d24bf34ef1a6155a887499f3d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 21 Apr 2021 10:49:31 -0400 Subject: [PATCH 096/151] COMP: Use ITK_DISALLOW_COPY_AND_MOVE instead of *_ASSIGN --- .../include/itkMinimalStandardRandomVariateGenerator.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index d2552aa..5b0bcc2 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -53,7 +53,7 @@ namespace Statistics class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerator : public RandomVariateGeneratorBase { public: - ITK_DISALLOW_COPY_AND_ASSIGN(MinimalStandardRandomVariateGenerator); + ITK_DISALLOW_COPY_AND_MOVE(MinimalStandardRandomVariateGenerator); /** Standard class typedefs. */ using Self = MinimalStandardRandomVariateGenerator; diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index 51d8b24..612fe4d 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -37,7 +37,7 @@ template class {{ cookiecutter.filter_name }} : public ImageToImageFilter { public: - ITK_DISALLOW_COPY_AND_ASSIGN({{ cookiecutter.filter_name }}); + ITK_DISALLOW_COPY_AND_MOVE({{ cookiecutter.filter_name }}); static constexpr unsigned int InputImageDimension = TInputImage::ImageDimension; static constexpr unsigned int OutputImageDimension = TOutputImage::ImageDimension; From 1cd523b79ab8efcc9f5805dbe9e71eaa8c07991a Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 28 Apr 2021 23:06:10 -0400 Subject: [PATCH 097/151] ENH: Update Python package builds for v5.2.0.post1 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index a11a32e..2e78108 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - uses: actions/checkout@v2 @@ -241,7 +241,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 2120ac4..c7cff1d 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0" + - itk-python-git-tag: "v5.2.0.post1" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index ede1ed3..1806732 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.0' + r'itk>=5.2.0.post1' ] ) From 1e9227cb4e3dde500377cc6aee3c2f7c3a23d1db Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 5 May 2021 23:26:04 -0400 Subject: [PATCH 098/151] ENH: Update Python packages to v5.2.0.post2 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2e78108..7988460 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - uses: actions/checkout@v2 @@ -241,7 +241,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index c7cff1d..9f32c23 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post1" + - itk-python-git-tag: "v5.2.0.post2" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 1806732..0881712 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.0.post1' + r'itk>=5.2.0.post2' ] ) From 7901bba99ab48df95ac5d788f4d552545aa993b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 19 May 2021 14:06:20 -0400 Subject: [PATCH 099/151] ENH: Adding ITK code style files --- {{cookiecutter.project_name}}/.clang-format | 151 ++++++++++++++++++++ {{cookiecutter.project_name}}/.editorconfig | 19 +++ 2 files changed, 170 insertions(+) create mode 100644 {{cookiecutter.project_name}}/.clang-format create mode 100644 {{cookiecutter.project_name}}/.editorconfig diff --git a/{{cookiecutter.project_name}}/.clang-format b/{{cookiecutter.project_name}}/.clang-format new file mode 100644 index 0000000..399e250 --- /dev/null +++ b/{{cookiecutter.project_name}}/.clang-format @@ -0,0 +1,151 @@ +## This config file is only relevant for clang-format version 8.0.0 +## +## Examples of each format style can be found on the in the clang-format documentation +## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option +## +## The clang-format binaries can be downloaded as part of the clang binary distributions +## from http://releases.llvm.org/download.html +## +## Use the script Utilities/Maintenance/clang-format.bash to faciliate +## maintaining a consistent code style. +## +## EXAMPLE apply code style enforcement before commit: +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified +## EXAMPLE apply code style enforcement after commit: +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last +--- +# This configuration requires clang-format version 8.0.0 exactly. +BasedOnStyle: Mozilla +Language: Cpp +AccessModifierOffset: -2 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: true +AlignEscapedNewlines: Right +AlignOperands: true +AlignTrailingComments: true +# clang 9.0 AllowAllArgumentsOnNextLine: true +# clang 9.0 AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: Inline +# clang 9.0 AllowShortLambdasOnASingleLine: All +# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterDefinitionReturnType: None +AlwaysBreakAfterReturnType: All +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: Yes +BinPackArguments: false +BinPackParameters: false +BreakBeforeBraces: Custom +BraceWrapping: + # clang 9.0 feature AfterCaseLabel: false + AfterClass: true + AfterControlStatement: true + AfterEnum: true + AfterFunction: true + AfterNamespace: true + AfterObjCDeclaration: true + AfterStruct: true + AfterUnion: true + AfterExternBlock: true + BeforeCatch: true + BeforeElse: true +## This is the big change from historical ITK formatting! +# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style +# with indented braces, and not indented code. This style is very difficult to automatically +# maintain with code beautification tools. Not indenting braces is more common among +# formatting tools. + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: false +BreakBeforeBinaryOperators: None +#clang 6.0 BreakBeforeInheritanceComma: true +BreakInheritanceList: BeforeComma +BreakBeforeTernaryOperators: true +#clang 6.0 BreakConstructorInitializersBeforeComma: true +BreakConstructorInitializers: BeforeComma +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +## The following line allows larger lines in non-documentation code +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: false +ConstructorInitializerIndentWidth: 2 +ContinuationIndentWidth: 2 +Cpp11BracedListStyle: false +DerivePointerAlignment: false +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^"(llvm|llvm-c|clang|clang-c)/' + Priority: 2 + - Regex: '^(<|"(gtest|gmock|isl|json)/)' + Priority: 3 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(Test)?$' +IndentCaseLabels: true +IndentPPDirectives: AfterHash +IndentWidth: 2 +IndentWrappedFunctionNames: false +JavaScriptQuotes: Leave +JavaScriptWrapImports: true +KeepEmptyLinesAtTheStartOfBlocks: true +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 2 +NamespaceIndentation: None +ObjCBinPackProtocolList: Auto +ObjCBlockIndentWidth: 2 +ObjCSpaceAfterProperty: true +ObjCSpaceBeforeProtocolList: false +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 19 +PenaltyBreakComment: 300 +## The following line allows larger lines in non-documentation code +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 200 +PointerAlignment: Middle +ReflowComments: true +# We may want to sort the includes as a separate pass +SortIncludes: false +# We may want to revisit this later +SortUsingDeclarations: false +SpaceAfterCStyleCast: false +# SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Cpp11 +StatementMacros: + - Q_UNUSED + - QT_REQUIRE_VERSION +TabWidth: 2 +UseTab: Never +... diff --git a/{{cookiecutter.project_name}}/.editorconfig b/{{cookiecutter.project_name}}/.editorconfig new file mode 100644 index 0000000..7b95893 --- /dev/null +++ b/{{cookiecutter.project_name}}/.editorconfig @@ -0,0 +1,19 @@ +# http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Apply to all code files +[*] +# A newline ending every file +insert_final_newline = true + +# Set default charset +charset = utf-8 + +# 4 space indentation +indent_style = space +indent_size = 2 + +# Various options +trim_trailing_whitespace = true From 8dc3bff4ff0da58cc13647d248049c43dda259a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Wed, 19 May 2021 14:23:16 -0400 Subject: [PATCH 100/151] ENH: Apply new ITK code style to template code --- .../itkMinimalStandardRandomVariateGenerator.h | 11 +++++++---- .../include/itk{{cookiecutter.filter_name}}.h | 8 +++++--- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 5b0bcc2..3c739ab 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -55,7 +55,7 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato public: ITK_DISALLOW_COPY_AND_MOVE(MinimalStandardRandomVariateGenerator); - /** Standard class typedefs. */ + /** Standard class aliases. */ using Self = MinimalStandardRandomVariateGenerator; using Superclass = RandomVariateGeneratorBase; using Pointer = SmartPointer; @@ -72,16 +72,19 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato itkNewMacro(Self); /** initialize with a simple IntegerType */ - void Initialize(int randomSeed); + void + Initialize(int randomSeed); /** Get a variate in the range [0, 1] */ - double GetVariate() override; + double + GetVariate() override; protected: MinimalStandardRandomVariateGenerator(); ~MinimalStandardRandomVariateGenerator() override = default; - void PrintSelf(std::ostream & os, Indent indent) const override; + void + PrintSelf(std::ostream & os, Indent indent) const override; private: NormalGeneratorType::Pointer m_NormalGenerator; diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index 612fe4d..84d6b91 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -47,7 +47,7 @@ class {{ cookiecutter.filter_name }} : public ImageToImageFilter; using Superclass = ImageToImageFilter; using Pointer = SmartPointer; @@ -63,11 +63,13 @@ class {{ cookiecutter.filter_name }} : public ImageToImageFilter Date: Fri, 28 May 2021 09:51:27 -0400 Subject: [PATCH 101/151] ENH: Build for itk-5.2.0.post3 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 7988460..3e51829 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - uses: actions/checkout@v2 @@ -241,7 +241,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 9f32c23..51e3171 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post2" + - itk-python-git-tag: "v5.2.0.post3" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 0881712..1a613d5 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.0.post2' + r'itk>=5.2.0.post3' ] ) From aa0b8337f1493edcefd272b5ef0d487dc8db4c40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 24 Jul 2021 19:34:27 -0400 Subject: [PATCH 102/151] ENH: Transition cookiecutter default branch name to `main` Transition cookiecutter default branch name to `main`. --- .../.github/workflows/build-test-package.yml | 4 ++-- {{cookiecutter.project_name}}/README.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 51e3171..bbf9822 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -83,8 +83,8 @@ jobs: file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY) file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") - if(ENV{GITHUB_REF} MATCHES "master") - set(branch "-master") + if(ENV{GITHUB_REF} MATCHES "main") + set(branch "-main") set(dashboard_model "Continuous") else() set(branch "-${GITHUB_REF}") diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index d18cc6d..831a106 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -9,7 +9,7 @@ :alt: PyPI Version .. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg - :target: {{ cookiecutter.download_url }}/blob/master/LICENSE + :target: {{ cookiecutter.download_url }}/blob/main/LICENSE :alt: License Overview From 25e12b4c6cfbd7f509ee8d2707e2c5464fe9d7d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 24 Jul 2021 19:41:04 -0400 Subject: [PATCH 103/151] ENH: Set default branch name to `main` in `Build, test, package` action Set default branch name to `main` in `Build, test, package` action. --- .github/workflows/build-test-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 3e51829..7856800 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -90,8 +90,8 @@ jobs: file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../Evaluated/ITKModuleTemplate" CTEST_SOURCE_DIRECTORY) file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) set(dashboard_source_name "${GITHUB_REPOSITORY}") - if(ENV{GITHUB_REF} MATCHES "master") - set(branch "-master") + if(ENV{GITHUB_REF} MATCHES "main") + set(branch "-main") set(dashboard_model "Continuous") else() set(branch "-${GITHUB_REF}") From ea605857849e834469cb942202a9a88a269a96ee Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sat, 14 Aug 2021 18:10:33 -0400 Subject: [PATCH 104/151] ENH: Update CI for ITK 5.2.1 --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 12 ++++++------ {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 3e51829..d9797a7 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "MinSizeRel" steps: @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - uses: actions/checkout@v2 @@ -241,7 +241,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 51e3171..064815b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-18.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2.0" + itk-git-tag: "v5.2.1" cmake-build-type: "MinSizeRel" steps: @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.0.post3" + - itk-python-git-tag: "v5.2.1" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 1a613d5..03023fa 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.0.post3' + r'itk>=5.2.1' ] ) From d102419aa0d239b1ece0cdd4c8f2a6cadadc4d38 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 6 Apr 2021 09:17:13 -0400 Subject: [PATCH 105/151] ENH: Update CI builds systems from Ubuntu 18.04 to 20.04 --- .github/workflows/build-test-package.yml | 4 ++-- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2d77a0a..918c442 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -8,9 +8,9 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-10.15] include: - - os: ubuntu-18.04 + - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" itk-git-tag: "v5.2.1" diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 30778b7..2859ff4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -8,9 +8,9 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-18.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-10.15] include: - - os: ubuntu-18.04 + - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" itk-git-tag: "v5.2.1" @@ -257,7 +257,7 @@ jobs: - build-linux-python-packages - build-macos-python-packages - build-windows-python-packages - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 steps: - name: Download Python Packages From 6594dab8e3c686ead982df66a5492834d6934056 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 1 Sep 2021 12:56:26 -0400 Subject: [PATCH 106/151] BUG: Update Python Git tag to v5.2.1.post1 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 918c442..4c721d9 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -143,7 +143,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - uses: actions/checkout@v2 @@ -241,7 +241,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 2859ff4..aafdd17 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -136,7 +136,7 @@ jobs: matrix: python-version: [36, 37, 38, 39] include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - uses: actions/checkout@v2 @@ -208,7 +208,7 @@ jobs: matrix: python-version-minor: [6, 7, 8, 9] include: - - itk-python-git-tag: "v5.2.1" + - itk-python-git-tag: "v5.2.1.post1" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index 03023fa..daeec10 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.1' + r'itk>=5.2.1.post1' ] ) From d9654750c9342fce6cc3a44b475cc3afb0a7ec67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 23 Nov 2021 17:00:21 -0500 Subject: [PATCH 107/151] ENH: use the new minimum version of CMake from ITK 5.3 --- {{cookiecutter.project_name}}/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/CMakeLists.txt b/{{cookiecutter.project_name}}/CMakeLists.txt index 09a341b..f3ff2bd 100644 --- a/{{cookiecutter.project_name}}/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.10.2) +cmake_minimum_required(VERSION 3.16.3) project({{ cookiecutter.module_name }}) set({{ cookiecutter.module_name }}_LIBRARIES {{ cookiecutter.module_name }}) From ad3c27213aa7bdf635bb62b1d00f25c5a89a31d0 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 18 Jan 2022 12:29:22 -0500 Subject: [PATCH 108/151] ENH: Update CI to build against ITK 5.3 RC 3 --- .github/workflows/build-test-package.yml | 16 ++++++++-------- .../.github/workflows/build-test-package.yml | 16 ++++++++-------- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 4c721d9..98904ad 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" steps: @@ -141,9 +141,9 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [36, 37, 38, 39] + python-version: [37, 38, 39, 310] include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -192,7 +192,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -239,9 +239,9 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [6, 7, 8, 9] + python-version-minor: [7, 8, 9, 10] include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index aafdd17..2086972 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -13,17 +13,17 @@ jobs: - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.2.1" + itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" steps: @@ -134,9 +134,9 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [36, 37, 38, 39] + python-version: [37, 38, 39, 310] include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -172,7 +172,7 @@ jobs: max-parallel: 2 matrix: include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -206,9 +206,9 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [6, 7, 8, 9] + python-version-minor: [7, 8, 9, 10] include: - - itk-python-git-tag: "v5.2.1.post1" + - itk-python-git-tag: "v5.3rc03" steps: - name: Get specific version of CMake, Ninja diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index daeec10..cb05a96 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.2.1.post1' + r'itk>=5.3rc3' ] ) From b254407bd7039b2f177487561c7c3f8887b67725 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 27 Jan 2022 16:38:28 -0500 Subject: [PATCH 109/151] ENH: Improve Github Actions badge to include target --- README.md | 6 +++++- {{cookiecutter.project_name}}/README.rst | 5 +++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index de5f5c5..86b7326 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,11 @@ ITKModuleTemplate ================= -![](https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/workflows/Build,%20test,%20package/badge.svg) +[![][gha-img]][gha-link] + +[gha-img]: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/workflows/build-test-package.yml/badge.svg) +[gha-link]: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/workflows/build-test-package.yml + Overview -------- diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst index 831a106..963429a 100644 --- a/{{cookiecutter.project_name}}/README.rst +++ b/{{cookiecutter.project_name}}/README.rst @@ -1,8 +1,9 @@ {{ cookiecutter.project_name }} ================================= -.. image:: {{ cookiecutter.download_url }}/workflows/Build,%20test,%20package/badge.svg - :alt: Build Status +.. image:: {{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml/badge.svg + :target: {{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml + :alt: Build Status .. image:: https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg :target: https://pypi.python.org/pypi/{{ cookiecutter.python_package_name }} From 3ba8f7f949c26604840772a05d60978e48585c9a Mon Sep 17 00:00:00 2001 From: Jean-Christophe Fillion-Robin Date: Thu, 27 Jan 2022 17:36:52 -0500 Subject: [PATCH 110/151] BUG: Fix rendering of badge in top-level README [ci skip] This commit fixes regression introduced in b254407 (ENH: Improve Github Actions badge to include target) removing extraneous parenthesis. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 86b7326..d974fcd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ ITKModuleTemplate [![][gha-img]][gha-link] -[gha-img]: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/workflows/build-test-package.yml/badge.svg) +[gha-img]: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/workflows/build-test-package.yml/badge.svg [gha-link]: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/workflows/build-test-package.yml From 043c8000af80c98f4286fac5420984319347cbc4 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 2 May 2022 16:08:46 -0400 Subject: [PATCH 111/151] ENH: Bump to ITK v5.3rc04 --- .github/workflows/build-test-package.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 98904ad..c8ef654 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -2,6 +2,10 @@ name: Build, test, package on: [push,pull_request] +env: + itk-git-tag: "801370c025c7d296783481779a41c6d559c992c5" + itk-wheel-tag: "v5.3rc04" + jobs: build-test-cxx: runs-on: ${{ matrix.os }} @@ -13,17 +17,14 @@ jobs: - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.3rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" steps: @@ -48,7 +49,7 @@ jobs: cd .. git clone https://github.com/InsightSoftwareConsortium/ITK.git cd ITK - git checkout ${{ matrix.itk-git-tag }} + git checkout ${{ env.itk-git-tag }} - name: Build ITK if: matrix.os != 'windows-2019' @@ -142,8 +143,6 @@ jobs: max-parallel: 2 matrix: python-version: [37, 38, 39, 310] - include: - - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -177,7 +176,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} - name: Publish Python package as GitHub Artifact @@ -190,9 +189,6 @@ jobs: runs-on: macos-10.15 strategy: max-parallel: 2 - matrix: - include: - - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -224,7 +220,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" - export ITK_PACKAGE_VERSION=${{ matrix.itk-python-git-tag }} + export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} export MACOSX_DEPLOYMENT_TARGET=10.9 ../../macpython-download-cache-and-build-module-wheels.sh @@ -240,8 +236,6 @@ jobs: max-parallel: 2 matrix: python-version-minor: [7, 8, 9, 10] - include: - - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -275,7 +269,7 @@ jobs: shell: bash run: | cd Evaluated/ITKModuleTemplate - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ matrix.itk-python-git-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" + curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ env.itk-wheel-tag }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r From ea6fcb10a21641f058f4d222a8a2dfa4a716b07d Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 2 May 2022 16:32:51 -0400 Subject: [PATCH 112/151] BUG: Fix Windows Python PATH string --- .github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index c8ef654..67b73a1 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -281,7 +281,7 @@ jobs: run: | cd Evaluated/ITKModuleTemplate call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH="C:\P\grep;%PATH%" + set PATH=C:\P\grep;%PATH% set CC=cl.exe set CXX=cl.exe C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" From a28936f0f30effcc13f19ac08bec232a864ecc1a Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Mon, 2 May 2022 19:52:36 -0400 Subject: [PATCH 113/151] ENH: Bump ITK cookiecutter version --- .../.github/workflows/build-test-package.yml | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 2086972..b9cdc9a 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -2,6 +2,10 @@ name: Build, test, package on: [push,pull_request] +env: + itk-git-tag: "801370c025c7d296783481779a41c6d559c992c5" + itk-wheel-tag: "v5.3rc04" + jobs: build-test-cxx: runs-on: ${{ "{{" }} matrix.os {{ "}}" }} @@ -13,17 +17,14 @@ jobs: - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" - itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" - os: windows-2019 c-compiler: "cl.exe" cxx-compiler: "cl.exe" - itk-git-tag: "v5.3rc03" cmake-build-type: "Release" - os: macos-10.15 c-compiler: "clang" cxx-compiler: "clang++" - itk-git-tag: "v5.3rc03" cmake-build-type: "MinSizeRel" steps: @@ -47,7 +48,7 @@ jobs: cd .. git clone https://github.com/InsightSoftwareConsortium/ITK.git cd ITK - git checkout ${{ "{{" }} matrix.itk-git-tag {{ "}}" }} + git checkout ${{ "{{" }} env.itk-git-tag {{ "}}" }} - name: Build ITK if: matrix.os != 'windows-2019' @@ -135,8 +136,6 @@ jobs: max-parallel: 2 matrix: python-version: [37, 38, 39, 310] - include: - - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -157,7 +156,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | - export ITK_PACKAGE_VERSION=${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }} + export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} - name: Publish Python package as GitHub Artifact @@ -170,9 +169,6 @@ jobs: runs-on: macos-10.15 strategy: max-parallel: 2 - matrix: - include: - - itk-python-git-tag: "v5.3rc03" steps: - uses: actions/checkout@v2 @@ -191,7 +187,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | - export ITK_PACKAGE_VERSION=${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }} + export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} export MACOSX_DEPLOYMENT_TARGET=10.9 ./macpython-download-cache-and-build-module-wheels.sh @@ -207,8 +203,6 @@ jobs: max-parallel: 2 matrix: python-version-minor: [7, 8, 9, 10] - include: - - itk-python-git-tag: "v5.3rc03" steps: - name: Get specific version of CMake, Ninja @@ -229,7 +223,7 @@ jobs: run: | mv im ../../ cd ../../im - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} matrix.itk-python-git-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" + curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} env.itk-wheel-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r From 09001ef0ad52b8e2b10fdad963ece804912babcd Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 17 May 2022 17:40:06 -0400 Subject: [PATCH 114/151] BUG: Fix CI Windows PATH quotes in template --- .../.github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index b9cdc9a..84a31c4 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -235,7 +235,7 @@ jobs: run: | cd ../../im call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH="C:\P\grep;%PATH%" + set PATH=C:\P\grep;%PATH% set CC=cl.exe set CXX=cl.exe C:\Python3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64" --no-cleanup From 2714c3951105c9c39fef7c4026d0c1ad550a5754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 31 May 2022 22:05:38 -0400 Subject: [PATCH 115/151] ENH: Use https instead of http when https works https is more tamper-resistant and more private so we use it instead of http when it is available. Following https://github.com/InsightSoftwareConsortium/ITK/pull/3428/commits/9cd0f2053f0cf181ec4412bf896301faf0cc2092 Bump the ITK commit hash so that the above changes are accepted by the ITK style checker. --- .github/workflows/build-test-package.yml | 2 +- README.md | 6 +++--- {{cookiecutter.project_name}}/.clang-format | 2 +- {{cookiecutter.project_name}}/.editorconfig | 2 +- .../.github/workflows/build-test-package.yml | 2 +- .../include/itkMinimalStandardRandomVariateGenerator.h | 4 ++-- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.hxx | 2 +- .../src/itkMinimalStandardRandomVariateGenerator.cxx | 2 +- .../test/itkMinimalStandardRandomVariateGeneratorTest.cxx | 2 +- .../test/itk{{cookiecutter.filter_name}}Test.cxx | 2 +- 11 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 67b73a1..3014e77 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,7 +3,7 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "801370c025c7d296783481779a41c6d559c992c5" + itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6" itk-wheel-tag: "v5.3rc04" jobs: diff --git a/README.md b/README.md index d974fcd..209df35 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ ITKModuleTemplate Overview -------- -This is a module for the [Insight Toolkit (ITK)](http://itk.org) for +This is a module for the [Insight Toolkit (ITK)](https://itk.org) for segmentation and registration. It is designed to work with the ITK modular system. @@ -88,7 +88,7 @@ associated repository, then add Remote Module ------------- -After an [Insight Journal](http://www.insight-journal.org/) article has +After an [Insight Journal](https://www.insight-journal.org/) article has been submitted, the module can be included in ITK as a [remote module](https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x55-1640009.7). Add a file in "ITK/Modules/Remote" called "YourModule.remote.cmake", for @@ -97,7 +97,7 @@ followlowing contents: itk_fetch_module(MyModule "A description of the a module." - GIT_REPOSITORY http://github.com/myuser/ITKMyModule.git + GIT_REPOSITORY https://github.com/myuser/ITKMyModule.git GIT_TAG abcdef012345 ) diff --git a/{{cookiecutter.project_name}}/.clang-format b/{{cookiecutter.project_name}}/.clang-format index 399e250..411b009 100644 --- a/{{cookiecutter.project_name}}/.clang-format +++ b/{{cookiecutter.project_name}}/.clang-format @@ -4,7 +4,7 @@ ## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option ## ## The clang-format binaries can be downloaded as part of the clang binary distributions -## from http://releases.llvm.org/download.html +## from https://releases.llvm.org/download.html ## ## Use the script Utilities/Maintenance/clang-format.bash to faciliate ## maintaining a consistent code style. diff --git a/{{cookiecutter.project_name}}/.editorconfig b/{{cookiecutter.project_name}}/.editorconfig index 7b95893..648b969 100644 --- a/{{cookiecutter.project_name}}/.editorconfig +++ b/{{cookiecutter.project_name}}/.editorconfig @@ -1,4 +1,4 @@ -# http://EditorConfig.org +# https://EditorConfig.org # top-most EditorConfig file root = true diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 84a31c4..932fe61 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -3,7 +3,7 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "801370c025c7d296783481779a41c6d559c992c5" + itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6" itk-wheel-tag: "v5.3rc04" jobs: diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 3c739ab..1ddea67 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -40,7 +40,7 @@ namespace Statistics * where \f$a\f$ is the Multiplier \f$c\f$ is the Increment and \f$m\f$ is * the Modulus. * - * http://en.wikipedia.com/wiki/Linear_congruential_generator + * https://en.wikipedia.com/wiki/Linear_congruential_generator * * The random numbers generated have a period \f$m\f$. * diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index 84d6b91..29959d2 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx index 6d1bfbd..0f1946a 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.hxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx index 6c5cc9d..a34635f 100644 --- a/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx +++ b/{{cookiecutter.project_name}}/src/itkMinimalStandardRandomVariateGenerator.cxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx index 3bb91a1..a7494a6 100644 --- a/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx +++ b/{{cookiecutter.project_name}}/test/itkMinimalStandardRandomVariateGeneratorTest.cxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx index 2b09141..7022a88 100644 --- a/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx +++ b/{{cookiecutter.project_name}}/test/itk{{cookiecutter.filter_name}}Test.cxx @@ -6,7 +6,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0.txt + * https://www.apache.org/licenses/LICENSE-2.0.txt * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, From ea1f17b7a0e0edfbae509c57fe35531e23ae33ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sat, 6 Aug 2022 10:00:07 -0400 Subject: [PATCH 116/151] ENH: Switch Github Actions macOS environment Switch Github Actions macOS environment version to `macos-11`. `macOS-10.15` is being deprecated and supported will end by 8/30/2022: https://github.com/actions/virtual-environments/issues/5583 Related to recent warnings in the Azure Pipelines macOS environment being used in the main ITK repository: https://github.com/InsightSoftwareConsortium/ITK/pull/3532/commits/e5595dee1917e94ecc3c7f94873841b0f522d3c0 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 3014e77..dafbbfe 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -12,7 +12,7 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] include: - os: ubuntu-20.04 c-compiler: "gcc" @@ -22,7 +22,7 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-10.15 + - os: macos-11 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" @@ -186,7 +186,7 @@ jobs: path: Evaluated/ITKModuleTemplate/dist build-macos-python-packages: - runs-on: macos-10.15 + runs-on: macos-11 strategy: max-parallel: 2 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 932fe61..f4fb183 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -12,7 +12,7 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-20.04, windows-2019, macos-10.15] + os: [ubuntu-20.04, windows-2019, macos-11] include: - os: ubuntu-20.04 c-compiler: "gcc" @@ -22,7 +22,7 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-10.15 + - os: macos-11 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" @@ -166,7 +166,7 @@ jobs: path: dist build-macos-python-packages: - runs-on: macos-10.15 + runs-on: macos-11 strategy: max-parallel: 2 From 77e4869722acf5590ce59274a0f56901d7850020 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 12 Aug 2022 14:29:13 -0400 Subject: [PATCH 117/151] ENH: Update for ITK 5.3 RC 4 --- .github/workflows/build-test-package.yml | 10 +++++++--- .../.github/workflows/build-test-package.yml | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index dafbbfe..c281848 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6" - itk-wheel-tag: "v5.3rc04" + itk-git-tag: "v5.3rc04" + itk-wheel-tag: "v5.3rc04.post2" jobs: build-test-cxx: @@ -177,7 +177,11 @@ jobs: run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + for tarball in "" "-manylinux2014"; do + rm -rf ITKPythonPackage + export TARBALL_SPECIALIZATION=${tarball} + ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} + done - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index f4fb183..3e1aaf7 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "d6acfd26bfcdec606d605beb1301bddfb17c05a6" - itk-wheel-tag: "v5.3rc04" + itk-git-tag: "v5.3rc04" + itk-wheel-tag: "v5.3rc04.post2" jobs: build-test-cxx: @@ -157,7 +157,11 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} + for tarball in "" "-manylinux2014"; do + rm -rf ITKPythonPackage + export TARBALL_SPECIALIZATION=${tarball} + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} + done - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 From 4fa5a47a5251e40bc374f09718f23c11257cfcb0 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Wed, 5 Oct 2022 15:51:54 -0400 Subject: [PATCH 118/151] ENH: Apply fixes for updated ITK v5.3rc04.post3 build config Updates: - Bumps ITK C++ and Python tags to v5.3rc04.post3 - Updates docker "_2_28" image - Updates XCode version used to build ITK MacOS archives --- .github/workflows/build-test-package.yml | 8 ++++---- .../.github/workflows/build-test-package.yml | 8 ++++---- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index c281848..2f0578b 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "v5.3rc04" - itk-wheel-tag: "v5.3rc04.post2" + itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8" + itk-wheel-tag: "v5.3rc04.post3" jobs: build-test-cxx: @@ -177,7 +177,7 @@ jobs: run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - for tarball in "" "-manylinux2014"; do + for tarball in "-manylinux_2_28" "-manylinux2014"; do rm -rf ITKPythonPackage export TARBALL_SPECIALIZATION=${tarball} ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} @@ -199,7 +199,7 @@ jobs: - name: 'Specific XCode version' run: | - sudo xcode-select -s "/Applications/Xcode_11.7.app" + sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 3e1aaf7..bd15cac 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "v5.3rc04" - itk-wheel-tag: "v5.3rc04.post2" + itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8" + itk-wheel-tag: "v5.3rc04.post3" jobs: build-test-cxx: @@ -157,7 +157,7 @@ jobs: - name: 'Build 🐍 Python 📦 package' run: | export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} - for tarball in "" "-manylinux2014"; do + for tarball in "-manylinux_2_28" "-manylinux2014"; do  rm -rf ITKPythonPackage  export TARBALL_SPECIALIZATION=${tarball} ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} @@ -179,7 +179,7 @@ jobs: - name: 'Specific XCode version' run: | - sudo xcode-select -s "/Applications/Xcode_11.7.app" + sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index cb05a96..c7df1a3 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.3rc3' + r'itk>=5.3rc04.post3' ] ) From 1c3c00a09d354dd23d88921f2a867756135b318a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Mon, 3 Oct 2022 17:54:47 -0400 Subject: [PATCH 119/151] BUG: Removing EF BF BC characters from build-test-package.yml --- .../.github/workflows/build-test-package.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index bd15cac..9d3ef50 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -158,10 +158,10 @@ jobs: run: | export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} for tarball in "-manylinux_2_28" "-manylinux2014"; do - rm -rf ITKPythonPackage - export TARBALL_SPECIALIZATION=${tarball} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} - done + rm -rf ITKPythonPackage + export TARBALL_SPECIALIZATION=${tarball} + ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} + done - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v1 From f4cd0289406cc2f0348441bd3670d95173f6ef16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 28 Oct 2022 19:11:32 -0400 Subject: [PATCH 120/151] ENH: Specify the same CMake version for Linux Python package builds As Linux comes with some version of CMake, this problem sneaked in without detection. If CMake version is important, this difference between version on different OSes can be confusing. --- .github/workflows/build-test-package.yml | 3 +++ .../.github/workflows/build-test-package.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2f0578b..36e9854 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -161,6 +161,9 @@ jobs: with: python-version: 3.8 + - name: Get specific version of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: Evaluate template shell: bash run: | diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 9d3ef50..7264510 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -149,6 +149,9 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" df -h + - name: Get specific version of CMake, Ninja + uses: lukka/get-cmake@v3.18.3 + - name: 'Fetch build script' run: | curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O From c8c6771ce33c62d9de5c089bca4ed4c23f4bef27 Mon Sep 17 00:00:00 2001 From: Lee Newberg Date: Wed, 2 Nov 2022 13:55:06 -0400 Subject: [PATCH 121/151] ENH: Versions as strings, not numbers, so that 3.1 != 3.10, etc. --- .github/workflows/build-test-package.yml | 12 ++++++------ .../.github/workflows/build-test-package.yml | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 36e9854..3f08f60 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.8" - name: Install build dependencies run: | @@ -142,7 +142,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [37, 38, 39, 310] + python-version: ["37", "38", "39", "310"] steps: - uses: actions/checkout@v2 @@ -159,7 +159,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.8" - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.18.3 @@ -215,7 +215,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.8" - name: Evaluate template shell: bash @@ -242,7 +242,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [7, 8, 9, 10] + python-version-minor: ["7", "8", "9", "10"] steps: - uses: actions/checkout@v2 @@ -263,7 +263,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.8" - name: Evaluate template shell: bash diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 7264510..bf43250 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -33,7 +33,7 @@ jobs: - name: Set up Python 3.8 uses: actions/setup-python@v2 with: - python-version: 3.8 + python-version: "3.8" - name: Install build dependencies run: | @@ -135,7 +135,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: [37, 38, 39, 310] + python-version: ["37", "38", "39", "310"] steps: - uses: actions/checkout@v2 @@ -209,7 +209,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: [7, 8, 9, 10] + python-version-minor: ["7", "8", "9", "10"] steps: - name: Get specific version of CMake, Ninja From cac5a4d822b939b90acd167372ae08b016352030 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Fri, 18 Nov 2022 09:12:11 -0500 Subject: [PATCH 122/151] ENH: Bump ITK workflows for v5.3rc04.post4. Updates cookiecutter CI workflow to rely on ITKRemoteModuleBuildTestPackageAction reusable workflows for easier maintenance. Updates ITK reference to v5.3rc04.post4 and applies version updates from reusable workflow. See https://github.com/InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/pull/9 --- .github/workflows/build-test-package.yml | 36 ++- .../.github/workflows/build-test-package.yml | 282 +----------------- 2 files changed, 27 insertions(+), 291 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 3f08f60..3ea2604 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8" - itk-wheel-tag: "v5.3rc04.post3" + itk-git-tag: "abf5fa10522a36bc51f42f20f426a622f42ed90d" + itk-wheel-tag: "v5.3rc04.post4" jobs: build-test-cxx: @@ -12,13 +12,13 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + os: [ubuntu-20.04, windows-2022, macos-11] include: - os: ubuntu-20.04 c-compiler: "gcc" cxx-compiler: "g++" cmake-build-type: "MinSizeRel" - - os: windows-2019 + - os: windows-2022 c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" @@ -42,7 +42,7 @@ jobs: python -m pip install cookiecutter - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 + uses: lukka/get-cmake@v3.22.2 - name: Download ITK run: | @@ -52,7 +52,7 @@ jobs: git checkout ${{ env.itk-git-tag }} - name: Build ITK - if: matrix.os != 'windows-2019' + if: matrix.os != 'windows-2022' run: | cd .. mkdir ITK-build @@ -61,12 +61,12 @@ jobs: ninja - name: Build ITK - if: matrix.os == 'windows-2019' + if: matrix.os == 'windows-2022' run: | cd .. mkdir ITK-build cd ITK-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK ninja shell: cmd @@ -126,14 +126,14 @@ jobs: cat dashboard.cmake - name: Build and test - if: matrix.os != 'windows-2019' + if: matrix.os != 'windows-2022' run: | ctest --output-on-failure -j 2 -V -S dashboard.cmake - name: Build and test - if: matrix.os == 'windows-2019' + if: matrix.os == 'windows-2022' run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" ctest --output-on-failure -j 2 -V -S dashboard.cmake shell: cmd @@ -142,7 +142,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: ["37", "38", "39", "310"] + python-version: ["37", "38", "39", "310", "311"] steps: - uses: actions/checkout@v2 @@ -156,6 +156,12 @@ jobs: sudo rm -rf "$AGENT_TOOLSDIRECTORY" df -h + - name: 'Fetch build dependencies' + shell: bash + run: | + sudo apt install zstd + unzstd --version + - name: Set up Python 3.8 uses: actions/setup-python@v2 with: @@ -238,11 +244,11 @@ jobs: path: Evaluated/ITKModuleTemplate/dist build-windows-python-packages: - runs-on: windows-2019 + runs-on: windows-2022 strategy: max-parallel: 2 matrix: - python-version-minor: ["7", "8", "9", "10"] + python-version-minor: ["7", "8", "9", "10", "11"] steps: - uses: actions/checkout@v2 @@ -287,7 +293,7 @@ jobs: shell: cmd run: | cd Evaluated/ITKModuleTemplate - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" set PATH=C:\P\grep;%PATH% set CC=cl.exe set CXX=cl.exe diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index bf43250..207460b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -2,281 +2,11 @@ name: Build, test, package on: [push,pull_request] -env: - itk-git-tag: "171fb2ba33a87041f99328a2f26612ff33aa9cc8" - itk-wheel-tag: "v5.3rc04.post3" - jobs: - build-test-cxx: - runs-on: ${{ "{{" }} matrix.os {{ "}}" }} - strategy: - max-parallel: 3 - matrix: - os: [ubuntu-20.04, windows-2019, macos-11] - include: - - os: ubuntu-20.04 - c-compiler: "gcc" - cxx-compiler: "g++" - cmake-build-type: "MinSizeRel" - - os: windows-2019 - c-compiler: "cl.exe" - cxx-compiler: "cl.exe" - cmake-build-type: "Release" - - os: macos-11 - c-compiler: "clang" - cxx-compiler: "clang++" - cmake-build-type: "MinSizeRel" - - steps: - - uses: actions/checkout@v2 - - - name: Set up Python 3.8 - uses: actions/setup-python@v2 - with: - python-version: "3.8" - - - name: Install build dependencies - run: | - python -m pip install --upgrade pip - python -m pip install ninja - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - name: Download ITK - run: | - cd .. - git clone https://github.com/InsightSoftwareConsortium/ITK.git - cd ITK - git checkout ${{ "{{" }} env.itk-git-tag {{ "}}" }} - - - name: Build ITK - if: matrix.os != 'windows-2019' - run: | - cd .. - mkdir ITK-build - cd ITK-build - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ "{{" }} matrix.c-compiler {{ "}}" }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ "{{" }} matrix.cxx-compiler {{ "}}" }}" -DCMAKE_BUILD_TYPE:STRING=${{ "{{" }} matrix.cmake-build-type {{ "}}" }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK - ninja - - - name: Build ITK - if: matrix.os == 'windows-2019' - run: | - cd .. - mkdir ITK-build - cd ITK-build - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - cmake -DCMAKE_C_COMPILER:FILEPATH="${{ "{{" }} matrix.c-compiler {{ "}}" }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ "{{" }} matrix.cxx-compiler {{ "}}" }}" -DCMAKE_BUILD_TYPE:STRING=${{ "{{" }} matrix.cmake-build-type {{ "}}" }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK - ninja - shell: cmd - - - name: Fetch CTest driver script - run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITK/dashboard/itk_common.cmake -O - - - name: Configure CTest script - shell: bash - run: | - operating_system="${{ "{{" }} matrix.os {{ "}}" }}" - cat > dashboard.cmake << EOF - set(CTEST_SITE "GitHubActions") - file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/.." CTEST_DASHBOARD_ROOT) - file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/" CTEST_SOURCE_DIRECTORY) - file(TO_CMAKE_PATH "\$ENV{GITHUB_WORKSPACE}/../build" CTEST_BINARY_DIRECTORY) - set(dashboard_source_name "${GITHUB_REPOSITORY}") - if(ENV{GITHUB_REF} MATCHES "main") - set(branch "-main") - set(dashboard_model "Continuous") - else() - set(branch "-${GITHUB_REF}") - set(dashboard_model "Experimental") - endif() - set(CTEST_BUILD_NAME "${GITHUB_REPOSITORY}-${operating_system}-\${branch}") - set(CTEST_UPDATE_VERSION_ONLY 1) - set(CTEST_TEST_ARGS \${CTEST_TEST_ARGS} PARALLEL_LEVEL \${PARALLEL_LEVEL}) - set(CTEST_BUILD_CONFIGURATION "Release") - set(CTEST_CMAKE_GENERATOR "Ninja") - set(CTEST_CUSTOM_WARNING_EXCEPTION - \${CTEST_CUSTOM_WARNING_EXCEPTION} - # macOS Azure VM Warning - "ld: warning: text-based stub file" - ) - set(dashboard_no_clean 1) - set(ENV{CC} ${{ "{{" }} matrix.c-compiler {{ "}}" }}) - set(ENV{CXX} ${{ "{{" }} matrix.cxx-compiler {{ "}}" }}) - if(WIN32) - set(ENV{PATH} "\${CTEST_DASHBOARD_ROOT}/ITK-build/bin;\$ENV{PATH}") - endif() - set(dashboard_cache " - ITK_DIR:PATH=\${CTEST_DASHBOARD_ROOT}/ITK-build - BUILD_TESTING:BOOL=ON - ") - string(TIMESTAMP build_date "%Y-%m-%d") - message("CDash Build Identifier: \${build_date} \${CTEST_BUILD_NAME}") - message("CTEST_SITE = \${CTEST_SITE}") - include(\${CTEST_SCRIPT_DIRECTORY}/itk_common.cmake) - EOF - cat dashboard.cmake - - - name: Build and test - if: matrix.os != 'windows-2019' - run: | - ctest --output-on-failure -j 2 -V -S dashboard.cmake - - - name: Build and test - if: matrix.os == 'windows-2019' - run: | - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - ctest --output-on-failure -j 2 -V -S dashboard.cmake - shell: cmd - - build-linux-python-packages: - runs-on: ubuntu-20.04 - strategy: - max-parallel: 2 - matrix: - python-version: ["37", "38", "39", "310"] - - steps: - - uses: actions/checkout@v2 - - - name: 'Free up disk space' - run: | - # Workaround for https://github.com/actions/virtual-environments/issues/709 - df -h - sudo apt-get clean - sudo rm -rf "/usr/local/share/boost" - sudo rm -rf "$AGENT_TOOLSDIRECTORY" - df -h - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - name: 'Fetch build script' - run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O - chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - - - name: 'Build 🐍 Python 📦 package' - run: | - export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} - for tarball in "-manylinux_2_28" "-manylinux2014"; do - rm -rf ITKPythonPackage - export TARBALL_SPECIALIZATION=${tarball} - ./dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ "{{" }} matrix.python-version {{ "}}" }} - done - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: LinuxWheel${{ "{{" }} matrix.python-version {{ "}}" }} - path: dist - - build-macos-python-packages: - runs-on: macos-11 - strategy: - max-parallel: 2 - - steps: - - uses: actions/checkout@v2 - - - name: 'Specific XCode version' - run: | - sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - name: 'Fetch build script' - run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/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' - run: | - export ITK_PACKAGE_VERSION=${{ "{{" }} env.itk-wheel-tag {{ "}}" }} - export MACOSX_DEPLOYMENT_TARGET=10.9 - ./macpython-download-cache-and-build-module-wheels.sh - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: MacOSWheels - path: dist - - build-windows-python-packages: - runs-on: windows-2019 - strategy: - max-parallel: 2 - matrix: - python-version-minor: ["7", "8", "9", "10"] - - steps: - - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 - - - uses: actions/checkout@v2 - with: - path: "im" - - - name: 'Install Python' - run: | - $pythonArch = "64" - $pythonVersion = "3.${{ "{{" }} matrix.python-version-minor {{ "}}" }}" - iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - - name: 'Fetch build dependencies' - shell: bash - run: | - mv im ../../ - cd ../../im - curl -L "https://github.com/InsightSoftwareConsortium/ITKPythonBuilds/releases/download/${{ "{{" }} env.itk-wheel-tag {{ "}}" }}/ITKPythonBuilds-windows.zip" -o "ITKPythonBuilds-windows.zip" - 7z x ITKPythonBuilds-windows.zip -o/c/P -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5c0ad59d8d777f2179dd3e9c/download" -o "doxygen-1.8.11.windows.bin.zip" - 7z x doxygen-1.8.11.windows.bin.zip -o/c/P/doxygen -aoa -r - curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" - 7z x grep-win.zip -o/c/P/grep -aoa -r - - - name: 'Build 🐍 Python 📦 package' - shell: cmd - run: | - cd ../../im - call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\VC\Auxiliary\Build\vcvars64.bat" - set PATH=C:\P\grep;%PATH% - set CC=cl.exe - set CXX=cl.exe - C:\Python3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ "{{" }} matrix.python-version-minor {{ "}}" }}-x64" --no-cleanup - - - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 - with: - name: WindowsWheel3.${{ "{{" }} matrix.python-version-minor {{ "}}" }} - path: ../../im/dist - - publish-python-packages-to-pypi: - needs: - - build-linux-python-packages - - build-macos-python-packages - - build-windows-python-packages - runs-on: ubuntu-20.04 - - steps: - - name: Download Python Packages - uses: actions/download-artifact@v2 - - - name: Prepare packages for upload - run: | - ls -R - for d in */; do - mv ${d}/*.whl . - done - mkdir dist - mv *.whl dist/ - ls dist + cxx-build-workflow: + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.3rc04.post4 - - name: Publish 🐍 Python 📦 package to PyPI - if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') - uses: pypa/gh-action-pypi-publish@master - with: - user: __token__ - password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} + python-build-workflow: + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.3rc04.post4 + secrets: + pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} From d30c9e212070e2e20e0fa979f3803d354aec97ba Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Tue, 29 Nov 2022 09:08:09 -0500 Subject: [PATCH 123/151] ENH: Bump to v5.3.0 --- .github/workflows/build-test-package.yml | 20 ++++++++++++++----- .../.github/workflows/build-test-package.yml | 4 ++-- 2 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 3ea2604..7192907 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,8 +3,8 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "abf5fa10522a36bc51f42f20f426a622f42ed90d" - itk-wheel-tag: "v5.3rc04.post4" + itk-git-tag: "v5.3.0" + itk-wheel-tag: "v5.3.0" jobs: build-test-cxx: @@ -168,7 +168,7 @@ jobs: python-version: "3.8" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 + uses: lukka/get-cmake@v3.22.2 - name: Evaluate template shell: bash @@ -211,7 +211,7 @@ jobs: sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 + uses: lukka/get-cmake@v3.22.2 - name: 'Fetch build script' run: | @@ -264,7 +264,7 @@ jobs: python-version: '3.x' - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.18.3 + uses: lukka/get-cmake@v3.22.2 - name: Set up Python 3.8 uses: actions/setup-python@v2 @@ -289,6 +289,16 @@ jobs: curl -L "https://data.kitware.com/api/v1/file/5bbf87ba8d777f06b91f27d6/download/grep-win.zip" -o "grep-win.zip" 7z x grep-win.zip -o/c/P/grep -aoa -r + # Update step for skbuild issue in v5.3.0 build archive + ITK_PYTHON_PACKAGE_TAG=0f5effc39afbf7cb1ac5ab20faa0996ddb12b34d + echo "Updating ITKPythonPackage build scripts to ${ITK_PYTHON_PACKAGE_TAG}" + pushd /c/P/IPP + git remote add InsightSoftwareConsortium https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git --tags + git fetch InsightSoftwareConsortium + git checkout ${ITK_PYTHON_PACKAGE_TAG} + git status + popd + - name: 'Build 🐍 Python 📦 package' shell: cmd run: | diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 207460b..98cb668 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,9 +4,9 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.3rc04.post4 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.3.0 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.3rc04.post4 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.3.0 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} From 664dc2d9f3af4c9a0837bd2dd818ac64a9203b18 Mon Sep 17 00:00:00 2001 From: Tom Birdsong Date: Thu, 1 Dec 2022 08:36:40 -0500 Subject: [PATCH 124/151] ENH: Bump for ITK v5.3 --- .github/workflows/build-test-package.yml | 17 ++++++++++------- .../.github/workflows/build-test-package.yml | 4 ++-- {{cookiecutter.project_name}}/setup.py | 2 +- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 7192907..fa36f4b 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -5,6 +5,7 @@ on: [push,pull_request] env: itk-git-tag: "v5.3.0" itk-wheel-tag: "v5.3.0" + itk-python-package-tag: "03391ad738438661fff40bfe37a7cfabd171b9b1" jobs: build-test-cxx: @@ -179,16 +180,18 @@ jobs: - name: 'Fetch build script' run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-python-package-tag }}/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh -O chmod u+x dockcross-manylinux-download-cache-and-build-module-wheels.sh - name: 'Build 🐍 Python 📦 package' run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} - for tarball in "-manylinux_2_28" "-manylinux2014"; do + export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} + for manylinux_version in "_2_28" "2014"; do rm -rf ITKPythonPackage - export TARBALL_SPECIALIZATION=${tarball} + export MANYLINUX_VERSION=${manylinux_version} + echo "Building for manylinux specialization ${MANYLINUX_VERSION}" ../../dockcross-manylinux-download-cache-and-build-module-wheels.sh cp${{ matrix.python-version }} done @@ -215,7 +218,7 @@ jobs: - name: 'Fetch build script' run: | - curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/master/scripts/macpython-download-cache-and-build-module-wheels.sh -O + curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-python-package-tag }}/scripts/macpython-download-cache-and-build-module-wheels.sh -O chmod u+x macpython-download-cache-and-build-module-wheels.sh - name: Set up Python 3.8 @@ -234,6 +237,7 @@ jobs: run: | cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} + export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} export MACOSX_DEPLOYMENT_TARGET=10.9 ../../macpython-download-cache-and-build-module-wheels.sh @@ -290,12 +294,11 @@ jobs: 7z x grep-win.zip -o/c/P/grep -aoa -r # Update step for skbuild issue in v5.3.0 build archive - ITK_PYTHON_PACKAGE_TAG=0f5effc39afbf7cb1ac5ab20faa0996ddb12b34d - echo "Updating ITKPythonPackage build scripts to ${ITK_PYTHON_PACKAGE_TAG}" + echo "Updating ITKPythonPackage build scripts to ${{ env.itk-python-package-tag }}" pushd /c/P/IPP git remote add InsightSoftwareConsortium https://github.com/InsightSoftwareConsortium/ITKPythonPackage.git --tags git fetch InsightSoftwareConsortium - git checkout ${ITK_PYTHON_PACKAGE_TAG} + git checkout ${{ env.itk-python-package-tag }} git status popd diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 98cb668..0ff33c2 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,9 +4,9 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.3.0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@5083da2740617b78423ebf6083489e1e70ee8ca0 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.3.0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@5083da2740617b78423ebf6083489e1e70ee8ca0 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py index c7df1a3..48d1e97 100644 --- a/{{cookiecutter.project_name}}/setup.py +++ b/{{cookiecutter.project_name}}/setup.py @@ -43,6 +43,6 @@ keywords='ITK InsightToolkit', url=r'https://itk.org/', install_requires=[ - r'itk>=5.3rc04.post3' + r'itk>=5.3.0' ] ) From 2c1a717e3ab25ddb9d96cb7ea510bc7e0b0f9771 Mon Sep 17 00:00:00 2001 From: Bryn Lloyd Date: Fri, 2 Dec 2022 19:41:13 +0100 Subject: [PATCH 125/151] ENH: Upgrade GitHub actions to `checkout@v3` and `setup-python@v3` Fix `Node.js` warnings linked to GitHub actions: upgrade to `actions/checkout@v3` and `actions/setup-python@v3`. Fixes: ``` cov / build (3.9, ubuntu-latest, pip) Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: actions/checkout@v2, actions/setup-python@v2 ``` raised for example in: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/runs/3594726041 --- .github/workflows/build-test-package.yml | 18 +++++++++--------- .github/workflows/clang-format-linter.yml | 2 +- .../.github/workflows/clang-format-linter.yml | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index fa36f4b..dff4ee7 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -29,10 +29,10 @@ jobs: cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.8" @@ -146,7 +146,7 @@ jobs: python-version: ["37", "38", "39", "310", "311"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: 'Free up disk space' run: | @@ -164,7 +164,7 @@ jobs: unzstd --version - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.8" @@ -207,7 +207,7 @@ jobs: max-parallel: 2 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: 'Specific XCode version' run: | @@ -222,7 +222,7 @@ jobs: chmod u+x macpython-download-cache-and-build-module-wheels.sh - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.8" @@ -255,7 +255,7 @@ jobs: python-version-minor: ["7", "8", "9", "10", "11"] steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: 'Install Python' run: | @@ -263,7 +263,7 @@ jobs: $pythonVersion = "3.${{ matrix.python-version-minor }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - uses: actions/setup-python@v2 + - uses: actions/setup-python@v3 with: python-version: '3.x' @@ -271,7 +271,7 @@ jobs: uses: lukka/get-cmake@v3.22.2 - name: Set up Python 3.8 - uses: actions/setup-python@v2 + uses: actions/setup-python@v3 with: python-version: "3.8" diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index c59dd58..899d579 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master diff --git a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml index c59dd58..899d579 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v3 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master From 0a812824143160d677268689fdb97b94a53033b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 3 Jan 2023 19:21:28 -0500 Subject: [PATCH 126/151] ENH: Fix workflow actions warnings linked to `Node.js` Fix workflow actions warnings linked to `Node.js: bump miscellaneous GitHub actions versions in workflow. Fixes: ``` build-test-cxx (windows-2022) Node.js 12 actions are deprecated. For more information see: https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/. Please update the following actions to use Node.js 16: lukka/get-cmake@v3.22.2 ``` and ``` build-test-cxx (windows-2022) The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ ``` raised for example in: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/runs/3669019278 Left behind in 2c1a717. --- .github/workflows/build-test-package.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index dff4ee7..167e86a 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v3 - name: Set up Python 3.8 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.8" @@ -43,7 +43,7 @@ jobs: python -m pip install cookiecutter - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 + uses: lukka/get-cmake@v3.24.2 - name: Download ITK run: | @@ -164,12 +164,12 @@ jobs: unzstd --version - name: Set up Python 3.8 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.8" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 + uses: lukka/get-cmake@v3.24.2 - name: Evaluate template shell: bash @@ -196,7 +196,7 @@ jobs: done - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: LinuxWheel${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist @@ -214,7 +214,7 @@ jobs: sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 + uses: lukka/get-cmake@v3.24.2 - name: 'Fetch build script' run: | @@ -222,7 +222,7 @@ jobs: chmod u+x macpython-download-cache-and-build-module-wheels.sh - name: Set up Python 3.8 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.8" @@ -242,7 +242,7 @@ jobs: ../../macpython-download-cache-and-build-module-wheels.sh - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: MacOSWheels path: Evaluated/ITKModuleTemplate/dist @@ -263,15 +263,15 @@ jobs: $pythonVersion = "3.${{ matrix.python-version-minor }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - uses: actions/setup-python@v3 + - uses: actions/setup-python@v4 with: python-version: '3.x' - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.22.2 + uses: lukka/get-cmake@v3.24.2 - name: Set up Python 3.8 - uses: actions/setup-python@v3 + uses: actions/setup-python@v4 with: python-version: "3.8" @@ -313,7 +313,7 @@ jobs: C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v1 + uses: actions/upload-artifact@v3 with: name: WindowWheel3.${{ matrix.python-version-minor }} path: Evaluated/ITKModuleTemplate/dist From a010a7b9bf593a82973dd150fb113f9fdcf7625e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 12 Nov 2023 15:55:54 -0500 Subject: [PATCH 127/151] ENH: Specify Python versions for macOS CI builds Specify Python versions for macOS CI builds. --- .github/workflows/build-test-package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 167e86a..c2b8cf6 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -205,6 +205,8 @@ jobs: runs-on: macos-11 strategy: max-parallel: 2 + matrix: + python-version: ["38", "39", "310", "311"] steps: - uses: actions/checkout@v3 From 70090f8faaec581d8ea7739e75b4dcb339d57de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 12 Nov 2023 16:06:19 -0500 Subject: [PATCH 128/151] ENH: Drop Python 3.7 from CI build matrices Drop Python 3.7 from CI build matrices: Python 3.7 reached its EOL on 2023-06-27. --- .github/workflows/build-test-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 167e86a..65690ec 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -143,7 +143,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: ["37", "38", "39", "310", "311"] + python-version: ["38", "39", "310", "311"] steps: - uses: actions/checkout@v3 @@ -252,7 +252,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: ["7", "8", "9", "10", "11"] + python-version-minor: ["8", "9", "10", "11"] steps: - uses: actions/checkout@v3 From c3fbcc91309a4abc66cee2934c45e1d4e9cb2427 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Tue, 9 Jan 2024 11:53:37 -0500 Subject: [PATCH 129/151] COMP: Update version of the GitHub action to 2023-11-13 Update to Nov 13, 2023 version of the GitHub action for remote modules. --- .../.github/workflows/build-test-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 0ff33c2..a2ae621 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,9 +4,9 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@5083da2740617b78423ebf6083489e1e70ee8ca0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@246883ef3828fc00219145aeec9efa67b9889d0b python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@5083da2740617b78423ebf6083489e1e70ee8ca0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@246883ef3828fc00219145aeec9efa67b9889d0b secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} From 1257b253375236ffa8806a41ce50115bf808b7a3 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 19 Apr 2024 06:40:47 -0400 Subject: [PATCH 130/151] ENH: Migrate to scikit-build-core, pyproject.toml scikit-build-core offers a declarative, convenient build configuration based on modern Python packaging standards. Other advantages include support for the Stable ABI. --- {{cookiecutter.project_name}}/pyproject.toml | 108 +++++++++++++++++++ {{cookiecutter.project_name}}/setup.py | 48 --------- 2 files changed, 108 insertions(+), 48 deletions(-) create mode 100644 {{cookiecutter.project_name}}/pyproject.toml delete mode 100644 {{cookiecutter.project_name}}/setup.py diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml new file mode 100644 index 0000000..622f8e5 --- /dev/null +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -0,0 +1,108 @@ +[build-system] +requires = ["scikit-build-core"] +build-backend = "scikit_build_core.build" + +[project] +name = "{{ cookiecutter.python_package_name }}" +version = "0.1.0" +description = "{{ cookiecutter.project_short_description }}" +readme = "README.rst" +license = {file = "LICENSE"} +authors = [ + { name = "{{ cookiecutter.full_name }}", email = "{{ cookiecutter.email }}" }, +] +keywords = [ + "itk", +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Education", + "Intended Audience :: Healthcare Industry", + "Intended Audience :: Science/Research", + "License :: OSI Approved :: Apache Software License", + "Operating System :: Android", + "Operating System :: MacOS", + "Operating System :: Microsoft :: Windows", + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: C++", + "Programming Language :: Python", + "Topic :: Scientific/Engineering", + "Topic :: Scientific/Engineering :: Information Analysis", + "Topic :: Scientific/Engineering :: Medical Science Apps.", + "Topic :: Software Development :: Libraries", +] +requires-python = ">=3.8" +dependencies = [ + "itk>=5.4rc4", +] + +[project.urls] +Download = "{{ cookiecutter.download_url }}" +Homepage = "{{ cookiecutter.download_url }}" + +[tool.scikit-build] +# The versions of CMake to allow. If CMake is not present on the system or does +# not pass this specifier, it will be downloaded via PyPI if possible. An empty +# string will disable this check. +cmake.version = ">=3.16.3" + +# A list of args to pass to CMake when configuring the project. Setting this in +# config or envvar will override toml. See also ``cmake.define``. +cmake.args = [] + +# A table of defines to pass to CMake when configuring the project. Additive. +cmake.define = {} + +# Verbose printout when building. +cmake.verbose = true + +# The build type to use when building the project. Valid options are: "Debug", +# "Release", "RelWithDebInfo", "MinSizeRel", "", etc. +cmake.build-type = "Release" + +# The source directory to use when building the project. Currently only affects +# the native builder (not the setuptools plugin). +cmake.source-dir = "." + +# The versions of Ninja to allow. If Ninja is not present on the system or does +# not pass this specifier, it will be downloaded via PyPI if possible. An empty +# string will disable this check. +ninja.version = ">=1.11" + +# The logging level to display, "DEBUG", "INFO", "WARNING", and "ERROR" are +# possible options. +logging.level = "INFO" + +# Files to include in the SDist even if they are skipped by default. Supports +# gitignore syntax. +sdist.include = [] + +# Files to exclude from the SDist even if they are included by default. Supports +# gitignore syntax. +sdist.exclude = [] + +# A list of license files to include in the wheel. Supports glob patterns. +wheel.license-files = ["LICEN[CS]E*",] + +# Target the platlib or the purelib. If not set, the default is to target the +# platlib if wheel.cmake is true, and the purelib otherwise. +wheel.platlib = "false" + +# If CMake is less than this value, backport a copy of FindPython. Set to 0 +# disable this, or the empty string. +backport.find-python = "3.26.1" + +# Select the editable mode to use. Can be "redirect" (default) or "inplace". +editable.mode = "redirect" + +# Rebuild the project when the package is imported. The build-directory must be +# set. +editable.rebuild = false + +# If set, this will provide a method for scikit-build-core backward compatibility. +minimum-version = "0.8.2" + +# The build directory. Defaults to a temporary directory, but can be set. +build-dir = "build/{wheel_tag}" diff --git a/{{cookiecutter.project_name}}/setup.py b/{{cookiecutter.project_name}}/setup.py deleted file mode 100644 index 48d1e97..0000000 --- a/{{cookiecutter.project_name}}/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -# -*- coding: utf-8 -*- -from os import sys - -try: - from skbuild import setup -except ImportError: - print('scikit-build is required to build from source.', file=sys.stderr) - print('Please run:', file=sys.stderr) - print('', file=sys.stderr) - print(' python -m pip install scikit-build') - sys.exit(1) - -setup( - name='{{ cookiecutter.python_package_name }}', - version='0.1.0', - author='{{ cookiecutter.full_name }}', - author_email='{{ cookiecutter.email }}', - packages=['itk'], - package_dir={'itk': 'itk'}, - download_url=r'{{ cookiecutter.download_url }}', - description=r'{{ cookiecutter.project_short_description }}', - long_description='{{ cookiecutter.project_long_description }}', - classifiers=[ - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python", - "Programming Language :: C++", - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Intended Audience :: Education", - "Intended Audience :: Healthcare Industry", - "Intended Audience :: Science/Research", - "Topic :: Scientific/Engineering", - "Topic :: Scientific/Engineering :: Medical Science Apps.", - "Topic :: Scientific/Engineering :: Information Analysis", - "Topic :: Software Development :: Libraries", - "Operating System :: Android", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Operating System :: Unix", - "Operating System :: MacOS" - ], - license='Apache', - keywords='ITK InsightToolkit', - url=r'https://itk.org/', - install_requires=[ - r'itk>=5.3.0' - ] - ) From f07383c97d2fbf895dbfe01a3e01e776f7c65922 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 19 Apr 2024 06:55:16 -0400 Subject: [PATCH 131/151] DOC: Add note on scikit-build-core migration How and why to migrate. --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 209df35..beb51f3 100644 --- a/README.md +++ b/README.md @@ -111,6 +111,19 @@ Python packages for Linux, macOS, and Windows. These packages can be and [uploaded to the Python Package Index (PyPI)](https://itkpythonpackage.readthedocs.io/en/master/Build_ITK_Module_Python_packages.html#upload-the-packages-to-pypi). +pyproject.toml +-------------- + +ITK 5.4 added support for [scikit-build-core](https://scikit-build-core.readthedocs.io/en/latest/), +an update to scikit-build classic that supports [PEP +517](https://peps.python.org/pep-0517/) and other modern Python packaging +standards configured in the declarative *pyproject.toml* file. While the +*setup.py* file is still supported in ITK 5.4, migration to *pyproject.toml* +is encouraged. One important advantage is the generation of Stable ABI wheels +for Python 3.11+; these packages work with Python 3.11, 3.12, +3.13, 3.14, etc. To migrate to scikit-build-core, use the pyproject.toml +template in this repository and remove the *setup.py* file. + ITKv4 Branch ------------ From e2c165da31d0e382b4e79ee03f64b2c572d51f73 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 19 Apr 2024 07:03:21 -0400 Subject: [PATCH 132/151] DOC: Point CI documentation to ITKRemoteModuleBuildTestPackageAction Redirect further information to its repository README, which is extremely well documented. --- README.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index beb51f3..9113dd7 100644 --- a/README.md +++ b/README.md @@ -71,9 +71,9 @@ documentation, and Python package documentation. The output of the cookiecutter is a buildable ITK external module with example classes. Remove or replace the classes with your new classes. -Push your new module to GitHub, and enable builds on -[CircleCI](https://circleci.com/), [TravisCI](https://travis-ci.org/), -and [AppVeyor](https://www.appveyor.com/). +Push your new module to GitHub. Cross-platform C++ testing and Python +packaging is provided via the [ITKRemoteModuleBuildTestPackageAction] +reusable GitHub Action. Documentation on [how to populate the module](https://itk.org/ITKSoftwareGuide/html/Book1/ITKSoftwareGuide-Book1ch9.html#x50-1430009) @@ -106,13 +106,11 @@ CI Testing and Python Packages Continuous integration service configurations are included to build and test the C++ core of packages across platforms and build binary -Python packages for Linux, macOS, and Windows. These packages can be -[downloaded](https://itkpythonpackage.readthedocs.io/en/master/Build_ITK_Module_Python_packages.html#github-automated-ci-package-builds) -and [uploaded to the Python Package Index -(PyPI)](https://itkpythonpackage.readthedocs.io/en/master/Build_ITK_Module_Python_packages.html#upload-the-packages-to-pypi). +Python packages for Linux, macOS, and Windows. For more information, see +the [ITKRemoteModuleBuildTestPackageAction] documentation. -pyproject.toml --------------- +pyproject.toml migration +------------------------ ITK 5.4 added support for [scikit-build-core](https://scikit-build-core.readthedocs.io/en/latest/), an update to scikit-build classic that supports [PEP @@ -147,3 +145,5 @@ Authors - Bradley Lowekamp - Matt McCormick - Jean-Baptiste VIMORT + +[ITKRemoteModuleBuildTestPackageAction]: https://github.com/InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction From d4afa39ba2c871d75ad1d96b1e43e004d6dbad89 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 19 Apr 2024 07:10:28 -0400 Subject: [PATCH 133/151] ENH: Update CI for ITK 5.4 RC 04 Update the configuration of the cookiecutter CI to point to the HEAD of ITKRemoteModuleBuildTestPackageAction's v5.4.0 branch. Updates to the template's configuration. --- .github/workflows/build-test-package.yml | 52 +++++++++---------- .../.github/workflows/build-test-package.yml | 4 +- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 2fd910a..cf2f6f9 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,9 +3,9 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "v5.3.0" - itk-wheel-tag: "v5.3.0" - itk-python-package-tag: "03391ad738438661fff40bfe37a7cfabd171b9b1" + itk-git-tag: "v5.4rc04" + itk-wheel-tag: "v5.4rc04" + itk-python-package-tag: "v5.4rc04" jobs: build-test-cxx: @@ -13,9 +13,9 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-20.04, windows-2022, macos-11] + os: [ubuntu-22.04, windows-2022, macos-12] include: - - os: ubuntu-20.04 + - os: ubuntu-22.04 c-compiler: "gcc" cxx-compiler: "g++" cmake-build-type: "MinSizeRel" @@ -23,18 +23,18 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-11 + - os: macos-12 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.11" - name: Install build dependencies run: | @@ -43,7 +43,7 @@ jobs: python -m pip install cookiecutter - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.24.2 + uses: lukka/get-cmake@v3.29.0 - name: Download ITK run: | @@ -139,7 +139,7 @@ jobs: shell: cmd build-linux-python-packages: - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: max-parallel: 2 matrix: @@ -163,13 +163,13 @@ jobs: sudo apt install zstd unzstd --version - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.11" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.24.2 + uses: lukka/get-cmake@v3.29.0 - name: Evaluate template shell: bash @@ -202,31 +202,31 @@ jobs: path: Evaluated/ITKModuleTemplate/dist build-macos-python-packages: - runs-on: macos-11 + runs-on: macos-12 strategy: max-parallel: 2 matrix: python-version: ["38", "39", "310", "311"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Specific XCode version' run: | sudo xcode-select -s "/Applications/Xcode_13.2.1.app" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.24.2 + uses: lukka/get-cmake@v3.29.0 - name: 'Fetch build script' run: | curl -L https://raw.githubusercontent.com/InsightSoftwareConsortium/ITKPythonPackage/${{ env.itk-python-package-tag }}/scripts/macpython-download-cache-and-build-module-wheels.sh -O chmod u+x macpython-download-cache-and-build-module-wheels.sh - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.11" - name: Evaluate template shell: bash @@ -270,12 +270,12 @@ jobs: python-version: '3.x' - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.24.2 + uses: lukka/get-cmake@v3.29.0 - - name: Set up Python 3.8 - uses: actions/setup-python@v4 + - name: Set up Python 3.11 + uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.11" - name: Evaluate template shell: bash diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index a2ae621..619e88e 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,9 +4,9 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@246883ef3828fc00219145aeec9efa67b9889d0b + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@df1df6398389fa1a99d169b1264b9647d2164dd0 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@246883ef3828fc00219145aeec9efa67b9889d0b + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@df1df6398389fa1a99d169b1264b9647d2164dd0 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} From 9eb70f1e757aedfdd2cdc413cb5d8b81b3fdcbba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 19 Apr 2024 11:43:41 -0400 Subject: [PATCH 134/151] ENH: Use https instead of http in web addresses --- LICENSE | 4 ++-- {{cookiecutter.project_name}}/CTestConfig.cmake | 2 +- {{cookiecutter.project_name}}/LICENSE | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index d645695..62589ed 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -193,7 +193,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/{{cookiecutter.project_name}}/CTestConfig.cmake b/{{cookiecutter.project_name}}/CTestConfig.cmake index 62f68ac..efccad4 100644 --- a/{{cookiecutter.project_name}}/CTestConfig.cmake +++ b/{{cookiecutter.project_name}}/CTestConfig.cmake @@ -1,7 +1,7 @@ set(CTEST_PROJECT_NAME "ITK") set(CTEST_NIGHTLY_START_TIME "1:00:00 UTC") -set(CTEST_DROP_METHOD "http") +set(CTEST_DROP_METHOD "https") set(CTEST_DROP_SITE "open.cdash.org") set(CTEST_DROP_LOCATION "/submit.php?project=Insight") set(CTEST_DROP_SITE_CDASH TRUE) diff --git a/{{cookiecutter.project_name}}/LICENSE b/{{cookiecutter.project_name}}/LICENSE index d645695..62589ed 100644 --- a/{{cookiecutter.project_name}}/LICENSE +++ b/{{cookiecutter.project_name}}/LICENSE @@ -1,7 +1,7 @@ Apache License Version 2.0, January 2004 - http://www.apache.org/licenses/ + https://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION @@ -193,7 +193,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, From 8d7a04776f673d0963b03957224310c391188191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Fri, 19 Apr 2024 11:44:08 -0400 Subject: [PATCH 135/151] ENH: Update clang-format style specification --- {{cookiecutter.project_name}}/.clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/{{cookiecutter.project_name}}/.clang-format b/{{cookiecutter.project_name}}/.clang-format index 411b009..92c5002 100644 --- a/{{cookiecutter.project_name}}/.clang-format +++ b/{{cookiecutter.project_name}}/.clang-format @@ -21,7 +21,7 @@ AccessModifierOffset: -2 AlignAfterOpenBracket: Align AlignConsecutiveAssignments: false AlignConsecutiveDeclarations: true -AlignEscapedNewlines: Right +AlignEscapedNewlines: Left AlignOperands: true AlignTrailingComments: true # clang 9.0 AllowAllArgumentsOnNextLine: true From b3fc2bdf6a74a2f10c706ea58d495b0d1f3e6921 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 5 Jun 2024 15:50:28 -0400 Subject: [PATCH 136/151] ENH: Updates for ITK 5.4.0 Update CI to build against v5.4.0 Also, improve how the `itk` python package version dependency is specified. Uses `== 5.4.*` to indicated compatibility with 5.4.0, 5.4.1, 5.4.2, etc., but not 5.5.0, etc. There is generally binary incompatibilty between minor versions. While it is possible that there could be binary incompatibility between patch releases, it is more likely that they will be compatible. This flexibilty helps ensure that remote module packages are not assumed invalid when a new patch version of `itk` is released. Addresses #142 --- .github/workflows/build-test-package.yml | 6 +++--- .../.github/workflows/build-test-package.yml | 4 ++-- {{cookiecutter.project_name}}/pyproject.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index cf2f6f9..45e580d 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -3,9 +3,9 @@ name: Build, test, package on: [push,pull_request] env: - itk-git-tag: "v5.4rc04" - itk-wheel-tag: "v5.4rc04" - itk-python-package-tag: "v5.4rc04" + itk-git-tag: "v5.4.0" + itk-wheel-tag: "v5.4.0" + itk-python-package-tag: "v5.4.0" jobs: build-test-cxx: diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 619e88e..c5507ea 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,9 +4,9 @@ on: [push,pull_request] jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@df1df6398389fa1a99d169b1264b9647d2164dd0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.0 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@df1df6398389fa1a99d169b1264b9647d2164dd0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.0 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 622f8e5..56a891a 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -35,7 +35,7 @@ classifiers = [ ] requires-python = ">=3.8" dependencies = [ - "itk>=5.4rc4", + "itk == 5.4.*", ] [project.urls] From bcfce602f737bdfc6b9508c66b9e7a87120910f6 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 1 Jul 2024 13:22:08 -0400 Subject: [PATCH 137/151] BUG: Prevent duplicate builds on pull request, push When a branch is pushed to the same repository, i.e. not a fork, and a pull request is made, duplicate builds will be generated for both the pull request and push. Instead, only generate builds for pull requests against main and pushes to main. --- .github/workflows/build-test-package.yml | 8 +++++++- .../.github/workflows/build-test-package.yml | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 45e580d..37a2fb4 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -1,6 +1,12 @@ name: Build, test, package -on: [push,pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main env: itk-git-tag: "v5.4.0" diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index c5507ea..8615623 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -1,6 +1,12 @@ name: Build, test, package -on: [push,pull_request] +on: + push: + branches: + - main + pull_request: + branches: + - main jobs: cxx-build-workflow: From 1d9b65e472a5fa6fa9a28367287ea8de7413ddd9 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 1 Jul 2024 22:22:55 -0400 Subject: [PATCH 138/151] BUG: Update itk-python-package-tag for Windows CI Addresses pip upgrade invocation. --- .github/workflows/build-test-package.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 37a2fb4..9644959 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -11,7 +11,8 @@ on: env: itk-git-tag: "v5.4.0" itk-wheel-tag: "v5.4.0" - itk-python-package-tag: "v5.4.0" + # v5.4.0 + fixes + itk-python-package-tag: "a52d9b596b4f0da5ddb770ee99851e5c65ca3053" jobs: build-test-cxx: From 6ecddffe82fdfba003f73a78b76886f5fb6fd0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C5=BEenan=20Zuki=C4=87?= Date: Thu, 25 Jan 2024 14:27:29 -0500 Subject: [PATCH 139/151] ENH: Use itkOverrideGetNameOfClassMacro as per ITK PR 4373 See related ITK PRs: https://github.com/InsightSoftwareConsortium/ITK/pull/4373 https://github.com/InsightSoftwareConsortium/ITK/pull/4378 --- .../include/itkMinimalStandardRandomVariateGenerator.h | 2 +- .../include/itk{{cookiecutter.filter_name}}.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h index 1ddea67..15c4854 100644 --- a/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h +++ b/{{cookiecutter.project_name}}/include/itkMinimalStandardRandomVariateGenerator.h @@ -66,7 +66,7 @@ class {{ cookiecutter.module_name }}_EXPORT MinimalStandardRandomVariateGenerato using NormalGeneratorType = itk::Statistics::NormalVariateGenerator; /** Run-time type information (and related methods). */ - itkTypeMacro(MinimalStandardRandomVariateGenerator, RandomVariateGeneratorBase); + itkOverrideGetNameOfClassMacro(MinimalStandardRandomVariateGenerator); /** Method for creation through the object factory. */ itkNewMacro(Self); diff --git a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h index 29959d2..ad2d661 100644 --- a/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h +++ b/{{cookiecutter.project_name}}/include/itk{{cookiecutter.filter_name}}.h @@ -54,7 +54,7 @@ class {{ cookiecutter.filter_name }} : public ImageToImageFilter; /** Run-time type information. */ - itkTypeMacro({{ cookiecutter.filter_name }}, ImageToImageFilter); + itkOverrideGetNameOfClassMacro({{ cookiecutter.filter_name }}); /** Standard New macro. */ itkNewMacro(Self); From 7581a150c6ab839183ab656870ecda80d01fd684 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Sun, 23 Dec 2018 17:02:03 -0500 Subject: [PATCH 140/151] ENH: Add examples to the template. Add a hint to foster writing examples for the contributed classes. --- cookiecutter.json | 1 + {{cookiecutter.project_name}}/CMakeLists.txt | 2 + .../examples/CMakeLists.txt | 18 ++++++++ .../{{ cookiecutter.example_name }}.cxx | 45 +++++++++++++++++++ .../{{ cookiecutter.example_name }}.py | 42 +++++++++++++++++ 5 files changed, 108 insertions(+) create mode 100644 {{cookiecutter.project_name}}/examples/CMakeLists.txt create mode 100644 {{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.cxx create mode 100644 {{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.py diff --git a/cookiecutter.json b/cookiecutter.json index a7568fc..11ff7e4 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,6 +5,7 @@ "module_name": "{{ cookiecutter.project_name[3:] }}", "filter_name": "MyFilter", "python_package_name": "itk-{{ cookiecutter.project_name[3:].lower() }}", + "example_name": "MyFilterApplicationWholePipeline", "download_url": "https://github.com/InsightSoftwareConsortium/{{ cookiecutter.project_name }}", "project_short_description": "This is a template that serves as a starting point for a new module.", "project_long_description": "ITK is an open-source, cross-platform library that provides developers with an extensive suite of software tools for image analysis. Developed through extreme programming methodologies, ITK employs leading-edge algorithms for registering and segmenting multidimensional scientific images." diff --git a/{{cookiecutter.project_name}}/CMakeLists.txt b/{{cookiecutter.project_name}}/CMakeLists.txt index f3ff2bd..93d2437 100644 --- a/{{cookiecutter.project_name}}/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/CMakeLists.txt @@ -11,3 +11,5 @@ else() set(ITK_DIR ${CMAKE_BINARY_DIR}) itk_module_impl() endif() + +itk_module_examples() diff --git a/{{cookiecutter.project_name}}/examples/CMakeLists.txt b/{{cookiecutter.project_name}}/examples/CMakeLists.txt new file mode 100644 index 0000000..204c066 --- /dev/null +++ b/{{cookiecutter.project_name}}/examples/CMakeLists.txt @@ -0,0 +1,18 @@ +cmake_minimum_required(VERSION 3.16.3) +project({{ cookiecutter.module_name }}Examples) + +set(ExampleSpecificComponents + {{ cookiecutter.module_name }} + ) + +if(NOT ITK_SOURCE_DIR) + find_package(ITK REQUIRED COMPONENTS ITKImageIO ITKTransformIO ${ExampleSpecificComponents}) +else() + # When being built as part of ITK, ITKImageIO and ITKTransformIO + # lists of modules are not yet ready, causing a configure error + find_package(ITK REQUIRED COMPONENTS ${ExampleSpecificComponents}) +endif() +include(${ITK_USE_FILE}) + +add_executable({{ cookiecutter.example_name }} {{ cookiecutter.example_name }}.cxx ) +target_link_libraries({{ cookiecutter.example_name }} ${ITK_LIBRARIES}) diff --git a/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.cxx b/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.cxx new file mode 100644 index 0000000..5341795 --- /dev/null +++ b/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.cxx @@ -0,0 +1,45 @@ +/*========================================================================= + * + * Copyright NumFOCUS + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0.txt + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + *=========================================================================*/ + +#include "itk{{cookiecutter.filter_name}}.h" + +#include "itkCommand.h" +#include "itkImageFileReader.h" +#include "itkImageFileWriter.h" + + +int main( int argc, char * argv[] ) +{ + if( argc < 4 ) + { + std::cerr << "Missing parameters." << std::endl; + std::cerr << "Usage: " << argv[0] + << " inputImage" + << " outputImage" + << " parameters" << std::endl; + return EXIT_FAILURE; + } + + + // Please, write a complete, self-containted and useful example that + // demonstrate a class when being used along with other ITK classes or in + // the context of a wider or specific application. + + + return EXIT_SUCCESS; +} diff --git a/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.py b/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.py new file mode 100644 index 0000000..0185a0e --- /dev/null +++ b/{{cookiecutter.project_name}}/examples/{{ cookiecutter.example_name }}.py @@ -0,0 +1,42 @@ +#!/usr/bin/env python + +# Copyright NumFOCUS +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0.txt +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Run with: +# ./{{ cookiecutter.example_name }}.py +# +# e.g. +# ./{{ cookiecutter.example_name }}.py MyImage.mha Output.mha 2 0.2 +# (A rule of thumb is to set the Threshold to be about 1 / 100 of the Level.) +# +# parameter_1: absolute minimum... +# The assumption is that... +# parameter_2: controls the.. +# A tradeoff between... + +import argparse + +import itk + + +parser = argparse.ArgumentParser(description="Example short description.") +parser.add_argument("input_image") +parser.add_argument("output_image") +parser.add_argument("parameter_1") +args = parser.parse_args() + +# Please, write a complete, self-containted and useful example that +# demonstrate a class when being used along with other ITK classes or in +# the context of a wider or specific application. From e409273d70b13ffaefd55d5121589c3920ddf64c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Wed, 3 Jul 2024 18:58:48 -0400 Subject: [PATCH 141/151] BUG: Use a different name for each macOS wheel name Use a different name for each macOS wheel name: append the Python minor version to the name. Fixes: ``` Error: Failed to CreateArtifact: Received non-retryable error: Failed request: (409) Conflict: an artifact with this name already exists on the workflow run ``` raised for example in: https://github.com/InsightSoftwareConsortium/ITKModuleTemplate/actions/runs/9768626552/job/26966536773?pr=164#step:9:21 --- .github/workflows/build-test-package.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 9644959..ab1329a 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -253,7 +253,7 @@ jobs: - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v3 with: - name: MacOSWheels + name: MacOSWheels${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist build-windows-python-packages: From eec729bdac461f51fc21f37232b4bcf8331881b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Wed, 3 Jul 2024 19:06:19 -0400 Subject: [PATCH 142/151] STYLE: Make the wheel names consistent Make the wheel names consistent: - Add the label `3` (for Python 3.x) before the minor version. - Remove the plural `s` from the macOS wheel names. Take advantage of the commit to rename the Windows wheel name root from `Window` to `Windows` to honor the OS name. --- .github/workflows/build-test-package.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index ab1329a..a948733 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -205,7 +205,7 @@ jobs: - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v3 with: - name: LinuxWheel${{ matrix.python-version }} + name: LinuxWheel3${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist build-macos-python-packages: @@ -253,7 +253,7 @@ jobs: - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v3 with: - name: MacOSWheels${{ matrix.python-version }} + name: MacOSWheel3${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist build-windows-python-packages: @@ -324,5 +324,5 @@ jobs: - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v3 with: - name: WindowWheel3.${{ matrix.python-version-minor }} + name: WindowsWheel3.${{ matrix.python-version-minor }} path: Evaluated/ITKModuleTemplate/dist From 9d8e786dc85e9e2d4671d15e13d49cb7a153935c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jon=20Haitz=20Legarreta=20Gorro=C3=B1o?= Date: Tue, 2 Jul 2024 10:18:37 -0400 Subject: [PATCH 143/151] ENH: Fix `Node.js` warnings linked to GitHub actions Fix `Node.js` warnings linked to GitHub actions: bump `actions/checkout@v4`. Take advantage of the commit to bump `upload-artifact@v4` and `actions/setup-python@v5`. Fixes: ``` Node.js 16 actions are deprecated. Please update the following actions to use Node.js 20: actions/checkout@v3. For more information see: https://github.blog/changelog/2023-09-22-github-actions-transitioning-from-node-16-to-node-20/. ``` raised for example in: https://github.com/InsightSoftwareConsortium/ITKTrimmedPointSetRegistration/actions/runs/9753007352 --- .github/workflows/build-test-package.yml | 12 ++++++------ .github/workflows/clang-format-linter.yml | 2 +- .../.github/workflows/clang-format-linter.yml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index a948733..5ee4280 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -153,7 +153,7 @@ jobs: python-version: ["38", "39", "310", "311"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Free up disk space' run: | @@ -203,7 +203,7 @@ jobs: done - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: LinuxWheel3${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist @@ -251,7 +251,7 @@ jobs: ../../macpython-download-cache-and-build-module-wheels.sh - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: MacOSWheel3${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist @@ -264,7 +264,7 @@ jobs: python-version-minor: ["8", "9", "10", "11"] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: 'Install Python' run: | @@ -272,7 +272,7 @@ jobs: $pythonVersion = "3.${{ matrix.python-version-minor }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: '3.x' @@ -322,7 +322,7 @@ jobs: C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: WindowsWheel3.${{ matrix.python-version-minor }} path: Evaluated/ITKModuleTemplate/dist diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index 899d579..edfc71e 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master diff --git a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml index 899d579..edfc71e 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master From 765d549b949e14ac2c8867d1e8d7640c4b0583b1 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Tue, 9 Jul 2024 17:54:22 -0400 Subject: [PATCH 144/151] BUG: Build python packages on tags for deployment As a follow-up, we need to build on tags to deploy to PyPI. --- .../.github/workflows/build-test-package.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 8615623..bb1efe9 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -4,6 +4,8 @@ on: push: branches: - main + tags: + - 'v*' pull_request: branches: - main From 293a2bbbd346994bcc6372862bd6d97f36ef977f Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Fri, 29 Nov 2024 08:14:11 -0500 Subject: [PATCH 145/151] ENH: Convert README from ReStructured Text to MarkDown More common, widely supported, and easier to write. --- {{cookiecutter.project_name}}/README.md | 13 ++++++++++++ {{cookiecutter.project_name}}/README.rst | 21 ------------------- .../itk-module.cmake | 2 +- {{cookiecutter.project_name}}/pyproject.toml | 2 +- 4 files changed, 15 insertions(+), 23 deletions(-) create mode 100644 {{cookiecutter.project_name}}/README.md delete mode 100644 {{cookiecutter.project_name}}/README.rst diff --git a/{{cookiecutter.project_name}}/README.md b/{{cookiecutter.project_name}}/README.md new file mode 100644 index 0000000..b365823 --- /dev/null +++ b/{{cookiecutter.project_name}}/README.md @@ -0,0 +1,13 @@ +# {{ cookiecutter.project_name }} + +[![Build Status]({{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml/badge.svg)]({{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml) + +[![PyPI Version](https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg)](https://pypi.python.org/pypi/{{ cookiecutter.python_package_name }}) + +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)]({{ cookiecutter.download_url }}/blob/main/LICENSE) + +## Overview + +{{ cookiecutter.project_short_description }} + +{{ cookiecutter.project_long_description }} diff --git a/{{cookiecutter.project_name}}/README.rst b/{{cookiecutter.project_name}}/README.rst deleted file mode 100644 index 963429a..0000000 --- a/{{cookiecutter.project_name}}/README.rst +++ /dev/null @@ -1,21 +0,0 @@ -{{ cookiecutter.project_name }} -================================= - -.. image:: {{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml/badge.svg - :target: {{ cookiecutter.download_url }}/actions/workflows/build-test-package.yml - :alt: Build Status - -.. image:: https://img.shields.io/pypi/v/{{ cookiecutter.python_package_name }}.svg - :target: https://pypi.python.org/pypi/{{ cookiecutter.python_package_name }} - :alt: PyPI Version - -.. image:: https://img.shields.io/badge/License-Apache%202.0-blue.svg - :target: {{ cookiecutter.download_url }}/blob/main/LICENSE - :alt: License - -Overview --------- - -{{ cookiecutter.project_short_description }} - -{{ cookiecutter.project_long_description }} diff --git a/{{cookiecutter.project_name}}/itk-module.cmake b/{{cookiecutter.project_name}}/itk-module.cmake index 9a38e04..462b4a9 100644 --- a/{{cookiecutter.project_name}}/itk-module.cmake +++ b/{{cookiecutter.project_name}}/itk-module.cmake @@ -1,7 +1,7 @@ # the top-level README is used for describing this module, just # re-used it for documentation here get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH) -file(READ "${MY_CURRENT_DIR}/README.rst" DOCUMENTATION) +file(READ "${MY_CURRENT_DIR}/README.md" DOCUMENTATION) # itk_module() defines the module dependencies in {{ cookiecutter.module_name }} # {{ cookiecutter.module_name }} depends on ITKCommon diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index 56a891a..fbfc6e5 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -6,7 +6,7 @@ build-backend = "scikit_build_core.build" name = "{{ cookiecutter.python_package_name }}" version = "0.1.0" description = "{{ cookiecutter.project_short_description }}" -readme = "README.rst" +readme = "README.md" license = {file = "LICENSE"} authors = [ { name = "{{ cookiecutter.full_name }}", email = "{{ cookiecutter.email }}" }, From 9e0b896a61ad7bdbfaa6938032d2c010885672ff Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Sun, 1 Dec 2024 13:48:51 -0500 Subject: [PATCH 146/151] COMP: CI configuration updates To address libtiff errors and other warnings. Update ITK Git tag, ITKPythonPackage Git tag. Use macos-13 over macos-12 for CXX builds. Add macos-14 for CXX builds. Update VisualStudio initialization script call. Do not build Python 3.8 packages, which will soon be dropped. --- .github/workflows/build-test-package.yml | 49 +++++++++++++++++------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 5ee4280..9284123 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -9,10 +9,11 @@ on: - main env: - itk-git-tag: "v5.4.0" + # v5.4.0 + additional patches on the release-5.4 branch + itk-git-tag: "49413c3a9e8ecf0f912534e7c13f4c7bc3799d60" itk-wheel-tag: "v5.4.0" # v5.4.0 + fixes - itk-python-package-tag: "a52d9b596b4f0da5ddb770ee99851e5c65ca3053" + itk-python-package-tag: "830d14cc40199f438001ee493288139fb75bba92" jobs: build-test-cxx: @@ -20,7 +21,7 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-22.04, windows-2022, macos-12] + os: [ubuntu-22.04, windows-2022, macos-13, macos-14] include: - os: ubuntu-22.04 c-compiler: "gcc" @@ -30,7 +31,11 @@ jobs: c-compiler: "cl.exe" cxx-compiler: "cl.exe" cmake-build-type: "Release" - - os: macos-12 + - os: macos-13 + c-compiler: "clang" + cxx-compiler: "clang++" + cmake-build-type: "MinSizeRel" + - os: macos-14 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" @@ -38,6 +43,12 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Free Disk Space (Ubuntu) + if: matrix.os == 'ubuntu-22.04' + uses: jlumbroso/free-disk-space@v1.3.1 + with: + large-packages: false + - name: Set up Python 3.11 uses: actions/setup-python@v5 with: @@ -52,6 +63,16 @@ jobs: - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.29.0 + - name: 'Specific XCode version' + if: matrix.os == 'macos-13' + 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" + - name: Download ITK run: | cd .. @@ -61,6 +82,7 @@ jobs: - name: Build ITK if: matrix.os != 'windows-2022' + shell: bash run: | cd .. mkdir ITK-build @@ -70,14 +92,15 @@ jobs: - name: Build ITK if: matrix.os == 'windows-2022' + shell: pwsh run: | + Set-PSDebug -Trace 1 cd .. mkdir ITK-build cd ITK-build - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -SkipAutomaticLocation cmake -DCMAKE_C_COMPILER:FILEPATH="${{ matrix.c-compiler }}" -DBUILD_SHARED_LIBS:BOOL=ON -DCMAKE_CXX_COMPILER="${{ matrix.cxx-compiler }}" -DCMAKE_BUILD_TYPE:STRING=${{ matrix.cmake-build-type }} -DBUILD_TESTING:BOOL=OFF -GNinja ../ITK ninja - shell: cmd - name: Fetch CTest driver script run: | @@ -140,17 +163,17 @@ jobs: - name: Build and test if: matrix.os == 'windows-2022' + shell: pwsh run: | - call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat" + & "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\Launch-VsDevShell.ps1" -Arch amd64 -SkipAutomaticLocation ctest --output-on-failure -j 2 -V -S dashboard.cmake - shell: cmd build-linux-python-packages: runs-on: ubuntu-22.04 strategy: max-parallel: 2 matrix: - python-version: ["38", "39", "310", "311"] + python-version: ["39", "310", "311"] steps: - uses: actions/checkout@v4 @@ -209,18 +232,18 @@ jobs: path: Evaluated/ITKModuleTemplate/dist build-macos-python-packages: - runs-on: macos-12 + runs-on: macos-13 strategy: max-parallel: 2 matrix: - python-version: ["38", "39", "310", "311"] + python-version: ["39", "310", "311"] steps: - uses: actions/checkout@v4 - name: 'Specific XCode version' run: | - sudo xcode-select -s "/Applications/Xcode_13.2.1.app" + sudo xcode-select -s "/Applications/Xcode_14.3.1.app" - name: Get specific version of CMake, Ninja uses: lukka/get-cmake@v3.29.0 @@ -261,7 +284,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version-minor: ["8", "9", "10", "11"] + python-version-minor: ["9", "10", "11"] steps: - uses: actions/checkout@v4 From b68fb67811a8b9e9683eda47f37736fd1c00a411 Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Mon, 9 Dec 2024 22:39:11 -0500 Subject: [PATCH 147/151] COMP: Mac CI configuration updates Use python3-minor-version. Set ITKPYTHONPACKAGE_ORG. Pass the Python version to the download script. --- .github/workflows/build-test-package.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 9284123..6ac1cc1 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -14,6 +14,7 @@ env: itk-wheel-tag: "v5.4.0" # v5.4.0 + fixes itk-python-package-tag: "830d14cc40199f438001ee493288139fb75bba92" + itk-python-package-org: "InsightSoftwareConsortium" jobs: build-test-cxx: @@ -236,7 +237,7 @@ jobs: strategy: max-parallel: 2 matrix: - python-version: ["39", "310", "311"] + python3-minor-version: ["9", "10", "11"] steps: - uses: actions/checkout@v4 @@ -270,13 +271,14 @@ jobs: cd "${GITHUB_WORKSPACE}/Evaluated/ITKModuleTemplate" export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} + export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} export MACOSX_DEPLOYMENT_TARGET=10.9 - ../../macpython-download-cache-and-build-module-wheels.sh + ../../macpython-download-cache-and-build-module-wheels.sh "3.${{ matrix.python3-minor-version }}" - name: Publish Python package as GitHub Artifact uses: actions/upload-artifact@v4 with: - name: MacOSWheel3${{ matrix.python-version }} + name: MacOSWheel3${{ matrix.python3-minor-version }} path: Evaluated/ITKModuleTemplate/dist build-windows-python-packages: From e42b5bec39743d42f3813ee12106ccfe7b8a36e6 Mon Sep 17 00:00:00 2001 From: Hans Johnson Date: Tue, 28 Jan 2025 15:14:36 -0600 Subject: [PATCH 148/151] ENH: Update cookie cutter package versions Update various package versions to match the recent minimums and recommendations. --- .github/workflows/build-test-package.yml | 72 ++--- .github/workflows/clang-format-linter.yml | 2 +- {{cookiecutter.project_name}}/.clang-format | 249 +++++++++++++++--- .../.github/workflows/build-test-package.yml | 4 +- {{cookiecutter.project_name}}/CMakeLists.txt | 2 +- .../examples/CMakeLists.txt | 2 +- 6 files changed, 251 insertions(+), 80 deletions(-) diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 6ac1cc1..4d794ca 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -9,11 +9,11 @@ on: - main env: - # v5.4.0 + additional patches on the release-5.4 branch - itk-git-tag: "49413c3a9e8ecf0f912534e7c13f4c7bc3799d60" - itk-wheel-tag: "v5.4.0" - # v5.4.0 + fixes - itk-python-package-tag: "830d14cc40199f438001ee493288139fb75bba92" + # v6.0a02 + itk-git-tag: "v6.0a02" + itk-wheel-tag: "v6.0a02" + # v6.0a02 + fixes + itk-python-package-tag: "v6.0a02" itk-python-package-org: "InsightSoftwareConsortium" jobs: @@ -22,9 +22,10 @@ jobs: strategy: max-parallel: 3 matrix: - os: [ubuntu-22.04, windows-2022, macos-13, macos-14] + # runners macos-13 is x86_64, macos-15 is arm64 by default + os: [ubuntu-24.04, windows-2022, macos-13, macos-15] include: - - os: ubuntu-22.04 + - os: ubuntu-24.04 c-compiler: "gcc" cxx-compiler: "g++" cmake-build-type: "MinSizeRel" @@ -36,22 +37,24 @@ jobs: c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" - - os: macos-14 + deployment_target: '10.9' + - os: macos-15 c-compiler: "clang" cxx-compiler: "clang++" cmake-build-type: "MinSizeRel" + deployment_target: '13.0' steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: Free Disk Space (Ubuntu) - if: matrix.os == 'ubuntu-22.04' + if: matrix.os == 'ubuntu-24.04' uses: jlumbroso/free-disk-space@v1.3.1 with: large-packages: false - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v5.4.0 with: python-version: "3.11" @@ -62,17 +65,17 @@ jobs: python -m pip install cookiecutter - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.0 + uses: lukka/get-cmake@v3.31.5 - - name: 'Specific XCode version' + - name: 'Specific XCode version 14.3.1' if: matrix.os == 'macos-13' run: | sudo xcode-select -s "/Applications/Xcode_14.3.1.app" - - name: 'Specific XCode version' - if: matrix.os == 'macos-14' + - name: 'Specific XCode version 16.2' + if: matrix.os == 'macos-15' run: | - sudo xcode-select -s "/Applications/Xcode_15.0.1.app" + sudo xcode-select -s "/Applications/Xcode_16.2.app" - name: Download ITK run: | @@ -170,14 +173,14 @@ jobs: ctest --output-on-failure -j 2 -V -S dashboard.cmake build-linux-python-packages: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 strategy: max-parallel: 2 matrix: - python-version: ["39", "310", "311"] + python-version: ["39", "310", "311","312","313"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: 'Free up disk space' run: | @@ -195,12 +198,12 @@ jobs: unzstd --version - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v5.4.0 with: python-version: "3.11" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.0 + uses: lukka/get-cmake@v3.31.5 - name: Evaluate template shell: bash @@ -227,7 +230,7 @@ jobs: done - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.0 with: name: LinuxWheel3${{ matrix.python-version }} path: Evaluated/ITKModuleTemplate/dist @@ -237,17 +240,17 @@ jobs: strategy: max-parallel: 2 matrix: - python3-minor-version: ["9", "10", "11"] + python3-minor-version: ["9", "10", "11", "12", "13"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: 'Specific XCode version' run: | sudo xcode-select -s "/Applications/Xcode_14.3.1.app" - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.0 + uses: lukka/get-cmake@v3.31.5 - name: 'Fetch build script' run: | @@ -255,7 +258,7 @@ jobs: chmod u+x macpython-download-cache-and-build-module-wheels.sh - name: Set up Python 3.11 - uses: actions/setup-python@v5 + uses: actions/setup-python@v5.4.0 with: python-version: "3.11" @@ -272,11 +275,12 @@ jobs: export ITK_PACKAGE_VERSION=${{ env.itk-wheel-tag }} export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }} export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }} - export MACOSX_DEPLOYMENT_TARGET=10.9 + # For Xcode 16.2, the recommended "MACOSX_DEPLOYMENT_TARGET" is "13.0"; this means your application should be built to run on macOS Ventura (version 13.0) or later. + export MACOSX_DEPLOYMENT_TARGET=${{ matrix.deployment_target || '13.0' }} ../../macpython-download-cache-and-build-module-wheels.sh "3.${{ matrix.python3-minor-version }}" - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.0 with: name: MacOSWheel3${{ matrix.python3-minor-version }} path: Evaluated/ITKModuleTemplate/dist @@ -289,7 +293,7 @@ jobs: python-version-minor: ["9", "10", "11"] steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - name: 'Install Python' run: | @@ -297,15 +301,15 @@ jobs: $pythonVersion = "3.${{ matrix.python-version-minor }}" iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/scikit-build/scikit-ci-addons/master/windows/install-python.ps1')) - - uses: actions/setup-python@v5 + - uses: actions/setup-python@v5.4.0 with: python-version: '3.x' - name: Get specific version of CMake, Ninja - uses: lukka/get-cmake@v3.29.0 + uses: lukka/get-cmake@v3.31.5 - - name: Set up Python 3.11 - uses: actions/setup-python@v5 + - name: Set up Python 3.11/ + uses: actions/setup-python@v5.4.0 with: python-version: "3.11" @@ -347,7 +351,7 @@ jobs: C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" - name: Publish Python package as GitHub Artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v4.6.0 with: name: WindowsWheel3.${{ matrix.python-version-minor }} path: Evaluated/ITKModuleTemplate/dist diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index edfc71e..306c0ec 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4.2.2 - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master diff --git a/{{cookiecutter.project_name}}/.clang-format b/{{cookiecutter.project_name}}/.clang-format index 92c5002..45b9502 100644 --- a/{{cookiecutter.project_name}}/.clang-format +++ b/{{cookiecutter.project_name}}/.clang-format @@ -1,4 +1,4 @@ -## This config file is only relevant for clang-format version 8.0.0 +## This config file is only relevant for clang-format version 19.1.4 ## ## Examples of each format style can be found on the in the clang-format documentation ## See: https://clang.llvm.org/docs/ClangFormatStyleOptions.html for details of each option @@ -10,142 +10,309 @@ ## maintaining a consistent code style. ## ## EXAMPLE apply code style enforcement before commit: -# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --modified +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.4} --modified ## EXAMPLE apply code style enforcement after commit: -# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_8.0.0} --last +# Utilities/Maintenance/clang-format.bash --clang ${PATH_TO_CLANG_FORMAT_19.1.4} --last --- -# This configuration requires clang-format version 8.0.0 exactly. -BasedOnStyle: Mozilla +# This configuration requires clang-format version 19.1.4 exactly. Language: Cpp AccessModifierOffset: -2 AlignAfterOpenBracket: Align -AlignConsecutiveAssignments: false -AlignConsecutiveDeclarations: true +AlignArrayOfStructures: None +AlignConsecutiveAssignments: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveBitFields: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveDeclarations: + Enabled: true + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: true +AlignConsecutiveMacros: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveShortCaseStatements: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCaseArrows: false + AlignCaseColons: false +AlignConsecutiveTableGenBreakingDAGArgColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveTableGenCondOperatorColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false +AlignConsecutiveTableGenDefinitionColons: + Enabled: false + AcrossEmptyLines: false + AcrossComments: false + AlignCompound: false + AlignFunctionPointers: false + PadOperators: false AlignEscapedNewlines: Left -AlignOperands: true -AlignTrailingComments: true -# clang 9.0 AllowAllArgumentsOnNextLine: true -# clang 9.0 AllowAllConstructorInitializersOnNextLine: true +AlignOperands: Align +AlignTrailingComments: + Kind: Always + OverEmptyLines: 0 +AllowAllArgumentsOnNextLine: true AllowAllParametersOfDeclarationOnNextLine: false -AllowShortBlocksOnASingleLine: false +AllowBreakBeforeNoexceptSpecifier: Never +AllowShortBlocksOnASingleLine: Never +AllowShortCaseExpressionOnASingleLine: true AllowShortCaseLabelsOnASingleLine: false -AllowShortFunctionsOnASingleLine: Inline -# clang 9.0 AllowShortLambdasOnASingleLine: All -# clang 9.0 features AllowShortIfStatementsOnASingleLine: Never -AllowShortIfStatementsOnASingleLine: false +AllowShortCompoundRequirementOnASingleLine: true +AllowShortEnumsOnASingleLine: true +#AllowShortFunctionsOnASingleLine: Inline Only merge functions defined inside a class. Implies empty. +#AllowShortFunctionsOnASingleLine: None (in configuration: None) Never merge functions into a single line. +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: All AllowShortLoopsOnASingleLine: false AlwaysBreakAfterDefinitionReturnType: None -AlwaysBreakAfterReturnType: All AlwaysBreakBeforeMultilineStrings: false -AlwaysBreakTemplateDeclarations: Yes +AttributeMacros: + - __capability BinPackArguments: false BinPackParameters: false -BreakBeforeBraces: Custom +BitFieldColonSpacing: Both BraceWrapping: - # clang 9.0 feature AfterCaseLabel: false + AfterCaseLabel: true AfterClass: true - AfterControlStatement: true + AfterControlStatement: Always AfterEnum: true + AfterExternBlock: true AfterFunction: true AfterNamespace: true AfterObjCDeclaration: true AfterStruct: true AfterUnion: true - AfterExternBlock: true BeforeCatch: true BeforeElse: true -## This is the big change from historical ITK formatting! -# Historically ITK used a style similar to https://en.wikipedia.org/wiki/Indentation_style#Whitesmiths_style -# with indented braces, and not indented code. This style is very difficult to automatically -# maintain with code beautification tools. Not indenting braces is more common among -# formatting tools. + BeforeLambdaBody: false + BeforeWhile: false IndentBraces: false SplitEmptyFunction: false SplitEmptyRecord: false SplitEmptyNamespace: false +BreakAdjacentStringLiterals: true +BreakAfterAttributes: Leave +BreakAfterJavaFieldAnnotations: false +BreakAfterReturnType: All +BreakArrays: true BreakBeforeBinaryOperators: None -#clang 6.0 BreakBeforeInheritanceComma: true -BreakInheritanceList: BeforeComma +BreakBeforeConceptDeclarations: Always +BreakBeforeBraces: Custom +BreakBeforeInlineASMColon: OnlyMultiline BreakBeforeTernaryOperators: true -#clang 6.0 BreakConstructorInitializersBeforeComma: true BreakConstructorInitializers: BeforeComma -BreakAfterJavaFieldAnnotations: false +BreakFunctionDefinitionParameters: false +BreakInheritanceList: BeforeComma BreakStringLiterals: true +BreakTemplateDeclarations: Yes ## The following line allows larger lines in non-documentation code ColumnLimit: 120 CommentPragmas: '^ IWYU pragma:' CompactNamespaces: false -ConstructorInitializerAllOnOneLineOrOnePerLine: false ConstructorInitializerIndentWidth: 2 ContinuationIndentWidth: 2 Cpp11BracedListStyle: false DerivePointerAlignment: false DisableFormat: false +EmptyLineAfterAccessModifier: Never +EmptyLineBeforeAccessModifier: LogicalBlock ExperimentalAutoDetectBinPacking: false FixNamespaceComments: true ForEachMacros: - foreach - Q_FOREACH - BOOST_FOREACH +IfMacros: + - KJ_IF_MAYBE IncludeBlocks: Preserve IncludeCategories: - Regex: '^"(llvm|llvm-c|clang|clang-c)/' Priority: 2 + SortPriority: 0 + CaseSensitive: false - Regex: '^(<|"(gtest|gmock|isl|json)/)' Priority: 3 + SortPriority: 0 + CaseSensitive: false - Regex: '.*' Priority: 1 + SortPriority: 0 + CaseSensitive: false IncludeIsMainRegex: '(Test)?$' +IncludeIsMainSourceRegex: '' +IndentAccessModifiers: false +IndentCaseBlocks: false IndentCaseLabels: true +IndentExternBlock: AfterExternBlock +IndentGotoLabels: true IndentPPDirectives: AfterHash +IndentRequiresClause: true IndentWidth: 2 IndentWrappedFunctionNames: false +InsertBraces: false +InsertNewlineAtEOF: false +InsertTrailingCommas: None +IntegerLiteralSeparator: + Binary: 0 + BinaryMinDigits: 0 + Decimal: 0 + DecimalMinDigits: 0 + Hex: 0 + HexMinDigits: 0 JavaScriptQuotes: Leave JavaScriptWrapImports: true -KeepEmptyLinesAtTheStartOfBlocks: true +KeepEmptyLines: + AtEndOfFile: false + AtStartOfBlock: true + AtStartOfFile: true +LambdaBodyIndentation: Signature +LineEnding: DeriveLF MacroBlockBegin: '' MacroBlockEnd: '' +MainIncludeChar: Quote MaxEmptyLinesToKeep: 2 NamespaceIndentation: None ObjCBinPackProtocolList: Auto ObjCBlockIndentWidth: 2 +ObjCBreakBeforeNestedBlockParam: true ObjCSpaceAfterProperty: true ObjCSpaceBeforeProtocolList: false +PackConstructorInitializers: BinPack PenaltyBreakAssignment: 2 PenaltyBreakBeforeFirstCallParameter: 19 PenaltyBreakComment: 300 ## The following line allows larger lines in non-documentation code PenaltyBreakFirstLessLess: 120 +PenaltyBreakOpenParenthesis: 0 +PenaltyBreakScopeResolution: 500 PenaltyBreakString: 1000 PenaltyBreakTemplateDeclaration: 10 PenaltyExcessCharacter: 1000000 +PenaltyIndentedWhitespace: 0 PenaltyReturnTypeOnItsOwnLine: 200 PointerAlignment: Middle +PPIndentWidth: -1 +QualifierAlignment: Custom +QualifierOrder: + - friend + - static + - inline + - constexpr + - const + - type +ReferenceAlignment: Pointer ReflowComments: true +RemoveBracesLLVM: false +RemoveParentheses: Leave +RemoveSemicolon: false +RequiresClausePosition: OwnLine +RequiresExpressionIndentation: OuterScope +SeparateDefinitionBlocks: Leave +ShortNamespaceLines: 1 +SkipMacroDefinitionBody: false # We may want to sort the includes as a separate pass -SortIncludes: false +SortIncludes: Never +SortJavaStaticImport: Before # We may want to revisit this later -SortUsingDeclarations: false +SortUsingDeclarations: Never SpaceAfterCStyleCast: false -# SpaceAfterLogicalNot: false +SpaceAfterLogicalNot: false SpaceAfterTemplateKeyword: true +SpaceAroundPointerQualifiers: Default SpaceBeforeAssignmentOperators: true +SpaceBeforeCaseColon: false SpaceBeforeCpp11BracedList: false SpaceBeforeCtorInitializerColon: true SpaceBeforeInheritanceColon: true +SpaceBeforeJsonColon: false SpaceBeforeParens: ControlStatements +SpaceBeforeParensOptions: + AfterControlStatements: true + AfterForeachMacros: true + AfterFunctionDefinitionName: false + AfterFunctionDeclarationName: false + AfterIfMacros: true + AfterOverloadedOperator: false + AfterPlacementOperator: true + AfterRequiresInClause: false + AfterRequiresInExpression: false + BeforeNonEmptyParentheses: false SpaceBeforeRangeBasedForLoopColon: true -SpaceInEmptyParentheses: false +SpaceBeforeSquareBrackets: false +SpaceInEmptyBlock: false SpacesBeforeTrailingComments: 1 -SpacesInAngles: false +SpacesInAngles: Never SpacesInContainerLiterals: false -SpacesInCStyleCastParentheses: false -SpacesInParentheses: false +SpacesInLineCommentPrefix: + Minimum: 1 + Maximum: -1 +SpacesInParens: Never +SpacesInParensOptions: + ExceptDoubleParentheses: false + InCStyleCasts: false + InConditionalStatements: false + InEmptyParentheses: false + Other: false SpacesInSquareBrackets: false -Standard: Cpp11 +Standard: Latest +StatementAttributeLikeMacros: + - Q_EMIT StatementMacros: - Q_UNUSED - QT_REQUIRE_VERSION + - ITK_GCC_PRAGMA_PUSH + - ITK_GCC_PRAGMA_POP + - ITK_GCC_SUPPRESS_Wfloat_equal + - ITK_GCC_SUPPRESS_Wformat_nonliteral + - ITK_GCC_SUPPRESS_Warray_bounds + - ITK_CLANG_PRAGMA_PUSH + - ITK_CLANG_PRAGMA_POP + - ITK_CLANG_SUPPRESS_Wzero_as_null_pointer_constant + - CLANG_PRAGMA_PUSH + - CLANG_PRAGMA_POP + - CLANG_SUPPRESS_Wfloat_equal + - INTEL_PRAGMA_WARN_PUSH + - INTEL_PRAGMA_WARN_POP + - INTEL_SUPPRESS_warning_1292 + - itkTemplateFloatingToIntegerMacro + - itkLegacyMacro +TableGenBreakInsideDAGArg: DontBreak TabWidth: 2 UseTab: Never +VerilogBreakBetweenInstancePorts: true +WhitespaceSensitiveMacros: + - BOOST_PP_STRINGIZE + - CF_SWIFT_NAME + - NS_SWIFT_NAME + - PP_STRINGIZE + - STRINGIZE ... diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index bb1efe9..5b46268 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -12,9 +12,9 @@ on: jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.2 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.0 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.2 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }} diff --git a/{{cookiecutter.project_name}}/CMakeLists.txt b/{{cookiecutter.project_name}}/CMakeLists.txt index 93d2437..c06d3a0 100644 --- a/{{cookiecutter.project_name}}/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.22.1...3.29.0 FATAL_ERROR) project({{ cookiecutter.module_name }}) set({{ cookiecutter.module_name }}_LIBRARIES {{ cookiecutter.module_name }}) diff --git a/{{cookiecutter.project_name}}/examples/CMakeLists.txt b/{{cookiecutter.project_name}}/examples/CMakeLists.txt index 204c066..eb5c2c3 100644 --- a/{{cookiecutter.project_name}}/examples/CMakeLists.txt +++ b/{{cookiecutter.project_name}}/examples/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.16.3) +cmake_minimum_required(VERSION 3.22.1...3.29.0 FATAL_ERROR) project({{ cookiecutter.module_name }}Examples) set(ExampleSpecificComponents From 4004803761d77800d90c8719debbe99ec9d558df Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Thu, 13 Nov 2025 10:46:35 +0000 Subject: [PATCH 149/151] ENH: Upgrade required Python and CMake version in pyproject.toml ITK no longer produced Python 3.8 packages. CMake 3.22.1 is required since InsightSoftwareConsortium/ITK@2fd36ab3a6871340c1defd5a69dc657a81bb8134. --- {{cookiecutter.project_name}}/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/pyproject.toml b/{{cookiecutter.project_name}}/pyproject.toml index fbfc6e5..e5f3d71 100644 --- a/{{cookiecutter.project_name}}/pyproject.toml +++ b/{{cookiecutter.project_name}}/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ "Topic :: Scientific/Engineering :: Medical Science Apps.", "Topic :: Software Development :: Libraries", ] -requires-python = ">=3.8" +requires-python = ">=3.9" dependencies = [ "itk == 5.4.*", ] @@ -46,7 +46,7 @@ Homepage = "{{ cookiecutter.download_url }}" # The versions of CMake to allow. If CMake is not present on the system or does # not pass this specifier, it will be downloaded via PyPI if possible. An empty # string will disable this check. -cmake.version = ">=3.16.3" +cmake.version = ">=3.22.1" # A list of args to pass to CMake when configuring the project. Setting this in # config or envvar will override toml. See also ``cmake.define``. From 346bdf18ab667af49ffb69e6c412baac5dd693d5 Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Thu, 13 Nov 2025 11:03:06 +0000 Subject: [PATCH 150/151] STYLE: Update clang-format to match ITK 2025-11-10 --- .github/workflows/clang-format-linter.yml | 4 ++-- .../.github/workflows/clang-format-linter.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/clang-format-linter.yml b/.github/workflows/clang-format-linter.yml index 306c0ec..65169b0 100644 --- a/.github/workflows/clang-format-linter.yml +++ b/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4.2.2 + - uses: actions/checkout@v5 - - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@main diff --git a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml index edfc71e..65169b0 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/clang-format-linter.yml @@ -7,6 +7,6 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v5 - - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master + - uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@main From bcf2ea42b29664e58f456a66e40b3c6d2a985cca Mon Sep 17 00:00:00 2001 From: Simon Rit Date: Thu, 13 Nov 2025 14:59:18 +0000 Subject: [PATCH 151/151] ENH: Upgrade ITK tags to latest v5.4.4(.post1) --- .../.github/workflows/build-test-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml index 5b46268..1651a0b 100644 --- a/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml +++ b/{{cookiecutter.project_name}}/.github/workflows/build-test-package.yml @@ -12,9 +12,9 @@ on: jobs: cxx-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.2 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-cxx.yml@v5.4.4 python-build-workflow: - uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.2 + uses: InsightSoftwareConsortium/ITKRemoteModuleBuildTestPackageAction/.github/workflows/build-test-package-python.yml@v5.4.4 secrets: pypi_password: ${{ "{{" }} secrets.pypi_password {{ "}}" }}