-
Notifications
You must be signed in to change notification settings - Fork 111
Expand file tree
/
Copy pathsetup.py
More file actions
53 lines (46 loc) · 1.47 KB
/
setup.py
File metadata and controls
53 lines (46 loc) · 1.47 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
import os
from distutils.command.build import build
from setuptools.command.install import install
from setuptools import setup
from setuptools.extension import Extension
this_dir = os.path.dirname(os.path.abspath(__file__))
openspell = Extension(
name='_openspell',
include_dirs=[this_dir],
sources=[
os.path.join(this_dir, 'openspell', 'lang_model.cpp'),
os.path.join(this_dir, 'openspell', 'spell_corrector.cpp'),
os.path.join(this_dir, 'openspell', 'utils.cpp'),
os.path.join(this_dir, 'openspell.i'),
],
extra_compile_args=['-std=c++11'],
swig_opts=['-c++'],
)
class CustomBuild(build):
def run(self):
self.run_command('build_ext')
build.run(self)
class CustomInstall(install):
def run(self):
self.run_command('build_ext')
self.do_egg_install()
VERSION = '0.0.2'
setup(
name='openspell',
version='0.0.1',
author='Filipp Ozinov',
author_email='fippo@mail.ru',
url='https://github.com/bakwc/OpenSpell',
download_url='https://github.com/bakwc/OpenSpell/tarball/' + VERSION,
description='spell checker',
long_description='context-based spell checker',
keywords=['nlp', 'spell', 'spell-checker'],
classifiers=[
'Programming Language :: Python :: 2.7',
'License :: OSI Approved :: MIT License',
],
py_modules=['openspell'],
ext_modules=[openspell],
zip_safe=False,
cmdclass={'build': CustomBuild, 'install': CustomInstall},
)