forked from onnx/onnx-tensorflow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
63 lines (55 loc) · 1.93 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
import os
import setuptools
import subprocess
from textwrap import dedent
TOP_DIR = os.path.realpath(os.path.dirname(__file__))
SRC_DIR = os.path.join(TOP_DIR, 'onnx_tf')
with open(os.path.join(TOP_DIR, 'VERSION_NUMBER')) as version_file:
version = version_file.read().strip()
if os.getenv('TRAVIS'):
# On travis, we install from source, therefore no need to specify version.
onnx_dep = "onnx"
else:
# For user, we install the onnx release known to work with our release.
with open(os.path.join(TOP_DIR, 'ONNX_VERSION_NUMBER')) as onnx_version_file:
onnx_version = onnx_version_file.read().strip()
onnx_dep = "onnx>=" + onnx_version
try:
git_version = subprocess.check_output(['git', 'rev-parse', 'HEAD'],
cwd=TOP_DIR).decode('ascii').strip()
except (OSError, subprocess.CalledProcessError):
git_version = None
with open(os.path.join(SRC_DIR, 'version.py'), 'w') as f:
f.write(dedent('''\
# This file is generated by setup.py. DO NOT EDIT!
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
version = '{}'
git_version = '{}'
'''.format(version, git_version)))
setuptools.setup(
name='onnx-tf',
version=version,
description=
'Tensorflow backend for ONNX (Open Neural Network Exchange).',
install_requires=[
onnx_dep, "PyYAML", "tensorflow_addons", "tensorflow_probability"
],
entry_points={
"console_scripts": [
"onnx-tf=onnx_tf.cli:main",
],
},
url='https://github.com/onnx/onnx-tensorflow/',
author='Arpith Jacob, Tian Jin, Gheorghe-Teodor Bercea, Wenhao Hu',
author_email='[email protected]',
license='Apache License 2.0',
packages=setuptools.find_packages(),
zip_safe=False,
classifiers=[
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 3"
]
)