Skip to content

Commit ab4b64f

Browse files
authored
Merge pull request #298 from InsightSoftwareConsortium/script-documentation-cleanups
script documentation cleanups
2 parents 4ef67cd + a91178f commit ab4b64f

6 files changed

+29
-21
lines changed

CMakeLists.txt

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,6 @@ message(STATUS "SuperBuild - ITKPythonPackage_WHEEL_NAME:${ITKPythonPackage_WHEE
1717

1818
option(ITKPythonPackage_USE_TBB "Build and use oneTBB in the ITK python package" ON)
1919

20-
if(ITK_SOURCE_DIR)
21-
set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/lib/cmake/TBB")
22-
else()
23-
set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/lib/cmake/TBB")
24-
endif()
25-
set(tbb_args )
26-
if(ITKPythonPackage_USE_TBB)
27-
set(tbb_args
28-
-DModule_ITKTBB:BOOL=ON
29-
-DTBB_DIR:PATH=${TBB_DIR}
30-
)
31-
endif()
32-
3320
if(ITKPythonPackage_SUPERBUILD)
3421

3522
#-----------------------------------------------------------------------------
@@ -111,6 +98,18 @@ if(ITKPythonPackage_SUPERBUILD)
11198
endif()
11299

113100
if(ITKPythonPackage_USE_TBB)
101+
if(ITK_SOURCE_DIR)
102+
set(TBB_DIR "${ITK_SOURCE_DIR}/../oneTBB-prefix/lib/cmake/TBB")
103+
else()
104+
set(TBB_DIR "${CMAKE_BINARY_DIR}/../oneTBB-prefix/lib/cmake/TBB")
105+
endif()
106+
set(tbb_args )
107+
if(ITKPythonPackage_USE_TBB)
108+
set(tbb_args
109+
-DModule_ITKTBB:BOOL=ON
110+
-DTBB_DIR:PATH=${TBB_DIR}
111+
)
112+
endif()
114113

115114
set(tbb_cmake_cache_args)
116115
if(CMAKE_OSX_DEPLOYMENT_TARGET)

itkVersion.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
VERSION = "6.0b1"
1+
from packaging.version import Version
22

3+
# Version needs to be python PEP 440 compliant (no leading v)
4+
VERSION = '6.0b1'.removeprefix("v")
35

46
def get_versions():
57
"""Returns versions for the ITK Python package.
@@ -20,7 +22,10 @@ def get_versions():
2022
# '4.11.0.dev20170208+139.g922f2d9'
2123
get_versions()['package-version']
2224
"""
25+
26+
Version(VERSION) # Raise InvalidVersion exception if not PEP 440 compliant
27+
2328
versions = {}
24-
versions["version"] = VERSION
25-
versions["package-version"] = VERSION.split("+")[0]
29+
versions['version'] = VERSION
30+
versions['package-version'] = VERSION.split('+')[0]
2631
return versions

scripts/dockcross-manylinux-download-cache-and-build-module-wheels.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
# For example,
2020
#
2121
# export ITK_PACKAGE_VERSION="v5.4.0"
22-
# scripts/dockcross-manylinux-build-module-wheels.sh cp39
22+
# export ITKPYTHONPACKAGE_ORG="InsightSoftwareConsortium"
23+
# scripts/dockcross-manylinux-download-cache-and-build-module-wheels cp39
2324
#
2425
# `ITKPYTHONPACKAGE_ORG`: Github organization for fetching ITKPythonPackage build scripts.
2526
#

scripts/macpython-download-cache-and-build-module-wheels.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
# Versions can be restricted by passing them in as arguments to the script.
1111
# For example,
1212
#
13-
# scripts/macpython-build-module-wheels.sh 3.9 3.11
14-
# Shared libraries can be included in the wheel by exporting them to DYLD_LIBRARY_PATH before
13+
# scripts/macpython-download-cache-and-build-module-wheels.sh 3.9 3.11
14+
#
15+
# Shared libraries can be included in the wheel by setting DYLD_LIBRARY_PATH before
1516
# running this script.
1617
#
1718
# ===========================================
@@ -21,7 +22,6 @@
2122
# For example,
2223
#
2324
# export DYLD_LIBRARY_PATH="/path/to/libs"
24-
# scripts/macpython-build-module-wheels.sh 3.7 3.9
2525
#
2626
# `ITK_PACKAGE_VERSION`: ITKPythonBuilds archive tag to use for ITK build artifacts.
2727
# See https://github.com/InsightSoftwareConsortium/ITKPythonBuilds for available tags.

scripts/pyproject_configure.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
import os
2929
import re
3030
import sys
31-
import textwrap
3231

3332
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
3433

scripts/update_python_version.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import os
99
import subprocess
1010
from datetime import datetime
11+
from packaging.version import Version
1112

1213
argparser = argparse.ArgumentParser(description=__doc__)
1314
argparser.add_argument("itkSourceDir")
@@ -61,6 +62,9 @@
6162

6263
os.chdir(itkPythonPackageDir)
6364
itkVersionPath = os.path.join(itkPythonPackageDir, "itkVersion.py")
65+
66+
Version(VERSION) # Raise InvalidVersion exception if not PEP 440 compliant
67+
6468
if not os.path.exists(itkVersionPath):
6569
print("Expected file " + itkVersionPath + " not found!")
6670
sys.exit(1)

0 commit comments

Comments
 (0)