-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathsetup.py
87 lines (81 loc) · 3.13 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
import os
import sys
from setuptools import setup
from distutils.core import Extension
# We do some trickery to assure SWIG is always run before installing the
# generated files.
# http://stackoverflow.com/questions/12491328/python-distutils-not-include-the-swig-generated-module
from setuptools.command.install import install
from distutils.command.build import build
class CustomBuild(build):
def run(self):
self.run_command('build_ext')
build.run(self)
class CustomInstall(install):
def run(self):
self.run_command('build_ext')
self.do_egg_install()
custom_cmdclass = {'build': CustomBuild, 'install': CustomInstall}
if sys.version_info < (2, 6):
raise Exception('extractor requires Python 2.6 or higher.')
# This is quite the hack, but we don't want to import our package from here
# since that's recipe for disaster (it might have some uninstalled
# dependencies, or we might import another already installed version).
distmeta = {}
for line in open(os.path.join('extractor', '__init__.py')):
try:
field, value = (x.strip() for x in line.split('='))
except ValueError:
continue
value = value.strip('\'"')
distmeta[field] = value
# The __version__ value is actually defined in extractor.h.
for line in open(os.path.join('extractor', 'extractor.h')):
if ' VERSION = ' in line:
version = line.split('=')[-1].replace(';', '').replace('"', '') \
.replace("'", '').strip()
distmeta['__version__'] = version
distmeta['__version_info__'] = tuple(version.split('.'))
break
try:
with open('README.md') as readme:
long_description = readme.read()
except IOError:
long_description = 'See ' + distmeta['__homepage__']
setup(
name='description-extractor',
cmdclass=custom_cmdclass,
ext_modules=[Extension('_extractor', ['extractor/extractor.i',
'extractor/extractor.cc'], swig_opts=['-c++'])],
version=distmeta['__version__'],
description='HGVS variant description extractor',
long_description=long_description,
author=distmeta['__author__'],
author_email=distmeta['__contact__'],
url=distmeta['__homepage__'],
license='MIT License',
platforms=['any'],
packages=['extractor'],
classifiers = [
'Development Status :: 3 - Alpha',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: C++',
'Topic :: Scientific/Engineering',
],
keywords='bioinformatics',
install_requires=['biopython',
'crossmapper==0.0.1'],
dependency_links=[
'https://github.com/mutalyzer/crossmapper/archive/v0.0.1.tar.gz#egg=crossmapper-0.0.1'
]
)