-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsetup.py
48 lines (37 loc) · 1.04 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
import os
import subprocess
from setuptools import setup
from setuptools.command.install import install
from setuptools.command.develop import develop
BASEPATH = os.path.dirname(os.path.abspath(__file__))
class custom_develop(develop):
def run(self):
original_cwd = os.getcwd()
# build trex lib and custom tf ops
folders = [
os.path.join(BASEPATH, 'code2inv/graph_encoder'),
]
for folder in folders:
os.chdir(folder)
subprocess.check_call(['make'])
os.chdir(original_cwd)
develop.run(self)
class custom_install(install):
def run(self):
# install doesn't currently handle binary dependencies, so just use develop all the time
assert False, 'please use develop instead of install'
setup(
name='code2inv',
packages=['code2inv'],
install_requires=[
'torch',
'pysmt',
'numpy',
'future',
'tqdm',
],
cmdclass={
'develop': custom_develop,
'install': custom_install,
}
)