-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
86 lines (80 loc) · 2.72 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
import os, sys
from setuptools import setup
from distutils.extension import Extension
def get_version(m):
xs = m.__version__.split('.')
xs += ['0', '0']
version, major, minor = xs[:3]
return version, major, minor
if not sys.version_info[:2] == (2, 7):
raise Exception('''\
Edd requires python version 2.7.x, but you are using %d.%d.%d''' %
sys.version_info[:3])
try:
import numpy as np
except ImportError:
raise Exception('''\
EDD has compile time dependencies on numpy. So please install numpy first.
e.g.: pip install --upgrade numpy''')
try:
import pysam
version, major, minor = get_version(pysam)
too_old_pysam = int(version) == 0 and int(major) < 10
too_recent_pysam = int(version) != 0 or int(major) >= 12
if too_old_pysam or too_recent_pysam:
sys.stderr.write('''\
###########
# ERROR #
###########
EDD is only compatible with pysam versions from 0.10.0 up to and including 0.11.2.2.
The detected version was %s.
Aborting ...
''' % pysam.__version__)
sys.exit(1)
except ImportError:
raise Exception('''\
EDD has compile time dependencies on pysam. So please install pysam first.
e.g.: pip install --upgrade pysam''')
try:
from Cython.Distutils import build_ext # Cython should be installed via pysam
#from Cython.Distutils.extension import Extension
except ImportError:
raise Exception('please install cython first, e.g.: pip install --upgrade cython')
setup(name='edd',
version='1.1.19',
description='Enriched domain detector for ChIP-seq data',
url='http://github.com/CollasLab/edd',
author='Eivind G. Lund',
author_email='e.g.lund@medisin.uio.no',
packages=['eddlib',
'eddlib.algorithm'],
# installs into root dir (not what i want)
#data_files=[('eddlib', ['eddlib/default_parameters.conf'])],
package_data={'': ['*.conf']},
scripts=[
'bin/edd',
#'bin/edd-tools',
],
install_requires=[
'Logbook',
'pybedtools',
'statsmodels',
'patsy', # statsmodels dependency
'pandas',
'python-dateutil', # pandas dependency
'scipy',
'numpy',
'pysam>=0.10,<0.12',
],
ext_modules=[
Extension('eddlib.read_bam',
sources=['eddlib/read_bam.pyx'],
include_dirs=pysam.get_include() + [np.get_include()],
define_macros=pysam.get_defines(),
),
Extension('eddlib.algorithm.chrom_max_segments',
sources=['eddlib/algorithm/chrom_max_segments.pyx'],
include_dirs=[np.get_include()]),
],
cmdclass = {'build_ext': build_ext},
)