This repository has been archived by the owner on Dec 29, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
82 lines (76 loc) · 3 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
#!/usr/bin/env python
import os
import warnings
try:
from numpy.distutils.core import Extension, setup
except ImportError:
msg = ("Please install numpy (version 1.7.0 or greater) before installing "
"Amp. (Amp uses numpy's installer so it can compile the fortran "
"modules with f2py.) You should be able to do this with a command"
" like:"
" $ pip install numpy")
raise RuntimeError(msg)
name = 'amp-atomistics'
version = open(os.path.join('amp', 'VERSION')).read().strip()
description = 'Atomistic Machine-learning Package'
long_description = open('README').read()
packages = ['amp', 'amp.descriptor', 'amp.regression', 'amp.model']
package_dir = {'amp': 'amp', 'descriptor': 'descriptor',
'regression': 'regression', 'model': 'model'}
classifiers = ['Programming Language :: Python',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3']
install_requires = ['numpy>=1.7.0', 'matplotlib', 'ase', 'pyzmq',
'pexpect']
ext_modules = [Extension(name='amp.fmodules',
sources=['amp/model/neuralnetwork.f90',
'amp/descriptor/gaussian.f90',
'amp/descriptor/cutoffs.f90',
'amp/descriptor/zernike.f90',
'amp/model.f90'])]
author = 'Andrew Peterson'
author_email = '[email protected]'
url = 'https://bitbucket.org/andrewpeterson/amp'
package_data = {'amp': ['VERSION']}
scripts = ['tools/amp-compress', 'tools/amp-plotconvergence']
try:
setup(name=name,
version=version,
description=description,
long_description=long_description,
packages=packages,
package_dir=package_dir,
classifiers=classifiers,
install_requires=install_requires,
scripts=scripts,
ext_modules=ext_modules,
author=author,
author_email=author_email,
url=url,
package_data=package_data,
)
except SystemExit as ex:
if 'amp.fmodules' in ex.args[0]:
warnings.warn('It looks like no fortran compiler is present. Retrying '
'installation without fortran modules.')
else:
raise ex
setup(name=name,
version=version,
description=description,
long_description=long_description,
packages=packages,
package_dir=package_dir,
classifiers=classifiers,
install_requires=install_requires,
scripts=scripts,
ext_modules=[],
author=author,
author_email=author_email,
url=url,
package_data=package_data,
)
warnings.warn('Installed Amp without fortran modules since no fortran '
'compiler was found. The code may run slow as a result.')