-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
78 lines (65 loc) · 2.57 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
# Copyright © 2023 Intel Corporation
# SPDX-License-Identifier: Apache 2.0
# LEGAL NOTICE: Your use of this software and any required dependent software (the “Software Package”)
# is subject to the terms and conditions of the software license agreements for the Software Package,
# which may also include notices, disclaimers, or license terms for third party or open source software
# included in or with the Software Package, and your use indicates your acceptance of all such terms.
# Please refer to the “third-party-programs.txt” or other similarly-named text file included with the
# Software Package for additional details.
from skbuild import setup
import subprocess
import shutil
import os
def get_version():
this_dir = os.path.dirname(os.path.realpath(__file__))
git_describe = subprocess.check_output(
["git", "describe", "--tags"], cwd=this_dir
).decode("utf-8")
sections = git_describe.split("-")
version = sections[0]
return version
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
with open("requirements.txt") as fh:
requirements = fh.readlines()
build_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "_skbuild")
if os.path.isdir(build_dir):
print(f"Clean {build_dir}")
shutil.rmtree(build_dir)
setup(
name="vpunn_cost_model",
version=get_version(),
author="Alessandro Palla",
author_email="[email protected]",
description="VPUNN cost model",
license="Apache License 2.0",
cmake_install_target="vpunn-install-bindings",
cmake_args=[
"-DVPUNN_BUILD_EXAMPLES=OFF",
"-DVPUNN_BUILD_TESTS=OFF",
"-DVPUNN_BUILD_SHARED_LIB=OFF",
],
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/intel-innersource/libraries.performance.modeling.vpu.nn_cost_model",
project_urls={
"Bug Tracker": "https://github.com/intel-innersource/libraries.performance.modeling.vpu.nn_cost_model/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: OS Independent",
],
package_dir={"vpunn": "python"},
packages=["vpunn"],
entry_points={
"console_scripts": [
"vpunn_to_json=vpunn.to_json:main",
"vpunn_builder=vpunn.builder:main",
"vpu_cost_model=vpunn.cost:main",
"vpu_layer_cost_model=vpunn.layer:main",
],
},
python_requires=">=3.6",
install_requires=requirements,
)