-
Notifications
You must be signed in to change notification settings - Fork 33
/
setup.py
51 lines (44 loc) · 1.31 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
from distutils.core import setup, Extension
from distutils.cmd import Command
import os
import sys
import os.path as op
def get_version():
with open(os.path.join(os.path.dirname(__file__), 'pydeep.c'),'r') as f:
for line in f:
if "#define PYDEEP_VERSION" in line:
return line.split()[-1].strip('"')
class TestCommand(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
os.chdir(op.join(op.dirname(op.abspath(__file__)), "tests"))
errno = subprocess.call([sys.executable, 'test.py'])
if errno != 0:
raise SystemExit(errno)
else:
os.chdir("..")
setup(
name = "pydeep",
author = "Kiran Bandla",
author_email = "[email protected]",
license = "BSD",
version = get_version(),
description = "Python bindings for ssdeep",
long_description = "Python/C Wrapper for the ssdeep library",
url = "http://www.github.com/kbandla/pydeep",
ext_modules = [Extension(
"pydeep",
sources = ["pydeep.c"],
libraries = ["fuzzy"],
library_dirs = ["/usr/local/lib/",],
include_dirs = ["/usr/local/include/",],
) ],
cmdclass={
'test': TestCommand
},
)