forked from NervanaSystems/neon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
executable file
·98 lines (91 loc) · 3.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
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
#!/usr/bin/env python
# ----------------------------------------------------------------------------
# Copyright 2015 Nervana Systems Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ----------------------------------------------------------------------------
import os
from setuptools import setup, find_packages, Command
import subprocess
# Define version information
VERSION = '1.0.0rc1'
FULLVERSION = VERSION
write_version = True
try:
pipe = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE)
(so, serr) = pipe.communicate()
if pipe.returncode == 0:
FULLVERSION += "+%s" % so.strip().decode("utf-8")
except:
pass
gpuflag = os.system("nvcc --version > /dev/null 2>&1") == 0
if gpuflag:
package_data = {'neon': ['backends/kernels/sass/*.sass',
'backends/kernels/cubin/*.cubin',
'data/*.so']}
else:
package_data = {'neon': []}
if write_version:
txt = "# " + ("-" * 77) + "\n"
txt += "# Copyright 2015 Nervana Systems Inc.\n"
txt += "# Licensed under the Apache License, Version 2.0 "
txt += "(the \"License\");\n"
txt += "# you may not use this file except in compliance with the "
txt += "License.\n"
txt += "# You may obtain a copy of the License at\n"
txt += "#\n"
txt += "# http://www.apache.org/licenses/LICENSE-2.0\n"
txt += "#\n"
txt += "# Unless required by applicable law or agreed to in writing, "
txt += "software\n"
txt += "# distributed under the License is distributed on an \"AS IS\" "
txt += "BASIS,\n"
txt += "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or "
txt += "implied.\n"
txt += "# See the License for the specific language governing permissions "
txt += "and\n"
txt += "# limitations under the License.\n"
txt += "# " + ("-" * 77) + "\n"
txt += "\"\"\"\n%s\n\"\"\"\nVERSION = '%s'\nSHORT_VERSION = '%s'\n"
fname = os.path.join(os.path.dirname(__file__), 'neon', 'version.py')
a = open(fname, 'w')
try:
a.write(txt % ("Project version information.", FULLVERSION, VERSION))
finally:
a.close()
setup(name='neon',
version=VERSION,
description="Nervana's deep learning framework",
long_description=open('README.md').read(),
author='Nervana Systems',
author_email='[email protected]',
url='http://www.nervanasys.com',
license='License :: OSI Approved :: Apache Software License',
scripts=['bin/neon', 'bin/nvis'],
packages=find_packages(exclude=["tests"]),
package_data=package_data,
classifiers=['Development Status :: 3 - Alpha',
'Environment :: Console',
'Environment :: Console :: Curses',
'Environment :: Web Environment',
'Intended Audience :: End Users/Desktop',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: Apache Software License',
'Operating System :: POSIX',
'Operating System :: MacOS :: MacOS X',
'Programming Language :: Python',
'Topic :: Scientific/Engineering :: ' +
'Artificial Intelligence',
'Topic :: Scientific/Engineering :: Information Analysis',
'Topic :: System :: Distributed Computing'])