forked from larsmans/seqlearn
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
61 lines (53 loc) · 2.15 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
52
53
54
55
56
57
58
59
60
61
from Cython.Build import cythonize
from distutils.core import setup
from distutils.extension import Extension
import os.path
import re
import sys
dist_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(dist_dir, 'seqlearn/_version.py'), 'r') as f:
version = re.search("^ *__version__ = '(.*)'$", f.read()).group(1)
def readme():
try:
with open(os.path.join(dist_dir, 'README.rst')) as f:
return f.read()
except IOError:
return "seqlearn: sequence classification library for Python"
setup_options = dict(
name="seqlearn",
version=version,
description="Sequence learning toolkit",
maintainer="Lars Buitinck",
maintainer_email="[email protected]",
license="MIT",
url="https://github.com/larsmans/seqlearn",
packages=["seqlearn", "seqlearn._utils", "seqlearn._decode",
"seqlearn/tests"],
classifiers=[
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Scientific/Engineering :: Information Analysis",
"Topic :: Text Processing",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
],
ext_modules=cythonize(["seqlearn/_decode/bestfirst.pyx",
"seqlearn/_decode/viterbi.pyx",
"seqlearn/_utils/ctrans.pyx",
"seqlearn/_utils/safeadd.pyx"]),
requires=["sklearn"],
)
# For these actions, NumPy is not required. We want them to succeed without,
# for example when pip is used to install seqlearn without NumPy present.
NO_NUMPY_ACTIONS = ('--help-commands', 'egg_info', '--version', 'clean')
if not ('--help' in sys.argv[1:]
or len(sys.argv) > 1 and sys.argv[1] in NO_NUMPY_ACTIONS):
import numpy
setup_options['include_dirs'] = [numpy.get_include()]
setup(**setup_options)