forked from nanoporetech/tombo
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup.py
95 lines (83 loc) · 2.96 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
from __future__ import unicode_literals
import os
import sys
import re
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext as _build_ext
# Get the version number from _version.py, and exe_path
verstrline = open(os.path.join('tombo', '_version.py'), 'r').readlines()[-1]
vsre = r"^TOMBO_VERSION = ['\"]([^'\"]*)['\"]"
mo = re.search(vsre, verstrline)
if mo:
__version__ = mo.group(1)
else:
raise RuntimeError('Unable to find version string in "tombo/_version.py".')
def readme():
with open('README.rst') as f:
return f.read()
try:
import numpy as np
include_dirs = [np.get_include()]
except:
sys.stderr.write(
'*' * 60 + '\nINSTALLATION ERROR:\n'
'\tNeed to install numpy before tombo installation.\n' +
'\tThis is required in order to get maximum efficincy from ' +
'cython code optimizations.\nTo install run:\n$ pip install numpy\n' +
'*' * 60 + '\n')
sys.exit()
extras_require = ['pyfaidx']
if sys.version_info[0] < 3:
extras_require.append('rpy2<=2.8.6')
else:
extras_require.append('rpy2')
ext_modules = [
Extension(str("tombo._c_dynamic_programming"),
[str("tombo/_c_dynamic_programming.pyx")],
include_dirs=include_dirs,
language="c++"),
Extension(str("tombo._c_helper"),
[str("tombo/_c_helper.pyx")],
include_dirs=include_dirs,
language="c++")
]
for e in ext_modules:
e.cython_directives = {"embedsignature": True}
setup(
name = "ont-tombo",
version = __version__,
packages = ["tombo"],
install_requires = ['h5py', 'numpy', 'scipy', 'cython',
'setuptools >= 18.0', 'mappy >= 2.10', 'future', 'tqdm'],
extras_require={'full':extras_require},
author = "Marcus Stoiber",
author_email = "[email protected]",
description='Analysis of raw nanopore sequencing data.',
long_description = readme(),
license = "mpl-2.0",
keywords = "nanopore high-throughput sequencing correction genome",
url = "https://github.com/nanoporetech/tombo",
entry_points={
'console_scripts': [
'tombo = tombo.__main__:main'
]
},
include_package_data=True,
ext_modules=ext_modules,
test_suite='nose2.collector.collector',
tests_require=['nose2'],
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Science/Research',
'Natural Language :: English',
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Scientific/Engineering :: Bio-Informatics',
]
)