Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Enhancement] Add digital version #43

Merged
merged 2 commits into from
Dec 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions mmflow/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,28 @@
from .version import __version__, parse_version_info, version_info
# Copyright (c) OpenMMLab. All rights reserved.
import mmcv

__all__ = ['__version__', 'version_info', 'parse_version_info']
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 = '1.3.15'
mmcv_maximum_version = '1.5.0'
mmcv_version = digit_version(mmcv.__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}.'

__all__ = ['__version__', 'short_version']
3 changes: 3 additions & 0 deletions mmflow/version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# Copyright (c) OpenMMLab. All rights reserved.

__version__ = '0.1.0'
short_version = __version__


def parse_version_info(version_str):
Expand Down
1 change: 1 addition & 0 deletions requirements/mminstall.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
mmcv-full>=1.3.15
mmcv-full<=1.5.0