-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
61 lines (50 loc) · 1.6 KB
/
setup.py
File metadata and controls
61 lines (50 loc) · 1.6 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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from setuptools import setup, find_packages
from distutils.command.install import install as _install
from distutils.command.clean import clean as _clean
from setuptools.command.build_py import build_py as _build_py
from setuptools.command.develop import develop as _develop
import subprocess
import os
import sys
import shutil
LIBS = ["libreact_wrapper.so",]
HERE = os.path.abspath(os.path.dirname(__file__))
def compile_library(env):
subprocess.check_call(["make"], env=env, cwd="pyreact")
def clean_library(env={}):
subprocess.check_call(["make", "clean"], env=env, cwd="pyreact")
class build(_build_py):
def run(self):
env = os.environ
compile_library(env)
super().run()
class develop(_develop):
def run(self):
env = os.environ
compile_library(env)
super().run()
class install(_install):
def __init__(self, dist):
super().__init__(dist)
self.build_args = {}
if self.record is None:
self.record = "install-record.txt"
def run(self):
super().run()
class clean(_clean):
def run(self):
clean_library()
super().run()
setup(name = "pyreact",
description = "Python interface for the ReACT library",
author = "Tilman Troester",
author_email = "tilmantroester@gmail.com",
packages = ["pyreact"],
version='1.0.0',
package_data = {"" : LIBS,},
install_requires = ['numpy'],
cmdclass={"install" : install,
"develop" : develop,
"build_py" : build,
"clean" : clean},
)