-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Modify codes about version info #189
Changes from all commits
356a6ca
782a6d2
feb4f21
20001d5
157c289
1fcfe7a
5af19f9
fb1a5b5
52276da
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -105,7 +105,6 @@ venv.bak/ | |
.mypy_cache/ | ||
|
||
# custom | ||
mmaction/version.py | ||
/data | ||
.vscode | ||
.idea | ||
|
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
import mmcv | ||
from mmcv import digit_version | ||
|
||
from .version import __version__, short_version | ||
|
||
mmcv_minimum_version = '1.1.1' | ||
mmcv_version = digit_version(mmcv.__version__) | ||
|
||
assert digit_version(mmcv_minimum_version) <= mmcv_version, \ | ||
f'MMCV=={mmcv.__version__} is used but incompatible. ' \ | ||
f'Please install mmcv>={mmcv_minimum_version}.' | ||
|
||
__all__ = ['__version__', 'short_version'] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,19 @@ | ||
from mmcv.utils import collect_env as collect_basic_env | ||
from mmcv.utils import get_git_hash | ||
|
||
import mmaction | ||
|
||
NUM_HASHES = 7 | ||
|
||
|
||
def get_short_git_hash(num_hashes=7): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this function be moved to mmcv? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's do it in a separate pr There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc. @hellock |
||
return get_git_hash()[:num_hashes] | ||
|
||
|
||
def collect_env(): | ||
env_info = collect_basic_env() | ||
env_info['MMAction2'] = mmaction.__version__ | ||
env_info['MMAction2'] = ( | ||
mmaction.__version__ + '+' + get_short_git_hash(NUM_HASHES)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here |
||
return env_info | ||
|
||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Copyright (c) Open-MMLab. All rights reserved. | ||
|
||
__version__ = '0.6.0' | ||
short_version = __version__ | ||
|
||
|
||
def parse_version_info(version_str): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should also go to mmcv There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. cc. @hellock |
||
version_info = [] | ||
for x in version_str.split('.'): | ||
if x.isdigit(): | ||
version_info.append(int(x)) | ||
elif x.find('rc') != -1: | ||
patch_version = x.split('rc') | ||
version_info.append(int(patch_version[0])) | ||
version_info.append(f'rc{patch_version[1]}') | ||
return tuple(version_info) | ||
|
||
|
||
version_info = parse_version_info(__version__) |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not needed any more