From f067a7004e8967fe26144085f69722029daeb353 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:25:25 +0100 Subject: [PATCH 1/8] Need to install dependencies now Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- setup.py | 261 ++++++++++++++++++++++++++++--------------------------- 1 file changed, 131 insertions(+), 130 deletions(-) diff --git a/setup.py b/setup.py index 2ebc7a9ba6..301e67b9f4 100644 --- a/setup.py +++ b/setup.py @@ -31,136 +31,137 @@ BUILD_CPP = BUILD_CUDA = False TORCH_VERSION = 0 -try: - import torch - - print(f"setup.py with torch {torch.__version__}") - from torch.utils.cpp_extension import BuildExtension, CppExtension - - BUILD_CPP = True - from torch.utils.cpp_extension import CUDA_HOME, CUDAExtension - - BUILD_CUDA = FORCE_CUDA or (torch.cuda.is_available() and (CUDA_HOME is not None)) - - _pt_version = version.parse(torch.__version__).release - if _pt_version is None or len(_pt_version) < 3: - raise AssertionError("unknown torch version") - TORCH_VERSION = int(_pt_version[0]) * 10000 + int(_pt_version[1]) * 100 + int(_pt_version[2]) -except (ImportError, TypeError, AssertionError, AttributeError) as e: - warnings.warn(f"extension build skipped: {e}") -finally: - if not RUN_BUILD: - BUILD_CPP = BUILD_CUDA = False - print("Please set environment variable `BUILD_MONAI=1` to enable Cpp/CUDA extension build.") - print(f"BUILD_MONAI_CPP={BUILD_CPP}, BUILD_MONAI_CUDA={BUILD_CUDA}, TORCH_VERSION={TORCH_VERSION}.") - - -def torch_parallel_backend(): - try: - match = re.search("^ATen parallel backend: (?P.*)$", torch._C._parallel_info(), re.MULTILINE) - if match is None: - return None - backend = match.group("backend") - if backend == "OpenMP": - return "AT_PARALLEL_OPENMP" - if backend == "native thread pool": - return "AT_PARALLEL_NATIVE" - if backend == "native thread pool and TBB": - return "AT_PARALLEL_NATIVE_TBB" - except (NameError, AttributeError): # no torch or no binaries - warnings.warn("Could not determine torch parallel_info.") - return None - - -def omp_flags(): - if sys.platform == "win32": - return ["/openmp"] - if sys.platform == "darwin": - # https://stackoverflow.com/questions/37362414/ - # return ["-fopenmp=libiomp5"] - return [] - return ["-fopenmp"] - - -def get_extensions(): - this_dir = os.path.dirname(os.path.abspath(__file__)) - ext_dir = os.path.join(this_dir, "monai", "csrc") - include_dirs = [ext_dir] - - source_cpu = glob.glob(os.path.join(ext_dir, "**", "*.cpp"), recursive=True) - source_cuda = glob.glob(os.path.join(ext_dir, "**", "*.cu"), recursive=True) - - extension = None - define_macros = [(f"{torch_parallel_backend()}", 1), ("MONAI_TORCH_VERSION", TORCH_VERSION)] - extra_compile_args = {} - extra_link_args = [] - sources = source_cpu - if BUILD_CPP: - extension = CppExtension - extra_compile_args.setdefault("cxx", []) - if torch_parallel_backend() == "AT_PARALLEL_OPENMP": - extra_compile_args["cxx"] += omp_flags() - extra_link_args = omp_flags() - if BUILD_CUDA: - extension = CUDAExtension - sources += source_cuda - define_macros += [("WITH_CUDA", None)] - # Embed the maximum compute capability from TORCH_CUDA_ARCH_LIST - _torch_cuda_arch_list = os.environ.get("TORCH_CUDA_ARCH_LIST", "") - _max_cc = 0 - if _torch_cuda_arch_list: - for _maj, _min in re.findall(r"([0-9]+)\.([0-9]+)", _torch_cuda_arch_list): - try: - _cc = int(_maj) * 100 + int(_min) - if _cc > _max_cc: - _max_cc = _cc - except ValueError: - pass - if _max_cc > 0: - define_macros += [("MONAI_MAX_COMPUTE_CAPABILITY", _max_cc)] - extra_compile_args = {"cxx": [], "nvcc": []} - if torch_parallel_backend() == "AT_PARALLEL_OPENMP": - extra_compile_args["cxx"] += omp_flags() - if extension is None or not sources: - return [] # compile nothing - - ext_modules = [ - extension( - name="monai._C", - sources=list(map(os.path.relpath, sources)), - include_dirs=include_dirs, - define_macros=define_macros, - extra_compile_args=extra_compile_args, - extra_link_args=extra_link_args, - ) - ] - return ext_modules - - -def get_cmds(): - cmds = versioneer.get_cmdclass() - - if not (BUILD_CPP or BUILD_CUDA): - return cmds - - cmds.update({"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}) - return cmds - - -# Gathering source used for JIT extensions to include in package_data. -jit_extension_source = [] - -for ext in ["cpp", "cu", "h", "cuh"]: - glob_path = os.path.join("monai", "_extensions", "**", f"*.{ext}") - jit_extension_source += glob.glob(glob_path, recursive=True) - -jit_extension_source = [os.path.join("..", path) for path in jit_extension_source] +# try: +# import torch + +# print(f"setup.py with torch {torch.__version__}") +# from torch.utils.cpp_extension import BuildExtension, CppExtension + +# BUILD_CPP = True +# from torch.utils.cpp_extension import CUDA_HOME, CUDAExtension + +# BUILD_CUDA = FORCE_CUDA or (torch.cuda.is_available() and (CUDA_HOME is not None)) + +# _pt_version = version.parse(torch.__version__).release +# if _pt_version is None or len(_pt_version) < 3: +# raise AssertionError("unknown torch version") +# TORCH_VERSION = int(_pt_version[0]) * 10000 + int(_pt_version[1]) * 100 + int(_pt_version[2]) +# except (ImportError, TypeError, AssertionError, AttributeError) as e: +# warnings.warn(f"extension build skipped: {e}") +# finally: +# if not RUN_BUILD: +# BUILD_CPP = BUILD_CUDA = False +# print("Please set environment variable `BUILD_MONAI=1` to enable Cpp/CUDA extension build.") +# print(f"BUILD_MONAI_CPP={BUILD_CPP}, BUILD_MONAI_CUDA={BUILD_CUDA}, TORCH_VERSION={TORCH_VERSION}.") + + +# def torch_parallel_backend(): +# try: +# match = re.search("^ATen parallel backend: (?P.*)$", torch._C._parallel_info(), re.MULTILINE) +# if match is None: +# return None +# backend = match.group("backend") +# if backend == "OpenMP": +# return "AT_PARALLEL_OPENMP" +# if backend == "native thread pool": +# return "AT_PARALLEL_NATIVE" +# if backend == "native thread pool and TBB": +# return "AT_PARALLEL_NATIVE_TBB" +# except (NameError, AttributeError): # no torch or no binaries +# warnings.warn("Could not determine torch parallel_info.") +# return None + + +# def omp_flags(): +# if sys.platform == "win32": +# return ["/openmp"] +# if sys.platform == "darwin": +# # https://stackoverflow.com/questions/37362414/ +# # return ["-fopenmp=libiomp5"] +# return [] +# return ["-fopenmp"] + + +# def get_extensions(): +# this_dir = os.path.dirname(os.path.abspath(__file__)) +# ext_dir = os.path.join(this_dir, "monai", "csrc") +# include_dirs = [ext_dir] + +# source_cpu = glob.glob(os.path.join(ext_dir, "**", "*.cpp"), recursive=True) +# source_cuda = glob.glob(os.path.join(ext_dir, "**", "*.cu"), recursive=True) + +# extension = None +# define_macros = [(f"{torch_parallel_backend()}", 1), ("MONAI_TORCH_VERSION", TORCH_VERSION)] +# extra_compile_args = {} +# extra_link_args = [] +# sources = source_cpu +# if BUILD_CPP: +# extension = CppExtension +# extra_compile_args.setdefault("cxx", []) +# if torch_parallel_backend() == "AT_PARALLEL_OPENMP": +# extra_compile_args["cxx"] += omp_flags() +# extra_link_args = omp_flags() +# if BUILD_CUDA: +# extension = CUDAExtension +# sources += source_cuda +# define_macros += [("WITH_CUDA", None)] +# # Embed the maximum compute capability from TORCH_CUDA_ARCH_LIST +# _torch_cuda_arch_list = os.environ.get("TORCH_CUDA_ARCH_LIST", "") +# _max_cc = 0 +# if _torch_cuda_arch_list: +# for _maj, _min in re.findall(r"([0-9]+)\.([0-9]+)", _torch_cuda_arch_list): +# try: +# _cc = int(_maj) * 100 + int(_min) +# if _cc > _max_cc: +# _max_cc = _cc +# except ValueError: +# pass +# if _max_cc > 0: +# define_macros += [("MONAI_MAX_COMPUTE_CAPABILITY", _max_cc)] +# extra_compile_args = {"cxx": [], "nvcc": []} +# if torch_parallel_backend() == "AT_PARALLEL_OPENMP": +# extra_compile_args["cxx"] += omp_flags() +# if extension is None or not sources: +# return [] # compile nothing + +# ext_modules = [ +# extension( +# name="monai._C", +# sources=list(map(os.path.relpath, sources)), +# include_dirs=include_dirs, +# define_macros=define_macros, +# extra_compile_args=extra_compile_args, +# extra_link_args=extra_link_args, +# ) +# ] +# return ext_modules + + +# def get_cmds(): +# cmds = versioneer.get_cmdclass() + +# if not (BUILD_CPP or BUILD_CUDA): +# return cmds + +# cmds.update({"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}) +# return cmds + + +# # Gathering source used for JIT extensions to include in package_data. +# jit_extension_source = [] + +# for ext in ["cpp", "cu", "h", "cuh"]: +# glob_path = os.path.join("monai", "_extensions", "**", f"*.{ext}") +# jit_extension_source += glob.glob(glob_path, recursive=True) + +# jit_extension_source = [os.path.join("..", path) for path in jit_extension_source] + setup( - version=versioneer.get_version(), - cmdclass=get_cmds(), - packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")), - zip_safe=False, - package_data=cast(Any, {"monai": ["py.typed", *jit_extension_source]}), - ext_modules=get_extensions(), + # version=versioneer.get_version(), + # cmdclass=get_cmds(), + # packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")), + # zip_safe=False, + # package_data=cast(Any, {"monai": ["py.typed", *jit_extension_source]}), + # ext_modules=get_extensions(), ) From 8d92e477b5c9fdcbff0ce40b52ecd07e7e0c5428 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:38:11 +0100 Subject: [PATCH 2/8] Add fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 6 +- setup.py | 260 +++++++++++++-------------- 2 files changed, 135 insertions(+), 131 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 3640ceefd0..e46427d30e 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -6,6 +6,9 @@ permissions: on: schedule: - cron: "0 2 * * 0" # 02:00 of every Sunday + pull_request: # temporarily enable for PR + branches: + - dev jobs: static-checks: @@ -55,7 +58,7 @@ jobs: python-version: '3.10' - name: Install setuptools run: | - python -m pip install --user --upgrade setuptools wheel packaging + python -m pip install --user --upgrade pip setuptools wheel packaging - name: Build distribution run: | export HEAD_COMMIT_ID=$(git rev-parse HEAD) @@ -72,6 +75,7 @@ jobs: git tag "1.7.dev${YEAR_WEEK}" git log -1 git tag --list + pip install . --extra-index-url "https://download.pytorch.org/whl/cpu" python setup.py sdist bdist_wheel - name: Publish to PyPI diff --git a/setup.py b/setup.py index 301e67b9f4..a6d80023ce 100644 --- a/setup.py +++ b/setup.py @@ -31,137 +31,137 @@ BUILD_CPP = BUILD_CUDA = False TORCH_VERSION = 0 -# try: -# import torch - -# print(f"setup.py with torch {torch.__version__}") -# from torch.utils.cpp_extension import BuildExtension, CppExtension - -# BUILD_CPP = True -# from torch.utils.cpp_extension import CUDA_HOME, CUDAExtension - -# BUILD_CUDA = FORCE_CUDA or (torch.cuda.is_available() and (CUDA_HOME is not None)) - -# _pt_version = version.parse(torch.__version__).release -# if _pt_version is None or len(_pt_version) < 3: -# raise AssertionError("unknown torch version") -# TORCH_VERSION = int(_pt_version[0]) * 10000 + int(_pt_version[1]) * 100 + int(_pt_version[2]) -# except (ImportError, TypeError, AssertionError, AttributeError) as e: -# warnings.warn(f"extension build skipped: {e}") -# finally: -# if not RUN_BUILD: -# BUILD_CPP = BUILD_CUDA = False -# print("Please set environment variable `BUILD_MONAI=1` to enable Cpp/CUDA extension build.") -# print(f"BUILD_MONAI_CPP={BUILD_CPP}, BUILD_MONAI_CUDA={BUILD_CUDA}, TORCH_VERSION={TORCH_VERSION}.") - - -# def torch_parallel_backend(): -# try: -# match = re.search("^ATen parallel backend: (?P.*)$", torch._C._parallel_info(), re.MULTILINE) -# if match is None: -# return None -# backend = match.group("backend") -# if backend == "OpenMP": -# return "AT_PARALLEL_OPENMP" -# if backend == "native thread pool": -# return "AT_PARALLEL_NATIVE" -# if backend == "native thread pool and TBB": -# return "AT_PARALLEL_NATIVE_TBB" -# except (NameError, AttributeError): # no torch or no binaries -# warnings.warn("Could not determine torch parallel_info.") -# return None - - -# def omp_flags(): -# if sys.platform == "win32": -# return ["/openmp"] -# if sys.platform == "darwin": -# # https://stackoverflow.com/questions/37362414/ -# # return ["-fopenmp=libiomp5"] -# return [] -# return ["-fopenmp"] - - -# def get_extensions(): -# this_dir = os.path.dirname(os.path.abspath(__file__)) -# ext_dir = os.path.join(this_dir, "monai", "csrc") -# include_dirs = [ext_dir] - -# source_cpu = glob.glob(os.path.join(ext_dir, "**", "*.cpp"), recursive=True) -# source_cuda = glob.glob(os.path.join(ext_dir, "**", "*.cu"), recursive=True) - -# extension = None -# define_macros = [(f"{torch_parallel_backend()}", 1), ("MONAI_TORCH_VERSION", TORCH_VERSION)] -# extra_compile_args = {} -# extra_link_args = [] -# sources = source_cpu -# if BUILD_CPP: -# extension = CppExtension -# extra_compile_args.setdefault("cxx", []) -# if torch_parallel_backend() == "AT_PARALLEL_OPENMP": -# extra_compile_args["cxx"] += omp_flags() -# extra_link_args = omp_flags() -# if BUILD_CUDA: -# extension = CUDAExtension -# sources += source_cuda -# define_macros += [("WITH_CUDA", None)] -# # Embed the maximum compute capability from TORCH_CUDA_ARCH_LIST -# _torch_cuda_arch_list = os.environ.get("TORCH_CUDA_ARCH_LIST", "") -# _max_cc = 0 -# if _torch_cuda_arch_list: -# for _maj, _min in re.findall(r"([0-9]+)\.([0-9]+)", _torch_cuda_arch_list): -# try: -# _cc = int(_maj) * 100 + int(_min) -# if _cc > _max_cc: -# _max_cc = _cc -# except ValueError: -# pass -# if _max_cc > 0: -# define_macros += [("MONAI_MAX_COMPUTE_CAPABILITY", _max_cc)] -# extra_compile_args = {"cxx": [], "nvcc": []} -# if torch_parallel_backend() == "AT_PARALLEL_OPENMP": -# extra_compile_args["cxx"] += omp_flags() -# if extension is None or not sources: -# return [] # compile nothing - -# ext_modules = [ -# extension( -# name="monai._C", -# sources=list(map(os.path.relpath, sources)), -# include_dirs=include_dirs, -# define_macros=define_macros, -# extra_compile_args=extra_compile_args, -# extra_link_args=extra_link_args, -# ) -# ] -# return ext_modules - - -# def get_cmds(): -# cmds = versioneer.get_cmdclass() - -# if not (BUILD_CPP or BUILD_CUDA): -# return cmds - -# cmds.update({"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}) -# return cmds - - -# # Gathering source used for JIT extensions to include in package_data. -# jit_extension_source = [] - -# for ext in ["cpp", "cu", "h", "cuh"]: -# glob_path = os.path.join("monai", "_extensions", "**", f"*.{ext}") -# jit_extension_source += glob.glob(glob_path, recursive=True) - -# jit_extension_source = [os.path.join("..", path) for path in jit_extension_source] +try: + import torch + + print(f"setup.py with torch {torch.__version__}") + from torch.utils.cpp_extension import BuildExtension, CppExtension + + BUILD_CPP = True + from torch.utils.cpp_extension import CUDA_HOME, CUDAExtension + + BUILD_CUDA = FORCE_CUDA or (torch.cuda.is_available() and (CUDA_HOME is not None)) + + _pt_version = version.parse(torch.__version__).release + if _pt_version is None or len(_pt_version) < 3: + raise AssertionError("unknown torch version") + TORCH_VERSION = int(_pt_version[0]) * 10000 + int(_pt_version[1]) * 100 + int(_pt_version[2]) +except (ImportError, TypeError, AssertionError, AttributeError) as e: + warnings.warn(f"extension build skipped: {e}") +finally: + if not RUN_BUILD: + BUILD_CPP = BUILD_CUDA = False + print("Please set environment variable `BUILD_MONAI=1` to enable Cpp/CUDA extension build.") + print(f"BUILD_MONAI_CPP={BUILD_CPP}, BUILD_MONAI_CUDA={BUILD_CUDA}, TORCH_VERSION={TORCH_VERSION}.") + + +def torch_parallel_backend(): + try: + match = re.search("^ATen parallel backend: (?P.*)$", torch._C._parallel_info(), re.MULTILINE) + if match is None: + return None + backend = match.group("backend") + if backend == "OpenMP": + return "AT_PARALLEL_OPENMP" + if backend == "native thread pool": + return "AT_PARALLEL_NATIVE" + if backend == "native thread pool and TBB": + return "AT_PARALLEL_NATIVE_TBB" + except (NameError, AttributeError): # no torch or no binaries + warnings.warn("Could not determine torch parallel_info.") + return None + + +def omp_flags(): + if sys.platform == "win32": + return ["/openmp"] + if sys.platform == "darwin": + # https://stackoverflow.com/questions/37362414/ + # return ["-fopenmp=libiomp5"] + return [] + return ["-fopenmp"] + + +def get_extensions(): + this_dir = os.path.dirname(os.path.abspath(__file__)) + ext_dir = os.path.join(this_dir, "monai", "csrc") + include_dirs = [ext_dir] + + source_cpu = glob.glob(os.path.join(ext_dir, "**", "*.cpp"), recursive=True) + source_cuda = glob.glob(os.path.join(ext_dir, "**", "*.cu"), recursive=True) + + extension = None + define_macros = [(f"{torch_parallel_backend()}", 1), ("MONAI_TORCH_VERSION", TORCH_VERSION)] + extra_compile_args = {} + extra_link_args = [] + sources = source_cpu + if BUILD_CPP: + extension = CppExtension + extra_compile_args.setdefault("cxx", []) + if torch_parallel_backend() == "AT_PARALLEL_OPENMP": + extra_compile_args["cxx"] += omp_flags() + extra_link_args = omp_flags() + if BUILD_CUDA: + extension = CUDAExtension + sources += source_cuda + define_macros += [("WITH_CUDA", None)] + # Embed the maximum compute capability from TORCH_CUDA_ARCH_LIST + _torch_cuda_arch_list = os.environ.get("TORCH_CUDA_ARCH_LIST", "") + _max_cc = 0 + if _torch_cuda_arch_list: + for _maj, _min in re.findall(r"([0-9]+)\.([0-9]+)", _torch_cuda_arch_list): + try: + _cc = int(_maj) * 100 + int(_min) + if _cc > _max_cc: + _max_cc = _cc + except ValueError: + pass + if _max_cc > 0: + define_macros += [("MONAI_MAX_COMPUTE_CAPABILITY", _max_cc)] + extra_compile_args = {"cxx": [], "nvcc": []} + if torch_parallel_backend() == "AT_PARALLEL_OPENMP": + extra_compile_args["cxx"] += omp_flags() + if extension is None or not sources: + return [] # compile nothing + + ext_modules = [ + extension( + name="monai._C", + sources=list(map(os.path.relpath, sources)), + include_dirs=include_dirs, + define_macros=define_macros, + extra_compile_args=extra_compile_args, + extra_link_args=extra_link_args, + ) + ] + return ext_modules + + +def get_cmds(): + cmds = versioneer.get_cmdclass() + + if not (BUILD_CPP or BUILD_CUDA): + return cmds + + cmds.update({"build_ext": BuildExtension.with_options(no_python_abi_suffix=True)}) + return cmds + + +# Gathering source used for JIT extensions to include in package_data. +jit_extension_source = [] + +for ext in ["cpp", "cu", "h", "cuh"]: + glob_path = os.path.join("monai", "_extensions", "**", f"*.{ext}") + jit_extension_source += glob.glob(glob_path, recursive=True) + +jit_extension_source = [os.path.join("..", path) for path in jit_extension_source] setup( - # version=versioneer.get_version(), - # cmdclass=get_cmds(), - # packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")), - # zip_safe=False, - # package_data=cast(Any, {"monai": ["py.typed", *jit_extension_source]}), - # ext_modules=get_extensions(), + version=versioneer.get_version(), + cmdclass=get_cmds(), + packages=find_packages(exclude=("docs", "examples", "tests", "tests.*")), + zip_safe=False, + package_data=cast(Any, {"monai": ["py.typed", *jit_extension_source]}), + ext_modules=get_extensions(), ) From 5a2d7e0797672a4ccbd929dfb77f1e27a019c22d Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 17:52:24 +0100 Subject: [PATCH 3/8] Try guarding suggestion Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index e46427d30e..da80b231ca 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -9,9 +9,12 @@ on: pull_request: # temporarily enable for PR branches: - dev + - main + - releasing/* jobs: static-checks: + if: github.event_name == 'schedule' runs-on: ubuntu-latest strategy: matrix: @@ -79,6 +82,7 @@ jobs: python setup.py sdist bdist_wheel - name: Publish to PyPI + if: github.event_name == 'schedule' uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ From 5c2fef1d818b66a0fc86ef74575078d962c99aab Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:01:02 +0100 Subject: [PATCH 4/8] Adding install test Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 8 ++++++-- setup.py | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index da80b231ca..089ca5ac72 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -9,8 +9,6 @@ on: pull_request: # temporarily enable for PR branches: - dev - - main - - releasing/* jobs: static-checks: @@ -59,6 +57,7 @@ jobs: uses: actions/setup-python@v6 with: python-version: '3.10' + cache: 'pip' - name: Install setuptools run: | python -m pip install --user --upgrade pip setuptools wheel packaging @@ -81,6 +80,11 @@ jobs: pip install . --extra-index-url "https://download.pytorch.org/whl/cpu" python setup.py sdist bdist_wheel + - name: Test Installation + run: | + pip uninstall monai -y + pip install dist/*.whl + - name: Publish to PyPI if: github.event_name == 'schedule' uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/setup.py b/setup.py index a6d80023ce..2ebc7a9ba6 100644 --- a/setup.py +++ b/setup.py @@ -156,7 +156,6 @@ def get_cmds(): jit_extension_source = [os.path.join("..", path) for path in jit_extension_source] - setup( version=versioneer.get_version(), cmdclass=get_cmds(), From 493ef68775775f0fbc27ec1ace0bcd94f15b38ab Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:08:24 +0100 Subject: [PATCH 5/8] Update Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 089ca5ac72..751d0de6ad 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -6,13 +6,13 @@ permissions: on: schedule: - cron: "0 2 * * 0" # 02:00 of every Sunday - pull_request: # temporarily enable for PR + pull_request: branches: - dev jobs: static-checks: - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' # only check on cron run runs-on: ubuntu-latest strategy: matrix: @@ -79,14 +79,14 @@ jobs: git tag --list pip install . --extra-index-url "https://download.pytorch.org/whl/cpu" python setup.py sdist bdist_wheel - + ls -lh dist - name: Test Installation run: | pip uninstall monai -y pip install dist/*.whl - + pip list - name: Publish to PyPI - if: github.event_name == 'schedule' + if: github.event_name == 'schedule' # only publish on cron run uses: pypa/gh-action-pypi-publish@release/v1 with: user: __token__ From eb455ad7b73dcbcabb4c55d07cc8c704b7f7ccf4 Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:09:10 +0100 Subject: [PATCH 6/8] Update Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 751d0de6ad..3f0bb57879 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -82,7 +82,7 @@ jobs: ls -lh dist - name: Test Installation run: | - pip uninstall monai -y + pip uninstall monai-weekly -y pip install dist/*.whl pip list - name: Publish to PyPI From 77531d23a1f34f95118d629a94567c20ad2e975b Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Tue, 25 Aug 2026 18:16:05 +0100 Subject: [PATCH 7/8] Fix Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index 3f0bb57879..b7d4f3cb48 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -6,7 +6,7 @@ permissions: on: schedule: - cron: "0 2 * * 0" # 02:00 of every Sunday - pull_request: + pull_request: branches: - dev From 219bb1b0e2be4dbb41c9f593539ab16ad381b1ec Mon Sep 17 00:00:00 2001 From: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> Date: Wed, 26 Aug 2026 12:48:07 +0100 Subject: [PATCH 8/8] Try with build instead Signed-off-by: Eric Kerfoot <17726042+ericspod@users.noreply.github.com> --- .github/workflows/weekly-preview.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/weekly-preview.yml b/.github/workflows/weekly-preview.yml index b7d4f3cb48..6cdc6c957f 100644 --- a/.github/workflows/weekly-preview.yml +++ b/.github/workflows/weekly-preview.yml @@ -12,7 +12,7 @@ on: jobs: static-checks: - if: github.event_name == 'schedule' # only check on cron run + if: github.event_name == 'schedule' # only check on cron run, these checks are redundant in a PR runs-on: ubuntu-latest strategy: matrix: @@ -60,7 +60,7 @@ jobs: cache: 'pip' - name: Install setuptools run: | - python -m pip install --user --upgrade pip setuptools wheel packaging + python -m pip install -U pip build - name: Build distribution run: | export HEAD_COMMIT_ID=$(git rev-parse HEAD) @@ -77,12 +77,10 @@ jobs: git tag "1.7.dev${YEAR_WEEK}" git log -1 git tag --list - pip install . --extra-index-url "https://download.pytorch.org/whl/cpu" - python setup.py sdist bdist_wheel + python -m build --config-setting="--extra-index-url=https://download.pytorch.org/whl/cpu" ls -lh dist - name: Test Installation run: | - pip uninstall monai-weekly -y pip install dist/*.whl pip list - name: Publish to PyPI