-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
98 lines (87 loc) · 2.38 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import os
import sys
import subprocess
from setuptools import setup, find_packages
VERBOSE_SCRIPT = True
REQUIRED_MAJOR = 3
REQUIRED_MINOR = 5
# Check for python version
if sys.version_info < (REQUIRED_MAJOR, REQUIRED_MINOR):
error = (
"Your version of python ({major}.{minor}) is too old. You need "
"python >= {required_major}.{required_minor}."
).format(
major=sys.version_info.major,
minor=sys.version_info.minor,
required_minor=REQUIRED_MINOR,
required_major=REQUIRED_MAJOR,
)
sys.exit(error)
cwd = os.path.dirname(os.path.abspath(__file__))
version = open('.version', 'r').read().strip()
if VERBOSE_SCRIPT:
def report(*args):
print(*args)
else:
def report(*args):
pass
version_path = os.path.join(cwd, 'naslib', '__init__.py')
with open(version_path, 'w') as f:
report('-- Building version ' + version)
f.write("__version__ = '{}'\n".format(version))
requires = [
"cycler>=0.10",
"kiwisolver>=1.0.1",
"iopath>=0.1.7",
"tabulate",
"tqdm",
"yacs>=0.1.6",
"ConfigSpace",
"cython",
"hyperopt==0.1.2",
"pyyaml",
"numpy==1.17.5",
"scikit-learn==0.23.0",
"fvcore",
"matplotlib",
"pandas",
"pytest",
"pytest-cov",
"codecov",
"coverage",
"keras==2.3.1",
"lightgbm",
"ngboost==0.3.7",
"xgboost",
"emcee==2.2.1",
"pybnn",
"pyro-ppl==1.4.0",
"tensorflow==1.15.4",
"networkx"
]
import subprocess
git_nasbench = "git+https://github.com/google-research/nasbench.git@master"
try:
import nasbench
except ImportError:
if '--user' in sys.argv:
subprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade',
'--user', git_nasbench], check=False)
else:
subprocess.run([sys.executable, '-m', 'pip', 'install', '--upgrade',
git_nasbench], check=False)
if __name__=='__main__':
setup(
name='naslib',
version=version,
description='NASLib: A Neural Architecture Search (NAS) library.',
author='AutoML Freiburg',
author_email='[email protected]',
url='https://github.com/automl/NASLib',
license='Apache License 2.0',
classifiers=['Development Status :: 1 - Beta'],
packages=find_packages(),
install_requires=requires,
keywords=['NAS', 'automl'],
test_suite='tests'
)