-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathsetup.py
89 lines (76 loc) · 3.13 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
###############################################################
#
# Copyright 2017 Sandia Corporation. Under the terms of
# Contract DE-AC04-94AL85000 with Sandia Corporation, the
# U.S. Government retains certain rights in this software.
# This software is distributed under the BSD-3-Clause license.
#
##############################################################
import sys
import os
import codecs
import tbnn
# to create the distribution: python setup.py sdist
# to install the distribution: python setup.py install
if (2, 6) < sys.version_info[:2] > (2, 7):
print('WARNING: TBNN lacks thorough testing with your version of Python ({0}.{1}.{2})'.format(*sys.version_info) +
os.linesep +
' You may experience some unstablity with this build.')
if (3, 0) <= sys.version_info[:2]:
print('WARNING: TBNN has not been tested with Python 3'.format(os.name) + os.linesep +
' You may experience some unstability with this build.')
if os.name != 'posix':
print('WARNING: TBNN has not been tested with your operating system, ({0}).'.format(os.name) + os.linesep +
' You may experience some unstability with this build.')
metadata = dict()
exclude = ['tests','examples']
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from pkgutil import walk_packages
def check_exclude(package):
if not any(package.startswith(e) for e in exclude):
raise ImportError(package)
include = [tbnn.__name__]
for _, name, ispkg in walk_packages(tbnn.__path__, tbnn.__name__ + '.', onerror=check_exclude):
if ispkg and not any(name.startswith(e) for e in exclude):
include.append(name)
metadata['packages'] = include
else:
from setuptools import find_packages
metadata['packages'] = find_packages(exclude=[x + '.*' for x in exclude])
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, 'DESCRIPTION.txt'), encoding='utf-8') as f:
long_description = f.read()
from tbnn.version import __version__
metadata.update({
'name': 'tbnn',
'version': __version__,
'description': 'A Tensor-Basis Neural Network Trainer',
'long_description': long_description,
'author': 'Julia Ling',
'author_email': '[email protected]',
'maintainer': 'Jeremy Templeton',
'maintainer_email': '[email protected]',
'install_requires': ['lasagne==0.2.dev1',
'theano>=0.7.0.dev',
'matplotlib>=1.5.1',
'numpy>=1.6.2',
'scipy>=0.11',
],
'classifiers': [
'Development Status :: 2 - Pre-Alpha',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7'
],
'url': 'http://www.github.com/tbnn',
'keywords': 'sandia neuralnetwork tensor',
'test_suite': 'nose.collector',
'tests_require': ['nose']
})
setup(**metadata)