forked from CGATOxford/UMI-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
126 lines (107 loc) · 3.85 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
import sys
import os
import glob
from ez_setup import use_setuptools
use_setuptools("10.0")
import setuptools
from setuptools import setup, find_packages, Extension
from distutils.version import LooseVersion
if LooseVersion(setuptools.__version__) < LooseVersion('1.1'):
print ("Version detected:", LooseVersion(setuptools.__version__))
raise ImportError(
"umi_tools requires setuptools 1.1 higher")
########################################################################
########################################################################
# collect umi_tools version
sys.path.insert(0, "umi_tools")
import version
version = version.__version__
###############################################################
###############################################################
# Define dependencies
# Perform a umi_tools Installation
major, minor1, minor2, s, tmp = sys.version_info
if (major == 2 and minor1 < 7) or major < 2:
raise SystemExit("""umi_tools requires Python 2.7 or later.""")
umi_tools_packages = ["umi_tools"]
umi_tools_package_dirs = {'umi_tools': 'umi_tools'}
# debugging pip installation
#install_requires = []
#for requirement in (
# l.strip() for l in open('requirements.txt') if not l.startswith("#")):
# install_requires.append(requirement)
install_requires = [
"setuptools>=1.1",
"numpy>=1.7",
"pandas>=0.12.0",
"future",
"regex",
"scipy",
"matplotlib"]
# This is a hack. When Pysam is installed from source, the recorded
# version is 0.2.3, even though a more recent version is actaully
# installed. In the following, if pysam is not detected, pysam will be
# install, presumably this will be the lastest version. If pysam is
# present detect its version with pysam.__version__. The only problem
# with this is that if pysam is present, but out of date, the system
# will not recognise the update
try:
import pysam
if LooseVersion(pysam.__version__) < LooseVersion('0.8.4'):
print("""
######################################################################
#
# WARNING:
# Pysam is installed, but not recent enough. We will update pysam, but
# the system may fail to detect that pysam has been updated. If this
# happens please run setup again"
#
######################################################################
""")
install_requires.append("pysam>=0.8.4")
except ImportError:
install_requires.append("pysam")
##########################################################
##########################################################
# Classifiers
classifiers = """
Development Status :: 3 - Alpha
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='umi_tools',
version=version,
description='umi_tools: Tools for UMI analyses',
author='Ian Sudbery',
author_email='i.sudbery@sheffield.ac.uk',
license="MIT",
platforms=["any"],
keywords="computational genomics",
long_description='umi_tools: Tools for UMI analyses',
classifiers=list(filter(None, classifiers.split("\n"))),
url="https://github.com/CGATOxford/UMI-tools",
download_url="https://github.com/CGATOxford/UMI-tools/tarball/%s" % version,
# package contents
packages=umi_tools_packages,
package_dir=umi_tools_package_dirs,
include_package_data=True,
# dependencies
#setup_requires=['cython'],
install_requires=install_requires,
# extension modules
ext_modules=[Extension("umi_tools._dedup_umi", ["umi_tools/_dedup_umi.c"])],
entry_points={
'console_scripts': ['umi_tools = umi_tools.umi_tools:main']
},
# other options
zip_safe=False,
)