forked from pyranges/ncls
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
97 lines (75 loc) · 2.68 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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from distutils.core import setup
from setuptools import find_packages, Extension, Command
# try:
# from Cython.Build import cythonize
# except ImportError:
# def cythonize(*args, **kwargs):
# from Cython.Build import cythonize
# return cythonize(*args, **kwargs)
import os
import sys
CLASSIFIERS = """Development Status :: 5 - Production/Stable
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows :: Windows NT/2000
Operating System :: OS Independent
Operating System :: POSIX
Operating System :: POSIX :: Linux
Operating System :: Unix
Programming Language :: Python
Topic :: Scientific/Engineering
Topic :: Scientific/Engineering :: Bio-Informatics"""
# split into lines and filter empty ones
CLASSIFIERS = CLASSIFIERS.split("\n")
# macros = [("CYTHON_TRACE", "1")]
# # extension sources
# macros = []
# if macros:
# from Cython.Compiler.Options import get_directive_defaults
# directive_defaults = get_directive_defaults()
# directive_defaults['linetrace'] = True
# directive_defaults['binding'] = True
dir_path = os.path.dirname(os.path.realpath(__file__))
include_dirs = [dir_path + "/ncls/src", dir_path]
__version__ = open("ncls/version.py").readline().split(" = ")[1].replace(
'"', '').strip()
extensions = [
Extension(
"ncls.src.ncls", ["ncls/src/ncls.pyx", "ncls/src/intervaldb.c"],
# define_macros=macros,
include_dirs=include_dirs),
Extension(
"ncls.src.ncls32", ["ncls/src/ncls32.pyx", "ncls/src/intervaldb32.c"],
# define_macros=macros,
include_dirs=include_dirs),
Extension(
"ncls.src.fncls", ["ncls/src/fncls.pyx", "ncls/src/fintervaldb.c"],
# define_macros=macros,
include_dirs=include_dirs)]
# using setuptools to cythonize if cython not found
# not recommended by cython docs, but still
try:
from cython.Build import cythonize
ext_modules = cythonize(extensions, language_level=2)
except ImportError:
ext_modules = extensions
setup(
name = "ncls",
version=__version__,
packages=find_packages(),
ext_modules = ext_modules,
setup_requires = ["cython"],
install_requires = ["numpy"],
# py_modules=["pyncls"],
description = \
'A wrapper for the nested containment list data structure.',
long_description = __doc__,
# I am the maintainer; the datastructure was invented by
# Alexander V. Alekseyenko and Christopher J. Lee.
author = "Endre Bakken Stovner",
author_email='[email protected]',
url = 'https://github.com/endrebak/ncls',
license = 'New BSD License',
classifiers = CLASSIFIERS,
package_data={'': ['*.pyx', '*.pxd', '*.h', '*.c']},
include_dirs=["."],
)