-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
82 lines (68 loc) · 2.32 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
import glob
from setuptools import setup
from distutils.extension import Extension
import numpy
import pysam
name = 'genda'
version = '0.1'
try:
from Cython.Distutils import build_ext
except ImportError:
use_cython = False
print("Cython not found")
else:
use_cython = True
cmdclass = {}
ext_modules = []
includes = pysam.get_include()
includes.append(numpy.get_include())
if use_cython:
print('**********using cython*********')
ext_modules += [
Extension("genda.transcripts.exon_utils",
["genda/transcripts/exon_utils.pyx"],
include_dirs=includes),
Extension("genda.pysam_callbacks.allele_counter",
["genda/pysam_callbacks/allele_counter.pyx"],
include_dirs=includes,
define_macros=pysam.get_defines()),
Extension("genda.stats.aei_count_samples",
["genda/stats/aei_count_samples.pyx"],
include_dirs=includes,
define_macros=pysam.get_defines()),
]
print(ext_modules)
cmdclass.update({'build_ext': build_ext})
else:
ext_modules += [
Extension("genda.transcripts.exon_utils",
["genda/transcripts/exon_utils.c"]),
Extension("genda.pysam_callbacks.allele_counter",
["genda/pysam_callbacks/allele_counter.c"]),
Extension("genda.pysam_callbacks.gene_counter",
["genda/stats/aei_count_samples.c"]),
]
metadata = {'name': name,
'version': version,
'cmdclass': cmdclass,
'ext_modules': ext_modules,
'scripts': glob.glob('scripts/*.py'),
'description': 'genda',
'author': 'Jeffrey Hsu',
'packages': ['genda',
'genda.stats',
'genda.parsing',
'genda.formats',
'genda.pysam_callbacks',
'genda.transcripts',
'genda.AEI',
'genda.plotting',
'genda.eQTL'],
}
if __name__ == '__main__':
dist = setup(**metadata)
"""
Extension("genda.pysam_callbacks.gene_counter",
["genda/pysam_callbacks/gene_counter.pyx"],
include_dirs=pysam.get_include()),
"""