-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
43 lines (37 loc) · 1.19 KB
/
setup.py
File metadata and controls
43 lines (37 loc) · 1.19 KB
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
from setuptools import setup, find_packages
import os
import shutil
import subprocess
VERSION=open("Lisa/VERSION", 'r').readline().strip()
requires = [
'cython',
'matplotlib',
'numpy',
'h5py',
'moviepy',
'unittest2'
]
def do_cythonize(list_of_modules):
from Cython.Build import cythonize
list_of_cythons = []
for file in list_of_modules:
shutil.copy(file, file[:-3]+"_cython.py")
hash = subprocess.check_output(["md5sum", file]).split()[0].strip().decode('utf-8')
with open(file[:-3]+"_cython.py", 'a') as f:
f.write("\ncython_compile_hash = '"+hash+"'\n")
list_of_cythons.append(file[:-3]+"_cython.py")
cytho = cythonize(list_of_cythons)
for file in list_of_cythons:
os.remove(file)
return cytho
setup(
name="Lisa",
version=VERSION,
author="Patrick Schreiber",
author_email="patrick.schreiber2@student.kit.edu",
packages=find_packages(),
ext_modules=do_cythonize(["Lisa/data/file.py", "Lisa/data/data.py", "Lisa/plots/plots.py", "Lisa/plots/config.py"]),
install_requires=requires,
extras_require={"test": requires},
include_package_data=True
)