This repository has been archived by the owner on Oct 13, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 109
/
setup.py
65 lines (56 loc) · 2.27 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
# SPDX-License-Identifier: Apache-2.0
# -*- coding: utf-8 -*-
from distutils.core import setup
from setuptools import find_packages
import os
from os import path
def find_embedded_package(folder):
packages = find_packages(where=folder)
merged = [p_ if p_.startswith(folder) else folder + '.' + p_ for p_ in packages]
return [p_[2:].replace('/', '.') for p_ in merged]
this = os.path.dirname(__file__)
with open(os.path.join(this, "requirements.txt"), "r") as f:
requirements = [_ for _ in [_.strip("\r\n ")
for _ in f.readlines()] if _ is not None]
packages = find_packages()
assert packages
root_package = packages[0]
# read version from the package file.
version_str = '0.1.0.0000'
with (open(os.path.join(this, '{}/__init__.py'.format(root_package)), "r")) as f:
line = [_ for _ in [_.strip("\r\n ")
for _ in f.readlines()] if _.startswith("__version__")]
if len(line) > 0:
version_str = line[0].split('=')[1].strip('" ')
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
start_pos = long_description.find('# Introduction')
if start_pos >= 0:
long_description = long_description[start_pos:]
setup(
name=root_package,
version=version_str,
description="Converts Machine Learning models to ONNX for use in Windows ML",
long_description=long_description,
long_description_content_type='text/markdown',
license='Apache License v2.0',
author='Microsoft Corporation',
author_email='[email protected]',
url='https://github.com/onnx/keras-onnx',
packages=packages,
include_package_data=True,
install_requires=requirements,
tests_require=['pytest', 'pytest-cov'],
classifiers=[
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Developers',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: Apache Software License']
)