forked from lightdock/lightdock
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
217 lines (198 loc) · 6.96 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
import os
import setuptools
from distutils.core import Extension
from setuptools.command.test import test as TestCommand
from lightdock.version import CURRENT_VERSION
# Inspired by the example at https://pytest.org/latest/goodpractises.html
class NoseTestCommand(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import nose
nose.run_exit(argv=["nosetests"])
with open("README.md", "r") as fh:
long_description = fh.read()
# MDAnalysis NumPy delay on setup.py
def abspath(file):
return os.path.join(os.path.dirname(os.path.abspath(__file__)), file)
class LDExtension(Extension, object):
"""Derived class for handling setup-time (numpy) dependencies."""
def __init__(self, name, sources, *args, **kwargs):
self._ld_include_dirs = []
super(LDExtension, self).__init__(name, sources, *args, **kwargs)
@property
def include_dirs(self):
if not self._ld_include_dirs:
for item in self._ld_include_dir_args:
try:
self._ld_include_dirs.append(item())
except TypeError:
item = abspath(item)
self._ld_include_dirs.append((item))
return self._ld_include_dirs
@include_dirs.setter
def include_dirs(self, val):
self._ld_include_dir_args = val
def get_numpy_include():
import builtins
builtins.__NUMPY_SETUP__ = False
try:
import numpy as np
except ImportError:
raise SystemExit("LightDock requires NumPy for setup")
return np.get_include()
exts = [
LDExtension(
name="lightdock.mathutil.cython.cutil",
sources=["lightdock/mathutil/cython/cutil.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.mathutil.cython.quaternion",
sources=["lightdock/mathutil/cython/quaternion.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.gso.searchspace.cython.j1",
sources=["lightdock/gso/searchspace/cython/j1.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.gso.searchspace.cython.j2",
sources=["lightdock/gso/searchspace/cython/j2.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.gso.searchspace.cython.j3",
sources=["lightdock/gso/searchspace/cython/j3.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.gso.searchspace.cython.j4",
sources=["lightdock/gso/searchspace/cython/j4.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.gso.searchspace.cython.j5",
sources=["lightdock/gso/searchspace/cython/j5.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.pisa.cython.cpisa",
sources=["lightdock/scoring/pisa/cython/cpisa.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.dfire.cython.cdfire",
sources=["lightdock/scoring/dfire/cython/cdfire.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.ddna.cython.cddna",
sources=["lightdock/scoring/ddna/cython/cddna.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.dfire2.c.cdfire2",
sources=["lightdock/scoring/dfire2/c/cdfire2.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.sd.energy.c.sd",
sources=["lightdock/scoring/sd/energy/c/sd.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.fastdfire.c.cdfire",
sources=["lightdock/scoring/fastdfire/c/cdfire.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.cpydock.energy.c.cpydock",
sources=["lightdock/scoring/cpydock/energy/c/cpydock.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.vdw.energy.c.cvdw",
sources=["lightdock/scoring/vdw/energy/c/cvdw.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.dna.energy.c.cdna",
sources=["lightdock/scoring/dna/energy/c/cdna.c"],
include_dirs=[get_numpy_include],
),
LDExtension(
name="lightdock.scoring.sipper.c.sipper",
sources=["lightdock/scoring/sipper/c/sipper.c"],
include_dirs=[get_numpy_include],
),
]
setuptools.setup(
name="lightdock",
version=CURRENT_VERSION,
description="A macromolecular docking framework",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://lightdock.org/",
packages=setuptools.find_namespace_packages(),
include_package_data=True,
license="GPLv3 License",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Environment :: Console",
"Intended Audience :: Education",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Bio-Informatics",
"Topic :: Scientific/Engineering :: Chemistry",
],
python_requires=">=3.6",
setup_requires=["numpy>=1.17.1", "nose"],
install_requires=[
"numpy>=1.17.1",
"scipy>=1.7.0",
"cython>=0.29.13",
"prody>=2.0.1",
"freesasa>=2.0.3",
],
scripts=[
"bin/ant_thony.py",
"bin/lgd_calculate_diameter.py",
"bin/lgd_calculate_reference_points.py",
"bin/lgd_calculate_scoring.py",
"bin/lgd_cluster_bsas.py",
"bin/lgd_copy_structures.py",
"bin/lgd_create_membrane.py",
"bin/lgd_dummify.py",
"bin/lgd_filter_membrane.py",
"bin/lgd_filter_restraints.py",
"bin/lgd_flatten.py",
"bin/lgd_generate_conformations.py",
"bin/lgd_generate_glowworm_positions.py",
"bin/lgd_generate_trajectory.py",
"bin/lgd_gso_to_csv.py",
"bin/lgd_map_contacts.py",
"bin/lgd_move_anm.py",
"bin/lgd_rank.py",
"bin/lgd_rank_swarm.py",
"bin/lgd_top.py",
"bin/lightdock3.py",
"bin/lightdock3_setup.py",
],
cmdclass={"test": NoseTestCommand},
ext_modules=exts,
zip_safe=False,
)