-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
29 lines (23 loc) · 791 Bytes
/
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
from distutils.core import setup, Extension
from distutils.command.build import build
from Cython.Build import cythonize
from subprocess import call
class PySpellingCorrectorBuild(build):
def run(self):
cmd = "make"
def build():
call(cmd)
self.execute(build, [], 'Compiling spelling corrector...')
Extensions = [
Extension("Token", sources=["cython-src/PyToken.pyx"], language="c++"),
Extension("SpellingCorrector", sources=["cython-src/PySpellingCorrector.pyx"], language="c++")
]
setup(
name="py-spelling-corrector",
description="A Python wrapper for a spelling corrector written in C++.",
author="Joe Khoury",
ext_modules=cythonize(Extensions),
cmdclass={
'build': PySpellingCorrectorBuild,
}
)