-
Notifications
You must be signed in to change notification settings - Fork 6
/
setup.py
61 lines (47 loc) · 1.77 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
from setuptools import setup, Extension, find_packages
import versioneer
class lazy_cythonize(list):
def __init__(self, callback):
self._list, self.callback = None, callback
def c_list(self):
if self._list is None:
self._list = self.callback()
return self._list
def __iter__(self):
for e in self.c_list():
yield e
def __getitem__(self, ii):
return self.c_list()[ii]
def __len__(self):
return len(self.c_list())
def extensions():
from Cython.Build import cythonize
ext = Extension("pyrevolve.crevolve", sources=["pyrevolve/schedulers/crevolve.pyx",
"src/revolve_c.cpp",
"src/revolve.cpp"],
include_dirs=[".", "pyrevolve"],
language="c++")
return cythonize([ext])
with open("README.md", "r") as fh:
long_description = fh.read()
s_required = ["cython>=0.17,<=3.0.0", "versioneer", "flake8"]
i_required = ["contexttimer"]
configuration = {
'name': 'pyrevolve',
'packages': find_packages(exclude=['examples', 'tests']),
'setup_requires': s_required,
'install_requires': i_required,
'extras_require': {'compression': ['blosc2', 'pyzfp']},
'ext_modules': lazy_cythonize(extensions),
'version': versioneer.get_version(),
'cmdclass': versioneer.get_cmdclass(),
'description': "Python wrapper for Revolve checkpointing",
'long_description': long_description,
'long_description_content_type': 'text/markdown',
'url': 'https://github.com/opesci/pyrevolve/',
'author': "Imperial College London",
'author_email': '[email protected]',
'license': 'MIT',
'zip_safe': False
}
setup(**configuration)