forked from biocore/improved-octo-waddle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
93 lines (77 loc) · 3.01 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
# ----------------------------------------------------------------------------
# Copyright (c) 2013--, BP development team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file LICENSE, distributed with this software.
# ----------------------------------------------------------------------------
import os
from setuptools import setup
from setuptools.extension import Extension
from setuptools.command.build_py import build_py
import numpy as np
classes = """
Development Status :: 4 - Beta
License :: OSI Approved :: BSD License
Topic :: Scientific/Engineering
Programming Language :: Python
Programming Language :: Python :: 3.5
Operating System :: Unix
Operating System :: POSIX
Operating System :: MacOS :: MacOS X
"""
classifiers = [s.strip() for s in classes.split('\n') if s]
long_description = """An implementation of a balanced tree as described by
Cordova and Navarro"""
USE_CYTHON = os.environ.get('USE_CYTHON', True)
ext = '.pyx' if USE_CYTHON else '.c'
extensions = [Extension("bp._bp",
["bp/_bp" + ext],
include_dirs=['BitArray/'],
library_dirs=['BitArray/'],
libraries=['bitarr']),
Extension("bp._io",
["bp/_io" + ext], ),
Extension("bp._conv",
["bp/_conv" + ext], ),
Extension("bp._binary_tree",
["bp/_binary_tree" + ext], ),
Extension("bp.tests.test_bp_cy",
["bp/tests/test_bp_cy" + ext],
include_dirs=['BitArray/'],
library_dirs=['BitArray/'],
libraries=['bitarr']),
]
extensions.extend([Extension("bp._ba",
["bp/_ba" + ext],
include_dirs=['BitArray/'],
library_dirs=['BitArray/'],
libraries=['bitarr'])])
if USE_CYTHON:
from Cython.Build import cythonize
extensions = cythonize(extensions)
import subprocess
bitarr = os.path.join(os.path.abspath(__file__).rsplit('/', 1)[0], 'BitArray')
class BitArrayInstall(build_py):
def run(self):
subprocess.run(['make', '-C', bitarr, 'libbitarr.a'])
build_py.run(self)
setup(name='iow',
version="0.1.2",
description='Balanced parentheses',
author='Daniel McDonald',
author_email='mcdonadt@colorado.edu',
maintainer='Daniel McDonald',
maintainer_email='mcdonadt@colorado.edu',
url='https://github.com/wasade/improved-octo-waddle',
packages=['bp'],
ext_modules=extensions,
include_dirs=[np.get_include(), 'BitArray/'],
setup_requires=['numpy >= 1.9.2'],
install_requires=[
'numpy >= 1.9.2',
'nose >= 1.3.7',
'cython >= 0.24.1',
'scikit-bio >= 0.5.0, < 0.6.0'],
long_description=long_description,
cmdclass={'build_py': BitArrayInstall})