-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathsetup.py
More file actions
66 lines (53 loc) · 1.82 KB
/
setup.py
File metadata and controls
66 lines (53 loc) · 1.82 KB
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
# coding=utf-8
import os as os
from setuptools import setup, find_packages, Extension
def extract_package_info():
"""
:return:
"""
setup_path = os.path.dirname(os.path.abspath(__file__))
pck_path = os.path.join(setup_path, 'src', 'ashleyslib', '__init__.py')
assert os.path.isfile(pck_path), \
'Could not detect ashleys-lib init under path {}'.format(os.path.dirname(pck_path))
infos = dict()
with open(pck_path, 'r') as init:
for line in init:
if line.startswith('__'):
k, v = line.split('=')
infos[k.strip()] = eval(v.strip())
return infos
def read_requirements():
"""
:return:
"""
setup_path = os.path.dirname(os.path.abspath(__file__))
req_path = os.path.join(setup_path, 'requirements.txt')
req_pck = []
with open(req_path, 'r') as req:
for line in req:
if line.strip():
req_pck.append(line.strip())
return req_pck
def locate_executable():
"""
:return:
"""
setup_path = os.path.dirname(os.path.abspath(__file__))
script_path = os.path.join(setup_path, 'bin', 'ashleys.py')
relpath_script = os.path.relpath(script_path)
return relpath_script
pck_infos = extract_package_info()
setup(
name="ashleyslib",
version=pck_infos['__version__'],
packages=find_packages('src'),
package_dir={'': 'src'},
scripts=[locate_executable()],
install_requires=read_requirements(),
author=pck_infos['__author__'],
author_email=pck_infos['__email__'],
description="Automated Selection of High quality Libraries for the Extensive analYsis of Strandseq data",
license="MIT",
url="https://github.com/friendsofstrandseq/ashleys-qc" # project home page, if any
# could also include long_description, download_url, classifiers, etc.
)