"""setup package."""
import os
import sys
from setuptools import setup, find_packages
TOP_DIR = sys.argv[-1]
sys.argv = sys.argv[: -1]
def _read_file(filename):
file_realpath = os.path.realpath(filename)
with open(file_realpath, encoding='UTF-8') as f:
return f.read()
def _get_package_data():
""" get package data"""
pkg_data = [
'__init__.py', '_checkparam.py', 'base_model.py', 'context.py', 'converter.py', 'model.py', 'tensor.py',
'_check_ascend.py', 'lib/*.so*', '.commit_id', 'include/api/*', 'include/api/callback/*',
'include/api/metrics/*', 'include/mindapi/base/*', 'include/registry/converter_context.h',
'include/converter.h'
]
if os.getenv('MSLITE_ENABLE_CLOUD_INFERENCE') == "on":
pkg_data.append('lite_infer.py')
return pkg_data
version = _read_file(TOP_DIR + '/version.txt').replace("\n", "")
readme = _read_file(TOP_DIR + '/README.md')
setup(
name="mindspore_lite",
version=version,
author='The MindSpore Authors',
author_email='contact@mindspore.cn',
url='https://www.mindspore.cn',
download_url='https://github.com/mindspore-ai/mindspore/tags',
project_urls={
'Sources': 'https://github.com/mindspore-ai/mindspore',
'Issue Tracker': 'https://github.com/mindspore-ai/mindspore/issues',
},
description='MindSpore is a new open source deep learning training/inference '
'framework that could be used for mobile, edge and cloud scenarios.',
long_description=readme,
long_description_content_type="text/markdown",
packages=find_packages(),
package_data={'': _get_package_data()},
include_package_data=True,
cmdclass={},
entry_points={},
python_requires='>=3.7',
install_requires=['numpy >= 1.17.0'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: C++',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'Topic :: Software Development',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
],
license='Apache 2.0',
keywords='mindspore lite',
)