forked from Wyss/ssw-py
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
114 lines (95 loc) · 3.13 KB
/
setup.py
File metadata and controls
114 lines (95 loc) · 3.13 KB
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
test with:
python setup.py build_ext --inplace
build wheels with:
python setup.py bdist_wheel --plat-name win_amd64 --python-tag cp36
python setup.py bdist_wheel --plat-name macosx_10_10_x86_64 --python-tag cp36
python setup.py sdist --formats=gztar
twine upload dist/*
https://pypi.python.org/pypi/ssw-py
'''
DESCRIPTION = ("Complete Striped Smith-Waterman Library for Python")
LONG_DESCRIPTION = '''
**ssw-py** is a Python package
Cythonized wrapped version of:
https://github.com/mengyao/Complete-Striped-Smith-Waterman-Library
Original C library authors and paper should be cited if used.
Support for Python 3 at the moment
License is MIT
'''
try:
from setuptools import setup, Extension
except ImportError:
from distutils.core import setup, Extension
import numpy.distutils.misc_util
import os
import sys
import shutil
import re
import ast
pjoin = os.path.join
rpath = os.path.relpath
PACKAGE_PATH = os.path.abspath(os.path.dirname(__file__))
MODULE_PATH = pjoin(PACKAGE_PATH, 'ssw')
LIB_PATH = pjoin(MODULE_PATH, 'lib')
common_include = ['ssw/lib/CSSWL/src', 'ssw/lib']
if sys.platform == 'win32':
extra_compile_args = ['']
else:
extra_compile_args = ['-Wno-unused-function']
# source files to include in installation for tar.gz
ssw_files = [rpath(pjoin(root, f), MODULE_PATH) for root, _, files in
os.walk(LIB_PATH) for f in files if (
('.h' in f) or ('.c' in f) or ('.cpp' in f)
)
]
ssw_ext = Extension(
'ssw.sswpy',
sources=['ssw/sswpy.pyx',
'ssw/lib/CSSWL/src/ssw.c',
'ssw/lib/str_util.c'],
include_dirs=common_include + [numpy.get_include()],
extra_compile_args=extra_compile_args
)
# Initialize subtree with
# git subtree add --prefix=lib/CSSWL git@github.com:mengyao/Complete-Striped-Smith-Waterman-Library.git master
# Begin modified code from Flask's version getter
# BSD license
# Copyright (c) 2015 by Armin Ronacher and contributors.
# https://github.com/pallets/flask
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('ssw/__init__.py', 'rb') as initfile:
VERSION = str(ast.literal_eval(_version_re.search(
initfile.read().decode('utf-8')).group(1)))
DISTNAME = 'ssw-py'
LICENSE = 'MIT'
AUTHORS = "Nick Conway"
EMAIL = "nick.conway@wyss.harvard.edu"
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Environment :: Console',
'Intended Audience :: Science/Research',
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.6',
'Programming Language :: Cython',
'Topic :: Scientific/Engineering',
]
setup(
name=DISTNAME,
version=VERSION,
author=AUTHORS,
author_email=EMAIL,
url='https://github.com/Wyss/ssw-py',
packages=['ssw'],
ext_modules=[ssw_ext],
include_dirs=numpy.distutils.misc_util.get_numpy_include_dirs(),
package_data={'ssw': ssw_files},
description=DESCRIPTION,
long_description=LONG_DESCRIPTION,
license=LICENSE,
classifiers=CLASSIFIERS,
zip_safe=False
)