setup.py 3.53 KB
Newer Older
Gems's avatar
Gems committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
# associated documentation files (the "Software"), to deal in the Software without restriction,
# including without limitation the rights to use, copy, modify, merge, publish, distribute,
# sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or
# substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
# NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
# DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT
# OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
# ==================================================================================================

21
import setuptools
22
import platform
23
24
from os import walk, path

25
26
27
28
29
os_type = platform.system()
if os_type == 'Linux':
    os_name = 'POSIX :: Linux'
elif os_type == 'Darwin':
    os_name = 'MacOS'
30
31
elif os_type == 'Windows':
    os_name = 'Microsoft :: Windows'
32
33
34
35
else:
    raise NotImplementedError('current platform {} not supported'.format(os_type))

data_files = [('bin', ['node-{}-x64/bin/node'.format(os_type.lower())])]
36
if os_type == 'Windows':
37
    data_files = [('.\Scripts', ['node-{}/node.exe'.format(os_type.lower())])]
38

Gems Guo's avatar
Gems Guo committed
39
for (dirpath, dirnames, filenames) in walk('./nni'):
40
41
42
    files = [path.normpath(path.join(dirpath, filename)) for filename in filenames]
    data_files.append((path.normpath(dirpath), files))

43
with open('../../README.md', 'r', encoding="utf-8") as fh:
44
45
46
    long_description = fh.read()

setuptools.setup(
Gems Guo's avatar
Gems Guo committed
47
    name = 'nni',
goooxu's avatar
goooxu committed
48
    version = '999.0.0-developing',
49
50
51
52
53
54
55
    author = 'Microsoft NNI team',
    author_email = 'nni@microsoft.com',
    description = 'Neural Network Intelligence package',
    long_description = long_description,
    long_description_content_type = 'text/markdown',
    license = 'MIT',
    url = 'https://github.com/Microsoft/nni',
chicm-ms's avatar
chicm-ms committed
56
57
58
    packages = setuptools.find_packages('../../tools') \
        + setuptools.find_packages('../../src/sdk/pynni', exclude=['tests']) \
        + setuptools.find_packages('../../src/sdk/pycli'),
Gems Guo's avatar
Gems Guo committed
59
60
61
    package_dir = {
        'nni_annotation': '../../tools/nni_annotation',
        'nni_cmd': '../../tools/nni_cmd',
Gems's avatar
Gems committed
62
        'nni_trial_tool': '../../tools/nni_trial_tool',
SparkSnail's avatar
SparkSnail committed
63
        'nni_gpu_tool': '../../tools/nni_gpu_tool',
chicm-ms's avatar
chicm-ms committed
64
65
        'nni': '../../src/sdk/pynni/nni',
        'nnicli': '../../src/sdk/pycli/nnicli'
Gems Guo's avatar
Gems Guo committed
66
    },
67
    package_data = {'nni': ['**/requirements.txt']},
68
69
    python_requires = '>=3.5',
    install_requires = [
Gems Guo's avatar
Gems Guo committed
70
        'schema',
71
        'ruamel.yaml',
Gems Guo's avatar
Gems Guo committed
72
73
        'psutil',
        'requests',
chicm-ms's avatar
chicm-ms committed
74
        'astor',
75
        'PythonWebHDFS',
Yuge Zhang's avatar
Yuge Zhang committed
76
        'hyperopt==0.1.2',
Gems's avatar
Gems committed
77
78
79
        'json_tricks',
        'numpy',
        'scipy',
80
        'coverage',
81
82
        'colorama',
        'sklearn'
83
84
85
86
    ],
    classifiers = [
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
87
        'Operating System :: ' + os_name
88
89
90
91
    ],
    data_files = data_files,
    entry_points = {
        'console_scripts' : [
Gems Guo's avatar
Gems Guo committed
92
            'nnictl = nni_cmd.nnictl:parse_args'
93
94
        ]
    }
95
)