forked from leeping/nanoreactor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
71 lines (61 loc) · 2.69 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
"""
setup.py: Install nanoreactor learning script.
"""
VERSION = 4.2
__author__ = "Lee-Ping Wang, Alexey Titov, Robert McGibbon"
__version__ = "%.1f" % VERSION
import sys
from distutils.core import setup # , Extension
import glob
requirements = ['numpy', 'networkx']
# Declare the C extension modules
# CONTACT = Extension('nanoreactor/_contact_wrap',
# sources = ["src/contact/contact.c",
# "src/contact/contact_wrap.c"],
# extra_compile_args=["-std=c99","-O3","-shared",
# "-fopenmp", "-Wall"],
# extra_link_args=['-lgomp'],
# include_dirs = [numpy.get_include(), os.path.join(numpy.get_include(), 'numpy')])
#
# DIHEDRAL = Extension('nanoreactor/_dihedral_wrap',
# sources = ["src/dihedral/dihedral.c",
# "src/dihedral/dihedral_wrap.c"],
# extra_compile_args=["-std=c99","-O3","-shared",
# "-fopenmp", "-Wall"],
# extra_link_args=['-lgomp'],
# include_dirs = [numpy.get_include(), os.path.join(numpy.get_include(), 'numpy')])
#
def buildKeywordDictionary():
setupKeywords = {}
setupKeywords["name"] = "nanoreactor"
setupKeywords["version"] = "%.1f" % VERSION
setupKeywords["author"] = __author__
setupKeywords["author_email"] = "[email protected]"
setupKeywords["license"] = "GPL 3.0"
setupKeywords["packages"] = ["nanoreactor", "nebterpolator", "nebterpolator.io", "nebterpolator.core"]
# setupKeywords["package_dir"] = {"nanoreactor": "src"}
setupKeywords["scripts"] = glob.glob("bin/*.py") + glob.glob("bin/*.sh") + glob.glob("bin/*.exe") + glob.glob(
"bin/*.vmd")
# setupKeywords["ext_modules"] = [CONTACT, DIHEDRAL]
setupKeywords["py_modules"] = ["pypackmol"]
setupKeywords["platforms"] = ["Linux", "Mac OS X", "Windows"]
setupKeywords["description"] = "Machine learning for reactive MD."
outputString = ""
firstTab = 40
secondTab = 60
for key in sorted(setupKeywords.keys()):
value = setupKeywords[key]
outputString += key.rjust(firstTab) + str(value).rjust(secondTab) + "\n"
print("%s" % outputString)
return setupKeywords
def main():
setup_keywords = buildKeywordDictionary()
setup(**setup_keywords)
for requirement in requirements:
try:
exec('import %s' % requirement)
except ImportError as e:
print('\nWarning: Could not import %s' % e, file=sys.stderr)
print('Warning: Some package functionality may not work', file=sys.stderr)
if __name__ == '__main__':
main()