-
Notifications
You must be signed in to change notification settings - Fork 9
/
setup.py
114 lines (100 loc) · 3.5 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
import sys
import os
import subprocess
import re
########################################################################
########################################################################
# Import setuptools
# Use existing setuptools, otherwise try ez_setup.
try:
import setuptools
except ImportError:
# try to get via ez_setup
# ez_setup did not work on all machines tested as
# it uses curl with https protocol, which is not
# enabled in ScientificLinux
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
from distutils.version import LooseVersion
if LooseVersion(setuptools.__version__) < LooseVersion('1.1'):
print(("Version detected:", LooseVersion(setuptools.__version__)))
raise ImportError(
"the CGAT code collection requires setuptools 1.1 higher")
########################################################################
########################################################################
IS_OSX = sys.platform == 'darwin'
########################################################################
########################################################################
# collect CGAT version
sys.path.insert(0, "scripts")
import version
version = version.__version__
###############################################################
###############################################################
# Check for external dependencies
#
# Not exhaustive, simply execute a representative tool from a toolkit.
external_dependencies = (
("wigToBigWig", "UCSC tools", 255),
("bedtools", "bedtools", 0),
)
for tool, toolkit, expected in external_dependencies:
try:
# py3k
from subprocess import DEVNULL
except ImportError:
DEVNULL = open(os.devnull, 'wb')
try:
retcode = subprocess.call(tool, shell=True,
stdout=DEVNULL, stderr=DEVNULL)
except OSError as msg:
print(("WARNING: depency check for %s failed: %s" % (toolkit, msg)))
# UCSC tools return 255 when called without arguments
if retcode != expected:
print(("WARNING: depency check for %s(%s) failed, error %i" %
(toolkit, tool, retcode)))
major, minor1, minor2, s, tmp = sys.version_info
if major < 3:
raise SystemExit("""CGAT requires Python 3 or later.""")
cgat_packages = find_packages()
cgat_package_dirs = {'cgatpipelines': 'cgatpipelines'}
# Classifiers
classifiers = """
Development Status :: 4 - Beta
Intended Audience :: Science/Research
Intended Audience :: Developers
License :: OSI Approved
Programming Language :: Python
Topic :: Software Development
Topic :: Scientific/Engineering
Operating System :: POSIX
Operating System :: Unix
Operating System :: MacOS
"""
setup(
# package information
name="cgatpipelines",
version=version,
description="cgat-flow : Next-generation sequencing pipelines",
author="Andreas Heger",
author_email="andreas.heger@gmail.com",
license="MIT",
platforms=["any"],
keywords="computational genomics",
long_description="cgatflow : Next-generation sequencing pipelines",
classifiers=[_f for _f in classifiers.split("\n") if _f],
url="https://github.com/cgat-developers/cgat-flow",
# package contents
packages=cgat_packages,
package_dir=cgat_package_dirs,
include_package_data=True,
entry_points={
"console_scripts": ["cgatflow = cgatpipelines.cgatflow:main"]
},
# extension modules
ext_modules=[],
# other options
zip_safe=False,
test_suite="tests",
)