-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.py
49 lines (43 loc) · 1.46 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
from distutils.core import setup
from distutils.extension import Extension
import sys, os.path
# Use Pyrex
#import distutils.sysconfig
#if distutils.sysconfig.get_config_var('CC').startswith("gcc"):
# pyrex_compile_options = []
#else:
pyrex_compile_options = []
if sys.platform == "win32" and len(sys.argv) < 2:
sys.argv[1:] = ["bdist_wininst"]
# Compiling Pyrex modules to .c and .so
try:
import Pyrex.Distutils
except ImportError:
distutils_extras = {}
pyrex_suffix = ".c"
else:
class pyrex_build_ext(Pyrex.Distutils.build_ext):
def pyrex_compile(self, source):
from Pyrex.Compiler.Main import CompilationOptions, default_options
options = CompilationOptions(default_options)
result = Pyrex.Compiler.Main.compile(source, options)
if result.num_errors <> 0:
sys.exit(1)
distutils_extras = {
"cmdclass": {
'build_ext': pyrex_build_ext}}
pyrex_suffix = ".pyx"
def PIExtension(module_name):
path = module_name.replace('.', '/')
return Extension(module_name, [path + pyrex_suffix],
extra_compile_args = pyrex_compile_options)
setup(
name = "PI",
version = "0.01",
url = "http://www.baselineresearch.net/PI",
author_email = "[email protected]",
description = "Protocol analysis toolkit using bioinformatics algorithms",
packages = ["PI"],
ext_modules=[
PIExtension("PI.align")],**distutils_extras
)