-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (51 loc) · 1.38 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
"""
setup.py:
This file is used to install the package.
"""
import os
import glob
from setuptools import setup, find_packages, Extension
print("Running setup.py...")
# Set the project metadata
NAME = "contextsv"
VERSION = "1.0.0"
AUTHOR = "WGLab"
DESCRIPTION = "ContextSV: A tool for integrative structural variant detection."
# Get the conda environment's include path
conda_prefix = os.environ.get("CONDA_PREFIX")
if conda_prefix is None:
raise AssertionError("CONDA_PREFIX is not set.")
conda_include_dir = os.path.join(conda_prefix, "include")
# Get the conda environment's lib path
conda_lib_dir = os.path.join(conda_prefix, "lib")
# Set the project dependencies
SRC_DIR = "src"
SRC_FILES = glob.glob(os.path.join(SRC_DIR, "*.cpp"))
INCLUDE_DIR = "include"
INCLUDE_FILES = glob.glob(os.path.join(INCLUDE_DIR, "*.h"))
# Set up the extension
ext = Extension(
name="_" + NAME,
sources=SRC_FILES,
include_dirs=[INCLUDE_DIR, conda_include_dir],
extra_compile_args=["-std=c++11"],
language="c++",
libraries=["hts"],
library_dirs=[conda_lib_dir]
)
# Set up the module
setup(
name=NAME,
version=VERSION,
author=AUTHOR,
description=DESCRIPTION,
ext_modules=[ext],
py_modules=[NAME],
packages=find_packages(),
test_suite="tests",
entry_points={
"console_scripts": [
"contextsv = contextsv:main"
]
}
)