forked from microsoft/Olive
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
83 lines (68 loc) · 2.89 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
77
78
79
80
81
82
83
import json
import os
from setuptools import find_packages, setup
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), "r") as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith("__version__"):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
raise RuntimeError("Unable to find version string.")
def get_extra_deps(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, rel_path), "r") as fp:
extra_deps = json.load(fp)
return extra_deps
# use techniques described at https://packaging.python.org/en/latest/guides/single-sourcing-package-version/
# Don't use technique 6 since it needs extra dependencies.
VERSION = get_version("olive/__init__.py")
EXTRAS = get_extra_deps("olive/extra_dependencies.json")
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), "requirements.txt")) as req_file:
requirements = req_file.read().splitlines()
CLASSIFIERS = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]
long_description = (
"Olive is an easy-to-use hardware-aware model optimization tool that composes industry-leading techniques across"
" model compression, optimization, and compilation. Given a model and targeted hardware, Olive composes the best"
" suitable optimization techniques to output the most efficient model(s) for inferencing on cloud or edge, while"
" taking a set of constraints such as accuracy and latency into consideration."
)
description = long_description.split(".")[0] + "."
setup(
name="olive-ai",
version=VERSION,
description=description,
long_description=long_description,
author="Microsoft Corporation",
author_email="[email protected]",
license="MIT License",
classifiers=CLASSIFIERS,
url="https://microsoft.github.io/Olive/",
download_url="https://github.com/microsoft/Olive/tags",
packages=find_packages(exclude=("test", "examples*")),
install_requires=requirements,
extras_require=EXTRAS,
include_package_data=True,
package_data={},
data_files=[],
entry_points={},
)