forked from databio/pypiper
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (48 loc) · 2.03 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
#! /usr/bin/env python
import os
import sys
extra = {}
try:
from setuptools import setup
if sys.version_info < (2, 7):
extra['install_requires'] = ['argparse']
if sys.version_info >= (3,):
extra['use_2to3'] = True
except ImportError:
from distutils.core import setup
if sys.version_info < (2, 7):
extra['dependencies'] = ['argparse']
def read_reqs_file(reqs_name):
""" Read requirements file for given requirements group. """
path_reqs_file = os.path.join(
"requirements", "reqs-{}.txt".format(reqs_name))
with open(path_reqs_file, 'r') as reqs_file:
return [pkg.rstrip() for pkg in reqs_file.readlines()
if not pkg.startswith("#")]
with open(os.path.join("pypiper", "_version.py"), 'r') as versionfile:
version = versionfile.readline().split()[-1].strip("\"'\n")
# Requirements for tests
test_reqs = read_reqs_file("test")
# Allow specification of desired features, which implies dependencies.
addl_reqs = {bundle_name: read_reqs_file(bundle_name)
for bundle_name in ["ngstk", "plot"]}
# Complete collection of user requirements.
addl_reqs["all"] = list({pkg for bundle in addl_reqs.values() for pkg in bundle})
# Dev installation is full user + test.
addl_reqs["dev"] = list(set(test_reqs + addl_reqs["all"]))
setup(
name='pypiper',
packages=['pypiper'],
version=version,
description='A lightweight python toolkit for gluing together restartable, robust command line pipelines',
author='Nathan Sheffield, Johanna Klughammer, Andre Rendeiro',
url='https://github.com/epigen/pypiper/',
test_suite="tests", # python setup.py test
tests_require=test_reqs, # Test-specific package dependencies
# Extra package if doing `python setup.py test`
setup_requires=(["pytest-runner"] if {"test", "pytest", "ptr"} & set(sys.argv) else []),
extras_require=addl_reqs,
# Version-specific items
**extra
)