diff --git a/CMakeLists.txt b/CMakeLists.txt index 08d4b757..28f0e96b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,19 +17,6 @@ message(STATUS "SuperBuild - ITKPythonPackage_WHEEL_NAME:${ITKPythonPackage_WHEE option(ITKPythonPackage_USE_TBB "Build and use oneTBB in the ITK python package" ON) -if(ITK_SOURCE_DIR) - set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/lib/cmake/TBB") -else() - set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/lib/cmake/TBB") -endif() -set(tbb_args ) -if(ITKPythonPackage_USE_TBB) - set(tbb_args - -DModule_ITKTBB:BOOL=ON - -DTBB_DIR:PATH=${TBB_DIR} - ) -endif() - if(ITKPythonPackage_SUPERBUILD) #----------------------------------------------------------------------------- @@ -111,6 +98,18 @@ if(ITKPythonPackage_SUPERBUILD) endif() if(ITKPythonPackage_USE_TBB) + if(ITK_SOURCE_DIR) + set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/lib/cmake/TBB") + else() + set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/lib/cmake/TBB") + endif() + set(tbb_args ) + if(ITKPythonPackage_USE_TBB) + set(tbb_args + -DModule_ITKTBB:BOOL=ON + -DTBB_DIR:PATH=${TBB_DIR} + ) + endif() set(tbb_cmake_cache_args) if(CMAKE_OSX_DEPLOYMENT_TARGET) diff --git a/itkVersion.py b/itkVersion.py index 0d526221..d73dbe78 100644 --- a/itkVersion.py +++ b/itkVersion.py @@ -1,5 +1,7 @@ -VERSION = "6.0b1" +from packaging.version import Version +# Version needs to be python PEP 440 compliant (no leading v) +VERSION = '6.0b1'.removeprefix("v") def get_versions(): """Returns versions for the ITK Python package. @@ -20,7 +22,10 @@ def get_versions(): # '4.11.0.dev20170208+139.g922f2d9' get_versions()['package-version'] """ + + Version(VERSION) # Raise InvalidVersion exception if not PEP 440 compliant + versions = {} - versions["version"] = VERSION - versions["package-version"] = VERSION.split("+")[0] + versions['version'] = VERSION + versions['package-version'] = VERSION.split('+')[0] return versions diff --git a/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh b/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh index a0ee4fd6..85471726 100755 --- a/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh +++ b/scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh @@ -19,7 +19,8 @@ # For example, # # export ITK_PACKAGE_VERSION="v5.4.0" -# scripts/dockcross-manylinux-build-module-wheels.sh cp39 +# export ITKPYTHONPACKAGE_ORG="InsightSoftwareConsortium" +# scripts/dockcross-manylinux-download-cache-and-build-module-wheels cp39 # # `ITKPYTHONPACKAGE_ORG`: Github organization for fetching ITKPythonPackage build scripts. # diff --git a/scripts/macpython-download-cache-and-build-module-wheels.sh b/scripts/macpython-download-cache-and-build-module-wheels.sh index b7c5400e..297e827d 100755 --- a/scripts/macpython-download-cache-and-build-module-wheels.sh +++ b/scripts/macpython-download-cache-and-build-module-wheels.sh @@ -10,8 +10,9 @@ # Versions can be restricted by passing them in as arguments to the script. # For example, # -# scripts/macpython-build-module-wheels.sh 3.9 3.11 -# Shared libraries can be included in the wheel by exporting them to DYLD_LIBRARY_PATH before +# scripts/macpython-download-cache-and-build-module-wheels.sh 3.9 3.11 +# +# Shared libraries can be included in the wheel by setting DYLD_LIBRARY_PATH before # running this script. # # =========================================== @@ -21,7 +22,6 @@ # For example, # # export DYLD_LIBRARY_PATH="/path/to/libs" -# scripts/macpython-build-module-wheels.sh 3.7 3.9 # # `ITK_PACKAGE_VERSION`: ITKPythonBuilds archive tag to use for ITK build artifacts. # See https://github.com/InsightSoftwareConsortium/ITKPythonBuilds for available tags. diff --git a/scripts/pyproject_configure.py b/scripts/pyproject_configure.py index 487329da..55ba9c2c 100755 --- a/scripts/pyproject_configure.py +++ b/scripts/pyproject_configure.py @@ -28,7 +28,6 @@ import os import re import sys -import textwrap sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) diff --git a/scripts/update_python_version.py b/scripts/update_python_version.py index ca5950d9..f69207d3 100755 --- a/scripts/update_python_version.py +++ b/scripts/update_python_version.py @@ -8,6 +8,7 @@ import os import subprocess from datetime import datetime +from packaging.version import Version argparser = argparse.ArgumentParser(description=__doc__) argparser.add_argument("itkSourceDir") @@ -61,6 +62,9 @@ os.chdir(itkPythonPackageDir) itkVersionPath = os.path.join(itkPythonPackageDir, "itkVersion.py") + +Version(VERSION) # Raise InvalidVersion exception if not PEP 440 compliant + if not os.path.exists(itkVersionPath): print("Expected file " + itkVersionPath + " not found!") sys.exit(1)