diff --git a/mmpose/__init__.py b/mmpose/__init__.py index c499da88d0..dc812f996d 100644 --- a/mmpose/__init__.py +++ b/mmpose/__init__.py @@ -1,29 +1,27 @@ # Copyright (c) OpenMMLab. All rights reserved. import mmcv +import mmengine +from mmengine.utils import digit_version from .version import __version__, short_version - -def digit_version(version_str): - digit_version = [] - for x in version_str.split('.'): - if x.isdigit(): - digit_version.append(int(x)) - elif x.find('rc') != -1: - patch_version = x.split('rc') - digit_version.append(int(patch_version[0]) - 1) - digit_version.append(int(patch_version[1])) - return digit_version - - mmcv_minimum_version = '2.0.0rc0' mmcv_maximum_version = '2.1.0' mmcv_version = digit_version(mmcv.__version__) +mmengine_minimum_version = '0.1.0' +mmengine_maximum_version = '1.0.0' +mmengine_version = digit_version(mmengine.__version__) assert (mmcv_version >= digit_version(mmcv_minimum_version) and mmcv_version <= digit_version(mmcv_maximum_version)), \ f'MMCV=={mmcv.__version__} is used but incompatible. ' \ f'Please install mmcv>={mmcv_minimum_version}, <={mmcv_maximum_version}.' +assert (mmengine_version >= digit_version(mmengine_minimum_version) + and mmengine_version <= digit_version(mmengine_maximum_version)), \ + f'MMEngine=={mmengine.__version__} is used but incompatible. ' \ + f'Please install mmengine>={mmengine_minimum_version}, ' \ + f'<={mmengine_maximum_version}.' + __all__ = ['__version__', 'short_version'] diff --git a/mmpose/version.py b/mmpose/version.py index 3f8c305f78..b4c1cb728e 100644 --- a/mmpose/version.py +++ b/mmpose/version.py @@ -5,6 +5,14 @@ def parse_version_info(version_str): + """Parse a version string into a tuple. + + Args: + version_str (str): The version string. + Returns: + tuple[int | str]: The version info, e.g., "1.3.0" is parsed into + (1, 3, 0), and "2.0.0rc1" is parsed into (2, 0, 0, 'rc1'). + """ version_info = [] for x in version_str.split('.'): if x.isdigit(): diff --git a/requirements/poseval.txt b/requirements/poseval.txt index 3e2a59ec01..f4d95e1afa 100644 --- a/requirements/poseval.txt +++ b/requirements/poseval.txt @@ -1 +1,2 @@ poseval@git+https://github.com/svenkreiss/poseval.git +shapely==1.8.4