-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.py
79 lines (65 loc) · 1.93 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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import io
import re
import os
import os.path as op
from setuptools import setup, find_packages
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Science/Research",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Topic :: Scientific/Engineering :: Bio-Informatics"
]
NAME = "cphasing"
setup_dir = op.abspath(op.dirname(__file__))
requirements = [x.strip() for x in open(op.join(setup_dir, "requirements.txt"))]
def _read(*args, **kwargs):
filepath = os.path.join(os.path.dirname(__file__), *args)
encoding = kwargs.pop("encoding", "utf-8")
with io.open(filepath, encoding=encoding) as fh:
text = fh.read()
return text
def get_version():
version = re.search(
r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
_read("cphasing", "__init__.py"),
re.MULTILINE,
).group(1)
return version
def get_author():
author = re.search(
r'^__author__\s*=\s*\S*[\'"]([^\'"]*)[\'"]',
_read("cphasing", "__init__.py"),
re.MULTILINE,
).group(1)
return author
def get_email():
email = re.search(
r'^__email__\s*=\s*\S*[\'"]([^\'"]*)[\'"]',
_read("cphasing", "__init__.py"),
re.MULTILINE,
).group(1)
return email
def get_license():
license = re.search(
r'^__license__\s*=\s*[\'"]([^\'"]*)[\'"]',
_read("cphasing", "__init__.py"),
re.MULTILINE,
).group(1)
return license
setup(
name=NAME,
author=get_author(),
author_email=get_email(),
version=get_version(),
license=get_license(),
classifiers=classifiers,
packages=find_packages(),
scripts=['bin/cphasing', 'bin/cphasing-cli'],
zip_safe=False,
url='http://github.com/wangyibin/CPhasing',
description="Phasing and scaffolding polyploid genomes based on Pore-C or Hi-C data",
install_requires=requirements
)