-
Notifications
You must be signed in to change notification settings - Fork 14
/
setup.py
109 lines (95 loc) · 3.69 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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
#!/usr/bin/env python
"""setup.py for shorah."""
import glob
import sys
import os
import shutil
from setuptools import setup, find_packages
from setuptools.command.test import test as TestCommand
from setuptools.command.develop import develop
from setuptools.command.install import install
def move_files():
"""Identify the build directory and copy executables into src/shorah."""
try:
diri_file = glob.glob('*/src/cpp/diri_sampler')[0]
except IndexError:
sys.exit('No executable diri_sampler found. Build first.')
exe_dir = os.path.dirname(diri_file)
for exe in ['b2w', 'diri_sampler', 'fil']:
shu = shutil.copy('%s/%s' % (exe_dir, exe), 'src/shorah/bin')
print(shu)
class CustomDevelop(develop):
"""Subclassing develop to install files in the correct location."""
def run(self):
move_files()
develop.run(self)
class CustomInstall(install):
"""Subclassing develop to install files in the correct location."""
def run(self):
move_files()
install.run(self)
class PyTest(TestCommand):
"""Subclass TestCommand to run python setup.py test."""
user_options = [('pytest-args=', 'a', "Arguments to pass to py.test")]
def initialize_options(self):
TestCommand.initialize_options(self)
self.pytest_args = []
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
#import here, cause outside the eggs aren't loaded
import pytest
errno = pytest.main(self.pytest_args)
sys.exit(errno)
setup(
use_scm_version=True,
setup_requires=['setuptools_scm', 'setuptools_scm_git_archive'],
install_requires=['setuptools_scm'],
tests_require=['pytest', 'flake8', 'pep257'],
cmdclass={
'test': PyTest,
'install': CustomInstall,
'develop': CustomDevelop
},
name='ShoRAH',
description='SHOrt Reads Assembly into Haplotypes',
url='http://github.com/cbg-ethz/shorah',
packages=find_packages(where='src'), # include all packages under src
package_dir={'': 'src'}, # tell setuptools packages are under src
entry_points={
'console_scripts': ['shorah = shorah.cli:main']
},
license='GPL 3.0',
long_description='''
ShoRAH is designed to analyse genetically heterogeneous samples. It provides error correction,
local haplotype reconstruction, and estimation of the frequency of the different genetic variants
present in a mixed sample.
''',
project_urls={
'Documentation': 'http://cbg-ethz.github.io/shorah',
'Source': 'https://github.com/cbg-ethz/shorah',
},
classifiers=[
# How mature is this project? Common values are
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
'Development Status :: 5 - Production/Stable',
# Indicate who your project is intended for
'Intended Audience :: Developers',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Medical Science Apps.',
# Pick your license as you wish (should match "license" above)
'License :: GPL 3.0',
# Specify the Python versions you support here. In particular, ensure
# that you indicate whether you support Python 2, Python 3 or both.
# 'Programming Language :: Python :: 2',
# 'Programming Language :: Python :: 2.6',
# 'Programming Language :: Python :: 2.7',
# 'Programming Language :: Python :: 3',
# 'Programming Language :: Python :: 3.2',
# 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.7']
)