File: setup.py

package info (click to toggle)
python-pysam 0.15.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 17,604 kB
  • sloc: ansic: 125,787; python: 7,782; sh: 284; makefile: 222; perl: 41
file content (35 lines) | stat: -rw-r--r-- 954 bytes parent folder | download | duplicates (4)
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
import glob
import sys
import os

from setuptools import setup, find_packages, Extension
from Cython.Distutils import build_ext

import pysam

test_module_suffix = os.path.dirname(os.path.abspath(__file__)).split(os.sep)[-1]
test_module_name = "PysamTestModule_{}".format(test_module_suffix)

pysam_libraries = pysam.get_libraries()
pysam_libdirs, pysam_libs = zip(*[os.path.split(x) for x in pysam_libraries])
pysam_libdir = pysam_libdirs[0]
# remove lib and .so
pysam_libs = [x[3:-3] for x in pysam_libs]

TestModule = Extension(
    "{}.BuildRead".format(test_module_name),
    ["{}/BuildRead.pyx".format(test_module_name)],
    include_dirs=pysam.get_include(),
    library_dirs=[pysam_libdir],
    libraries=pysam_libs,
    language="C",
)

setup(
    name=test_module_name,
    version='0.1',
    packages=find_packages(),
    package_dir={test_module_name: test_module_name},
    ext_modules=[TestModule],
    cmdclass={'build_ext': build_ext},
)