setup.py 2.42 KB
Newer Older
liuzhe-lz's avatar
liuzhe-lz committed
1
2
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
Gems's avatar
Gems committed
3

4
import setuptools
5
import platform
6
7
from os import walk, path

8
9
10
11
12
os_type = platform.system()
if os_type == 'Linux':
    os_name = 'POSIX :: Linux'
elif os_type == 'Darwin':
    os_name = 'MacOS'
13
14
elif os_type == 'Windows':
    os_name = 'Microsoft :: Windows'
15
16
17
18
else:
    raise NotImplementedError('current platform {} not supported'.format(os_type))

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

Gems Guo's avatar
Gems Guo committed
22
for (dirpath, dirnames, filenames) in walk('./nni'):
23
24
25
    files = [path.normpath(path.join(dirpath, filename)) for filename in filenames]
    data_files.append((path.normpath(dirpath), files))

26
with open('../../README.md', 'r', encoding="utf-8") as fh:
27
28
29
    long_description = fh.read()

setuptools.setup(
Gems Guo's avatar
Gems Guo committed
30
    name = 'nni',
goooxu's avatar
goooxu committed
31
    version = '999.0.0-developing',
32
33
34
35
36
37
38
    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
39
40
41
    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
42
43
44
    package_dir = {
        'nni_annotation': '../../tools/nni_annotation',
        'nni_cmd': '../../tools/nni_cmd',
Gems's avatar
Gems committed
45
        'nni_trial_tool': '../../tools/nni_trial_tool',
SparkSnail's avatar
SparkSnail committed
46
        'nni_gpu_tool': '../../tools/nni_gpu_tool',
chicm-ms's avatar
chicm-ms committed
47
48
        'nni': '../../src/sdk/pynni/nni',
        'nnicli': '../../src/sdk/pycli/nnicli'
Gems Guo's avatar
Gems Guo committed
49
    },
50
    package_data = {'nni': ['**/requirements.txt']},
51
52
    python_requires = '>=3.5',
    install_requires = [
Gems Guo's avatar
Gems Guo committed
53
        'schema',
54
        'ruamel.yaml',
Gems Guo's avatar
Gems Guo committed
55
56
        'psutil',
        'requests',
chicm-ms's avatar
chicm-ms committed
57
        'astor',
58
        'PythonWebHDFS',
Yuge Zhang's avatar
Yuge Zhang committed
59
        'hyperopt==0.1.2',
Gems's avatar
Gems committed
60
61
62
        'json_tricks',
        'numpy',
        'scipy',
63
        'coverage',
64
        'colorama',
chicm-ms's avatar
chicm-ms committed
65
        'scikit-learn>=0.20,<0.22'
66
67
68
69
    ],
    classifiers = [
        'Programming Language :: Python :: 3',
        'License :: OSI Approved :: MIT License',
70
        'Operating System :: ' + os_name
71
72
73
74
    ],
    data_files = data_files,
    entry_points = {
        'console_scripts' : [
Gems Guo's avatar
Gems Guo committed
75
            'nnictl = nni_cmd.nnictl:parse_args'
76
77
        ]
    }
78
)