forked from bcbio/bcbio-nextgen
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
48 lines (43 loc) · 1.64 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
#!/usr/bin/env python
"""Setup file and install script for NextGen sequencing analysis scripts.
"""
import sys
import os
from setuptools import setup, find_packages
version = "0.8.0a"
def write_version_py():
version_py = os.path.join(os.path.dirname(__file__), 'bcbio', 'pipeline',
'version.py')
try:
import subprocess
p = subprocess.Popen(["git", "rev-parse", "--short", "HEAD"],
stdout=subprocess.PIPE)
githash = p.stdout.read().strip()
except:
githash = ""
with open(version_py, "w") as out_handle:
out_handle.write("\n".join(['__version__ = "%s"' % version,
'__git_revision__ = "%s"' % githash]))
with open("requirements.txt", "r") as f:
install_requires = [x.strip() for x in f.readlines() if not x.startswith(("bcbio-nextgen", "#"))]
# library-only install: enable skipping of scripts and requirements for conda builds
if "--record=/dev/null" in sys.argv:
scripts = []
install_requires = []
zip_safe = True
else:
zip_safe = False
scripts = ['scripts/bcbio_nextgen.py']
write_version_py()
setup(name="bcbio-nextgen",
version=version,
author="Brad Chapman and bcbio-nextgen contributors",
author_email="[email protected]",
description="Best-practice pipelines for fully automated high throughput sequencing analysis",
long_description=(open('README.rst').read()),
license="MIT",
url="https://github.com/chapmanb/bcbio-nextgen",
packages=find_packages(),
zip_safe=zip_safe,
scripts=scripts,
install_requires=install_requires)