forked from intel/neural-compressor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
76 lines (63 loc) · 2.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from io import open
from setuptools import find_packages, setup
import re
import sys
def fetch_requirements(path):
with open(path, 'r') as fd:
return [r.strip() for r in fd.readlines()]
try:
filepath = './neural_compressor/version.py'
with open(filepath) as version_file:
__version__, = re.findall('__version__ = "(.*)"', version_file.read())
except Exception as error:
assert False, "Error: Could not open '%s' due %s\n" % (filepath, error)
neural_insights = False
if "neural_insights" in sys.argv:
neural_insights = True
sys.argv.remove("neural_insights")
# define include packages
include_packages = find_packages(include=['neural_compressor', 'neural_compressor.*',
'neural_coder', 'neural_coder.*'])
neural_insights_packages = find_packages(include=['neural_insights', 'neural_insights.*'])
# define package data
package_data = {'': ['*.yaml']}
neural_insights_data = {'': ['*.yaml', 'web/app/*.*']}
# define install requirements
install_requires_list = fetch_requirements('requirements.txt')
neural_insights_requires = fetch_requirements('neural_insights/requirements.txt')
# define scripts
scripts_list = []
neural_insights_scripts_list = ['neural_insights/bin/neural_insights']
if neural_insights:
project_name = "neural_insights"
package_data = neural_insights_data
install_requires_list = neural_insights_requires
scripts_list = neural_insights_scripts_list
include_packages = neural_insights_packages
else:
project_name = "neural_compressor"
if __name__ == '__main__':
setup(
name=project_name,
version=__version__,
author="Intel AIA Team",
author_email="feng.tian@intel.com, haihao.shen@intel.com, suyue.chen@intel.com",
description="Repository of Intel® Neural Compressor",
long_description=open("README.md", "r", encoding='utf-8').read(),
long_description_content_type="text/markdown",
keywords='quantization, auto-tuning, post-training static quantization, post-training dynamic quantization, quantization-aware training',
license='Apache 2.0',
url="https://github.com/intel/neural-compressor",
packages=include_packages,
include_package_data=True,
package_data=package_data,
install_requires=install_requires_list,
scripts=scripts_list,
python_requires='>=3.6.0',
classifiers=[
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: Artificial Intelligence',
'License :: OSI Approved :: Apache Software License',
],
)