From 8484dbdd137c920967ec7d735d49e8dd1b44f84d Mon Sep 17 00:00:00 2001 From: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com> Date: Wed, 11 Oct 2023 09:37:53 +0800 Subject: [PATCH] hack for testing in dev version Signed-off-by: Mingxin Zheng <18563433+mingxin-zheng@users.noreply.github.com> --- ci/get_bundle_requirements.py | 8 +++++++- models/spleen_deepedit_annotation/configs/metadata.json | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ci/get_bundle_requirements.py b/ci/get_bundle_requirements.py index 4318f183..a4dc097e 100644 --- a/ci/get_bundle_requirements.py +++ b/ci/get_bundle_requirements.py @@ -12,10 +12,13 @@ import argparse import os +import re from bundle_custom_data import install_dependency_dict from utils import get_json_dict +def is_commit_hash(s): + return bool(re.match('^[0-9a-f]{7,40}$', s)) def get_requirements(bundle, models_path): """ @@ -29,7 +32,10 @@ def get_requirements(bundle, models_path): libs = [] if "monai_version" in metadata.keys(): monai_version = metadata["monai_version"] - libs.append(f"monai=={monai_version}") + if is_commit_hash(monai_version): + libs.append(f"git+https://github.com/Project-MONAI/MONAI@${monai_version}#egg=monai") + else: + libs.append(f"monai=={monai_version}") if "pytorch_version" in metadata.keys(): pytorch_version = metadata["pytorch_version"] libs.append(f"torch=={pytorch_version}") diff --git a/models/spleen_deepedit_annotation/configs/metadata.json b/models/spleen_deepedit_annotation/configs/metadata.json index a96ccf5c..15f6ddd0 100644 --- a/models/spleen_deepedit_annotation/configs/metadata.json +++ b/models/spleen_deepedit_annotation/configs/metadata.json @@ -28,7 +28,7 @@ "0.1.0": "complete the model package", "0.0.1": "initialize the model package structure" }, - "monai_version": "1.2.0", + "monai_version": "fc1350aae1de702404189f334ac17fd6f51321d0", "pytorch_version": "1.13.1", "numpy_version": "1.22.2", "optional_packages_version": {