2018-08-27 02:12:31 +08:00
|
|
|
import sys
|
2019-04-22 10:43:33 +08:00
|
|
|
from io import open # for Python 2 (identical to builtin in Python 3)
|
|
|
|
|
2019-05-28 20:03:08 +08:00
|
|
|
from setuptools import Extension, find_packages, setup
|
|
|
|
|
|
|
|
import numpy
|
|
|
|
from Cython.Distutils import build_ext
|
2018-08-27 02:12:31 +08:00
|
|
|
|
2018-10-10 19:18:00 +08:00
|
|
|
install_requires = [
|
2019-05-28 20:03:08 +08:00
|
|
|
'numpy>=1.11.1', 'pyyaml', 'six', 'addict', 'requests', 'opencv-python',
|
|
|
|
'Cython'
|
2018-10-10 19:18:00 +08:00
|
|
|
]
|
2018-08-27 02:12:31 +08:00
|
|
|
if sys.version_info < (3, 3):
|
|
|
|
install_requires.append('backports.shutil_get_terminal_size')
|
|
|
|
if sys.version_info < (3, 4):
|
|
|
|
install_requires.extend(['enum34', 'pathlib'])
|
|
|
|
|
|
|
|
|
|
|
|
def readme():
|
2019-04-22 10:43:33 +08:00
|
|
|
with open('README.rst', encoding='utf-8') as f:
|
2018-08-27 02:12:31 +08:00
|
|
|
content = f.read()
|
|
|
|
return content
|
|
|
|
|
|
|
|
|
|
|
|
def get_version():
|
|
|
|
version_file = 'mmcv/version.py'
|
2019-04-22 10:43:33 +08:00
|
|
|
with open(version_file, 'r', encoding='utf-8') as f:
|
2018-08-27 02:12:31 +08:00
|
|
|
exec(compile(f.read(), version_file, 'exec'))
|
|
|
|
return locals()['__version__']
|
|
|
|
|
|
|
|
|
2019-05-28 20:03:08 +08:00
|
|
|
EXT_MODULES = [
|
|
|
|
Extension(
|
|
|
|
name='mmcv._ext',
|
|
|
|
sources=[
|
|
|
|
'./mmcv/video/optflow_warp/flow_warp.cpp',
|
|
|
|
'./mmcv/video/optflow_warp/flow_warp_module.pyx'
|
|
|
|
],
|
|
|
|
include_dirs=[numpy.get_include(), './mmcv/video/optflow_warp/'],
|
|
|
|
language="c++",
|
|
|
|
),
|
|
|
|
]
|
|
|
|
|
2018-08-27 02:12:31 +08:00
|
|
|
setup(
|
|
|
|
name='mmcv',
|
|
|
|
version=get_version(),
|
|
|
|
description='Open MMLab Computer Vision Foundation',
|
|
|
|
long_description=readme(),
|
|
|
|
keywords='computer vision',
|
|
|
|
packages=find_packages(),
|
|
|
|
classifiers=[
|
|
|
|
'Development Status :: 4 - Beta',
|
2018-12-09 17:28:52 +08:00
|
|
|
'License :: OSI Approved :: Apache Software License',
|
2018-08-27 02:12:31 +08:00
|
|
|
'Operating System :: OS Independent',
|
|
|
|
'Programming Language :: Python :: 2',
|
|
|
|
'Programming Language :: Python :: 2.7',
|
|
|
|
'Programming Language :: Python :: 3',
|
|
|
|
'Programming Language :: Python :: 3.4',
|
|
|
|
'Programming Language :: Python :: 3.5',
|
|
|
|
'Programming Language :: Python :: 3.6',
|
2019-04-23 15:15:27 +08:00
|
|
|
'Programming Language :: Python :: 3.7',
|
2018-08-27 02:12:31 +08:00
|
|
|
'Topic :: Utilities',
|
|
|
|
],
|
|
|
|
url='https://github.com/open-mmlab/mmcv',
|
|
|
|
author='Kai Chen',
|
|
|
|
author_email='chenkaidev@gmail.com',
|
|
|
|
setup_requires=['pytest-runner'],
|
|
|
|
tests_require=['pytest'],
|
|
|
|
install_requires=install_requires,
|
2019-05-28 20:03:08 +08:00
|
|
|
ext_modules=EXT_MODULES,
|
|
|
|
cmdclass={'build_ext': build_ext},
|
2018-08-27 02:12:31 +08:00
|
|
|
zip_safe=False)
|