-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsetup.py
73 lines (59 loc) · 2.03 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
import os
import sys
import subprocess
try:
import setuptools
except ImportError:
sys.exit("setuptools package not found. "
"Please use 'pip install setuptools' first")
from setuptools import setup
from distutils.command.build import build as DistutilsBuild
from distutils.spawn import find_executable
from stringdecomposer.__version__ import __version__
# Make sure we're running from the setup.py directory.
script_dir = os.path.dirname(os.path.realpath(__file__))
if script_dir != os.getcwd():
os.chdir(script_dir)
requirements_fn = os.path.join(script_dir, 'requirements.txt')
requirements = []
with open(requirements_fn) as f:
for line in f:
line = line.strip()
if line == 'python-edlib':
requirements.append('edlib')
else:
requirements.append(line)
description = \
"""
StringDecomposer (SD) algorithm takes the set of monomers
and a long error-prone read (or a genomic segment)
and partitions this read into distinct monomers,
providing an accurate translation of each read
from a nucleotide alphabet into a monomer alphabet.
"""
class MakeBuild(DistutilsBuild):
def run(self):
if not find_executable("make"):
sys.exit("ERROR: 'make' command is unavailable")
try:
subprocess.check_call(["make"])
except subprocess.CalledProcessError as e:
sys.exit("Compilation error: ", e)
DistutilsBuild.run(self)
setup(
name="StringDecomposer",
version=__version__,
description=description,
url='https://github.com/ablab/stringdecomposer',
author='Tatiana Dvorkina',
license='GNU General Public License v2.0',
install_requires=requirements,
packages=['stringdecomposer'],
package_dir={'stringdecomposer': 'stringdecomposer'},
package_data={'stringdecomposer': ['build/bin/dp', 'models/*', '*', 'py/*']},
entry_points={
'console_scripts': ['stringdecomposer=stringdecomposer.main:main']
},
cmdclass={'build': MakeBuild}
)