@@ -728,9 +728,7 @@ def _update_module_itk_deps(pyproject_path: Path, itk_version: str) -> bool:
728728 pyproject_data = tomllib .load (f )
729729
730730 # --- Strategy 3: module declares dynamic dependencies -----------------
731- dynamic_fields = (
732- pyproject_data .get ("project" , {}).get ("dynamic" , [])
733- )
731+ dynamic_fields = pyproject_data .get ("project" , {}).get ("dynamic" , [])
734732 if "dependencies" in dynamic_fields :
735733 # The module has opted into dynamic dependency resolution.
736734 # Set ITK_PACKAGE_VERSION in the environment so the
@@ -739,7 +737,7 @@ def _update_module_itk_deps(pyproject_path: Path, itk_version: str) -> bool:
739737 os .environ ["ITK_PACKAGE_VERSION" ] = itk_version
740738 print (
741739 f"Strategy 3: { pyproject_path .name } declares "
742- f" dynamic=[\ " dependencies\ " ]; set ITK_PACKAGE_VERSION="
740+ f' dynamic=["dependencies"]; set ITK_PACKAGE_VERSION='
743741 f"{ itk_version } for metadata provider"
744742 )
745743 return False # no file modification needed
@@ -760,9 +758,7 @@ def _update_module_itk_deps(pyproject_path: Path, itk_version: str) -> bool:
760758 "itk-segmentation" ,
761759 )
762760 _base_pkg_alt = "|" .join (re .escape (p ) for p in _ITK_BASE_PACKAGES )
763- pattern = re .compile (
764- rf'"({ _base_pkg_alt } )\s*==\s*[\d]+\.[\d]+\.\*"'
765- )
761+ pattern = re .compile (rf'"({ _base_pkg_alt } )\s*==\s*[\d]+\.[\d]+\.\*"' )
766762
767763 # Warn about pinned remote-module cross-deps that may also need
768764 # attention but should not be auto-rewritten.
@@ -790,6 +786,7 @@ def _update_module_itk_deps(pyproject_path: Path, itk_version: str) -> bool:
790786 min_floor = itk_version
791787
792788 changed = False
789+
793790 def _replace (m : re .Match ) -> str :
794791 nonlocal changed
795792 changed = True
@@ -822,9 +819,7 @@ def build_external_module_python_wheel(self):
822819 itk_ver = self .package_env_config .get ("ITK_PACKAGE_VERSION" , "" )
823820 if itk_ver :
824821 shutil .copy2 (module_pyproject , pyproject_orig )
825- deps_rewritten = self ._update_module_itk_deps (
826- module_pyproject , itk_ver
827- )
822+ deps_rewritten = self ._update_module_itk_deps (module_pyproject , itk_ver )
828823
829824 # Ensure venv tools are first in PATH
830825 py_exe = str (self .package_env_config ["PYTHON_EXECUTABLE" ]) # Python3_EXECUTABLE
0 commit comments