-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·88 lines (77 loc) · 2.43 KB
/
Copy pathsetup.py
File metadata and controls
executable file
·88 lines (77 loc) · 2.43 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
#!/usr/bin/env python3
import sys
import os, os.path
from setuptools import setup, find_packages
from distutils.extension import Extension
from distutils.dep_util import newer_group
try:
from numpy import get_include as np_get_include
except ImportError:
print("This extension requires numpy.")
sys.exit(1)
try:
from Cython.Distutils import build_ext
except ImportError:
print("Cython not present, compiling from distributed .c")
HAVECYTHON = False
else:
print("Cython present, building from .pyx")
HAVECYTHON = True
sources_cython = [os.path.join('cython','qasim.pyx'),
os.path.join('cython','genreads.c'),]
sources_nocyth = [os.path.join('cython','qasim.c'),
os.path.join('cython','genreads.c'),]
args = sys.argv[1:]
# If command is sdist, bail if no Cython available, or if qasim.c is out
# of date - distribution must have up-to-date qasim.c file.
if args.count('sdist'):
if not HAVECYTHON:
print("sdist for this package requires Cython.")
sys.exit(3)
if newer_group(sources_cython, os.path.join('cython','qasim.c')):
print("qasim.c is out of date\nRun 'setup.py build_ext' "
"before creating distribution")
sys.exit(4)
name = 'Qasim'
cmdclass = {}
requires = ['numpy', 'setuptools']
include_dirs = ['cython', np_get_include()]
ext_modules = []
packages = ['qasim']
package_dir = {'qasim':'qasim'}
version = '1.9.4'
author = 'Conrad Leonard'
author_email = 'conrad.leonard@hotmail.com'
platforms = ['linux']
ext_qasim = 'qasim.qasim'
license = 'MIT'
keywords = ['bioinformatics', 'simulation']
url = "https://github.com/delocalizer/qasim"
description = "Generate diploid mutations and simulate HTS reads"
scripts = ["scripts/qasim_cli.py"]
if HAVECYTHON:
e = Extension(ext_qasim, sources_cython, include_dirs)
e.cython_directives = {"boundscheck":False}
cmdclass.update({'build_ext': build_ext})
ext_modules.append(e)
else:
e = Extension(ext_qasim, sources_nocyth, include_dirs)
ext_modules.append(e)
setup(
name = name,
cmdclass = cmdclass,
requires = requires,
ext_modules = ext_modules,
packages = packages,
package_dir = package_dir,
version = version,
author = author,
author_email = author_email,
platforms = platforms,
test_suite = 'tests',
license = license,
url = url,
description = description,
long_description = description,
scripts = scripts
)