From 8ba80176a540b4cdf65127dc9e4dd2b833b2ec6b Mon Sep 17 00:00:00 2001 From: Miao Zheng <76149310+MeowZheng@users.noreply.github.com> Date: Wed, 31 Aug 2022 18:46:43 +0800 Subject: [PATCH] [Enhancement] version check codebase from openmmlab (#2006) --- mmseg/__init__.py | 13 +++++++++++-- requirements/mminstall.txt | 5 +++-- requirements/runtime.txt | 2 +- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/mmseg/__init__.py b/mmseg/__init__.py index 8ffaf446b..addfaeedd 100644 --- a/mmseg/__init__.py +++ b/mmseg/__init__.py @@ -2,12 +2,14 @@ import warnings import mmcv +import mmengine from packaging.version import parse from .version import __version__, version_info -MMCV_MIN = '2.0.0rc0' -MMCV_MAX = '2.0.0' +MMCV_MIN = '2.0.0rc1' +MMCV_MAX = '2.1.0' +MMENGINE_MIN = '0.5.0' def digit_version(version_str: str, length: int = 4): @@ -59,4 +61,11 @@ assert (mmcv_min_version <= mmcv_version < mmcv_max_version), \ f'MMCV=={mmcv.__version__} is used but incompatible. ' \ f'Please install mmcv>={mmcv_min_version}, <{mmcv_max_version}.' +mmengine_min_version = digit_version(MMENGINE_MIN) +mmengine_version = digit_version(mmengine.__version__) + +assert (mmengine_min_version <= mmengine_version), \ + f'MMEngine=={mmengine.__version__} is used but incompatible. ' \ + f'Please install mmengine>={mmengine_min_version}.' + __all__ = ['__version__', 'version_info', 'digit_version'] diff --git a/requirements/mminstall.txt b/requirements/mminstall.txt index 91571a9c2..a06084502 100644 --- a/requirements/mminstall.txt +++ b/requirements/mminstall.txt @@ -1,2 +1,3 @@ -mmcls>=0.20.1 -mmcv-full>=2.0.0,<=2.0.0rc0 +mmcls>=1.0.0rc0 +mmcv>=2.0.0rc1,<2.1.0 +mmengine>=0.5 diff --git a/requirements/runtime.txt b/requirements/runtime.txt index 520408fe8..82b392e74 100644 --- a/requirements/runtime.txt +++ b/requirements/runtime.txt @@ -1,5 +1,5 @@ matplotlib -mmcls>=0.20.1 +mmcls>=1.0.0rc0 numpy packaging prettytable