-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
executable file
·153 lines (127 loc) · 4.83 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
#!/usr/bin/env python
# -*- coding: latin-1 -*-
#
# Copyright John Reid 2010, 2011, 2012, 2013
#
"""
aksetup setup script for pyseqan. Adapted from http://git.tiker.net/pyublas.git/tree.
"""
import os
def read(*fnames):
"""
Utility function to read the README file.
Used for the long_description. It's nice, because now 1) we have a top level
README file and 2) it's easier to type in the README file than to put a raw
string in below ...
"""
return open(os.path.join(os.path.dirname(__file__), *fnames)).read()
def get_config_schema():
from aksetup_helper import ConfigSchema, BoostLibraries, \
Option, StringListOption, make_boost_base_options
import sys
if 'darwin' in sys.platform:
default_libs = []
default_cxxflags = ['-arch', 'i386', '-arch', 'x86_64',
'-isysroot', '/Developer/SDKs/MacOSX10.6.sdk']
default_ldflags = default_cxxflags[:]
else:
default_cxxflags = []
default_ldflags = []
return ConfigSchema(
make_boost_base_options() + [
BoostLibraries("python"),
Option("SEQAN_DIR"),
StringListOption("CXXFLAGS", ["-Wno-sign-compare"],
help="Any extra C++ compiler options to include"),
StringListOption("LDFLAGS", [],
help="Any extra linker options to include"),
]
)
def main():
from aksetup_helper import hack_distutils, get_config, setup
from setuptools import find_packages, Extension
hack_distutils()
conf = get_config(get_config_schema())
INCLUDE_DIRS = [
'c++',
os.path.join('c++', 'include'),
os.path.join('c++', 'boost-indexing-suite'),
os.path.join('c++', 'myrrh'),
] + conf['BOOST_INC_DIR'] + [os.path.join(conf['SEQAN_DIR'], 'include')]
LIBRARY_DIRS = conf['BOOST_LIB_DIR']
LIBRARIES = conf['BOOST_PYTHON_LIBNAME']
EXTRA_DEFINES = {
"SEQAN_ENABLE_TESTING" : "0",
"SEQAN_ENABLE_DEBUG" : "0",
"BOOST_DISABLE_ASSERTS" : "0",
"MYRRH_DISABLE_ASSERTS" : "0",
}
try:
from distutils.command.build_py import build_py_2to3 as build_py
except ImportError:
# 2.x
from distutils.command.build_py import build_py
#
# C++ extension
#
seqanext = Extension(
'seqan._release_build._seqan',
[
'c++/src/expose_indexes.cpp',
'c++/src/expose_simple_types.cpp',
'c++/src/expose_strings.cpp',
'c++/src/module_pyseqan.cpp',
],
include_dirs = INCLUDE_DIRS,
library_dirs = LIBRARY_DIRS,
libraries = LIBRARIES + ['rt'],
define_macros = list(EXTRA_DEFINES.items()),
extra_compile_args = [
'-std=c++0x',
'-Wno-deprecated-declarations',
] + conf['CXXFLAGS'],
extra_link_args = conf['LDFLAGS'],
)
#
# Main setup
#
setup(
name = 'pyseqan',
version = read('python', 'seqan', 'VERSION').strip().split('-')[0],
description = 'pyseqan: A package to expose SeqAn suffix array functionality.',
long_description = read('python', 'seqan', 'README'),
author ='John Reid',
author_email ='[email protected]',
license = 'BSD',
url ='http://sysbio.mrc-bsu.cam.ac.uk/johns/pyseqan/docs/build/html/index.html',
classifiers = [
'Development Status :: 5 - Production/Stable',
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: MacOS :: MacOS X',
'Operating System :: POSIX',
'Operating System :: Microsoft :: Windows',
'Programming Language :: Python',
'Programming Language :: C++',
'Topic :: Scientific/Engineering',
'Topic :: Scientific/Engineering :: Mathematics',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Utilities',
],
packages = find_packages(where='python'),
package_dir = { '' : 'python' },
#py_modules = ['pybool.examples.tutorial']
package_data = { 'seqan': ['README', 'LICENSE', 'VERSION'] },
install_requires = [
'cookbook',
],
#scripts = ['python/scripts/pybool-find-consistent'],
ext_modules = [seqanext],
# 2to3 invocation
cmdclass = {'build_py': build_py},
include_package_data = False,
)
if __name__ == '__main__':
main()