-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
45 lines (38 loc) · 1.03 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
import sys
import subprocess
import os
from setuptools import setup, Extension
from setuptools.command.build_py import build_py
class Build(build_py):
"""Customized setuptools build command - builds protos on build."""
def run(self):
os.chdir("tmk/cpp")
command = ["make","libtmk.a"]
if subprocess.call(command) != 0:
sys.exit(-1)
os.chdir("../../")
build_py.run(self)
tmkpy_module = Extension('_tmkpy',
sources=["tmkpy.i","tmkpy.cpp"],
swig_opts=["-c++"],
include_dirs=["."],
libraries=["tmk"],
library_dirs=["tmk/cpp/"],
extra_compile_args=["-std=c++14"]
)
setup(name='tmkpy',
cmdclass={
'build_py': Build,
},
version='0.1.1',
description='Python bindings for the TMK video similarity library',
long_description=open('README.md').read(),
long_description_content_type="text/markdown",
author='Scott Hale',
author_email='[email protected]',
url='https://github.com/meedan/tmkpy',
ext_modules=[tmkpy_module],
py_modules=["tmkpy"],
setup_requires=['wheel'],
package_data = {'': ['tmkpy.h']} # needed for sdist
)