-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* make version.py independent * upper bound mmcv again * tiny * tiny * use and remove * remove short_version in setup.py * update setup.py * update setup.py * add unittest for parse_version_info * remove unittest Co-authored-by: dreamerlin <[email protected]>
- Loading branch information
1 parent
94895ec
commit a26d5f9
Showing
3 changed files
with
23 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,15 @@ | ||
import mmcv | ||
from mmcv import digit_version | ||
|
||
from .version import __version__, short_version | ||
from .version import __version__ | ||
|
||
mmcv_minimum_version = '1.1.1' | ||
mmcv_maximum_version = '1.2' | ||
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}.' | ||
assert (digit_version(mmcv_minimum_version) <= 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'] | ||
__all__ = ['__version__'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,18 @@ | ||
# Copyright (c) Open-MMLab. All rights reserved. | ||
from mmcv import parse_version_info | ||
|
||
__version__ = '0.7.0' | ||
short_version = __version__ | ||
|
||
|
||
def parse_version_info(version_str): | ||
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 contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,12 +13,7 @@ def readme(): | |
def get_version(): | ||
with open(version_file, 'r') as f: | ||
exec(compile(f.read(), version_file, 'exec')) | ||
import sys | ||
# return short version for sdist | ||
if 'sdist' in sys.argv or 'bdist_wheel' in sys.argv: | ||
return locals()['short_version'] | ||
else: | ||
return locals()['__version__'] | ||
return locals()['__version__'] | ||
|
||
|
||
def parse_requirements(fname='requirements.txt', with_version=True): | ||
|
@@ -109,15 +104,15 @@ def gen_packages_items(): | |
maintainer='MMAction2 Authors', | ||
maintainer_email='[email protected]', | ||
packages=find_packages(exclude=('configs', 'tools', 'demo')), | ||
package_data={'mmaction.ops': ['*/*.so']}, | ||
keywords='computer vision, action understanding', | ||
classifiers=[ | ||
'Development Status :: 4 - Beta', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: OS Independent', | ||
'Programming Language :: Python :: 3', | ||
'Programming Language :: Python :: 3.5', | ||
'Programming Language :: Python :: 3.6', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
], | ||
url='https://github.com/open-mmlab/mmaction2', | ||
license='Apache License 2.0', | ||
|