This repository has been archived by the owner on May 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
146 lines (125 loc) · 4.21 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# Copyright (c) 2014 Per Unneberg
# Modelled on bokeh setup script
# --------------------------------------------------
# Imports
# --------------------------------------------------
from __future__ import print_function
# stdlib
import os
from setuptools import setup
from os.path import realpath, dirname, relpath, join
# Extensions
import versioneer
# --------------------------------------------------
# globals and constants
# --------------------------------------------------
ROOT = dirname(realpath(__file__))
# --------------------------------------------------
# classes and functions
# --------------------------------------------------
package_data = []
def package_path(path, filters=()):
if not os.path.exists(path):
raise RuntimeError("packaging non-existent path: %s" % path)
elif os.path.isfile(path):
package_data.append(relpath(path, 'snakemakelib'))
else:
for path, dirs, files in os.walk(path):
path = relpath(path, 'snakemakelib')
for f in files:
if not filters or f.endswith(filters):
package_data.append(join(path, f))
rule_suffixes = ('.rules', '.rule')
workflow_suffixes = ('.workflow')
data_suffixes = ('.fastq.gz', 'fa', '.csv', '.vcf', '.interval_list',
'.align_metrics', '.hs_metrics', '.insert_metrics',
'.dup_metrics', '.gtf')
package_path(join(ROOT, 'snakemakelib', '_templates'))
package_path(join(ROOT, 'snakemakelib', 'data'))
package_path(join(ROOT, 'snakemakelib', 'rules'), rule_suffixes)
package_path(join(ROOT, 'snakemakelib', 'workflows'), workflow_suffixes)
scripts = []
REQUIRES = [
'biopython>=1.64',
'pyyaml>=3.11',
'snakemake>=3.4.2',
'texttable>=0.8.2',
'sphinx>=1.3',
'pandas>=0.16.0',
'mock>=1.0.1',
'pysam>=0.8.3',
#'bokeh>=0.9.1',
#'bokehutils==0.1.3',
'pytest',
'pytest-cov>=1.8.1',
]
try:
# Hack for readthedocs
if not 'readthedocs' in os.path.dirname(os.path.realpath(__file__)):
REQUIRES.append('matplotlib>=1.4.0')
else:
print("readthedocs in path name; assuming we're building docs @readthedocs")
REQUIRES.append('sphinx-bootstrap-theme')
except:
pass
# https://pythonhosted.org/setuptools/setuptools.html
SETUP_REQUIRES = [
#'bokehutils==0.1.4',
]
# Adding github to setup:
# http://mike.zwobble.org/2013/05/adding-git-or-hg-or-svn-dependencies-in-setup-py/
DEPENDENCY_LINKS = [
#'https://github.com/percyfal/bokehutils/tarball/master@0.1.4#egg=bokehutils'
]
# Integrating pytest with setuptools: see
# https://pytest.org/latest/goodpractises.html#integrating-with-distutils-python-setup-py-test
from distutils.core import setup, Command
# you can also import from setuptools
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import subprocess
import sys
errno = subprocess.call([sys.executable, 'runtests.py'])
raise SystemExit(errno)
_version = versioneer.get_version()
_cmdclass = versioneer.get_cmdclass()
_cmdclass.update({'test': PyTest})
setup(
name="snakemakelib",
version=_version,
cmdclass=_cmdclass,
author="Per Unneberg",
author_email="per.unneberg@scilifelab.se",
description="Snakemake rule library with additional utilities",
license="MIT",
url="http://github.com/percyfal/snakemakelib",
scripts=scripts,
packages=[
'snakemakelib',
'snakemakelib.report',
'snakemakelib.report.tests',
'snakemakelib.bio',
'snakemakelib.bio.ngs',
'snakemakelib.bio.ngs.align',
'snakemakelib.bio.ngs.db',
'snakemakelib.bio.ngs.methylseq',
'snakemakelib.bio.ngs.qc',
'snakemakelib.bio.ngs.rnaseq',
'snakemakelib.bio.ngs.rnaseq.tests',
'snakemakelib.bio.ngs.tests',
'snakemakelib.bio.ngs.tools',
'snakemakelib.bio.ngs.tools.tests',
'snakemakelib.tests',
'snakemakelib.workflow',
'snakemakelib.workflows.tests',
],
package_data={'snakemakelib': package_data},
setup_requires=SETUP_REQUIRES,
install_requires=REQUIRES,
dependency_links=DEPENDENCY_LINKS,
)