Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)

#-----------------------------------------------------------------------------
Expand Down Expand Up @@ -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)
Expand Down
11 changes: 8 additions & 3 deletions itkVersion.py
Original file line number Diff line number Diff line change
@@ -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")
Copy link
Copy Markdown
Member

@thewtex thewtex Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no leading 'v'?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet. But stripping 'v' is needed to get the same backward compatible behavior when using version tags for checking out and setting version. The v needs to be stripped somewhere.


def get_versions():
"""Returns versions for the ITK Python package.
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
Expand Down
6 changes: 3 additions & 3 deletions scripts/macpython-download-cache-and-build-module-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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.
#
# ===========================================
Expand All @@ -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.
Expand Down
1 change: 0 additions & 1 deletion scripts/pyproject_configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__))))

Expand Down
4 changes: 4 additions & 0 deletions scripts/update_python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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)
Expand Down