-
Notifications
You must be signed in to change notification settings - Fork 117
/
setup.py
66 lines (55 loc) · 1.84 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
import os
import setuptools
import subprocess
from datetime import datetime
try:
from pip._internal.req import parse_requirements
except ImportError:
from pip.req import parse_requirements
def get_sha():
try:
return subprocess.check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
except (subprocess.CalledProcessError, FileNotFoundError):
return None
def get_datetime():
try:
return (
subprocess.check_output(['git', 'show', '-s', '--date=format:%Y%m%d%H%M%S', '--format=%cd'])
.decode('ascii')
.strip()
)
except (subprocess.CalledProcessError, FileNotFoundError):
now = datetime.now()
return now.strftime("%Y%m%d%H%M%S")
predefined_version = os.getenv('TINYML_BUILD_VERSION')
if predefined_version:
version = predefined_version
else:
version = '0.1.0'
sha = get_sha()
dt = get_datetime()
if sha:
version += f'.{dt}+{sha}'
else:
version += f'.{dt}'
reqs = parse_requirements('requirements.txt', session=False)
install_reqs = [str(ir.req) if hasattr(ir, 'req') else str(ir.requirement) for ir in reqs]
setuptools.setup(
name="TinyNeuralNetwork",
version=version,
author="Huanghao Ding, Jiachen Pu",
description="A collection of tools that aims for the inference performance of a AI model in AIoT scenarios.",
url="https://github.com/alibaba/TinyNeuralNetwork",
project_urls={
"Bug Tracker": "https://github.com/alibaba/TinyNeuralNetwork/issues",
},
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
packages=setuptools.find_packages(),
package_data={'tinynn': ['graph/configs/*.yml']},
python_requires=">=3.6",
install_requires=install_reqs,
)