| 1 |
Author: Liubov Chuprikova <[email protected]>, Nilesh Patra <[email protected]> |
| 2 |
Last-Update: 2020-06-09 |
| 3 |
Description: Add missing link dependency on htslib, cythonize modules |
| 4 |
|
| 5 |
|
| 6 |
--- a/setup.py |
| 7 |
+++ b/setup.py |
| 8 |
@@ -42,16 +42,8 @@ |
| 9 |
return extensions |
| 10 |
|
| 11 |
|
| 12 |
-# Build the Cython extension by statically linking to the bundled htslib |
| 13 |
-sources = [ |
| 14 |
- x for x in glob.glob('htslib/*.c') |
| 15 |
- if not any(e in x for e in ['irods', 'plugin']) |
| 16 |
-] |
| 17 |
-sources += glob.glob('htslib/cram/*.c') |
| 18 |
-sources += glob.glob('htslib/htscodecs/htscodecs/*.c') |
| 19 |
-# Exclude the htslib sources containing main()'s |
| 20 |
-sources = [x for x in sources if not x.endswith(('htsfile.c', 'tabix.c', 'bgzip.c'))] |
| 21 |
-sources.append('cyvcf2/helpers.c') |
| 22 |
+# Build the Cython helper extension |
| 23 |
+sources = ['cyvcf2/helpers.c'] |
| 24 |
|
| 25 |
extra_libs = [] |
| 26 |
if platform.system() != 'Darwin': |
| 27 |
@@ -59,13 +51,15 @@ |
| 28 |
if bool(int(os.getenv("LIBDEFLATE", 0))): |
| 29 |
extra_libs.append('deflate') |
| 30 |
|
| 31 |
-extensions = [Extension("cyvcf2.cyvcf2", |
| 32 |
+extensions=[] |
| 33 |
+if "clean" not in sys.argv: |
| 34 |
+ extensions = [Extension("cyvcf2.cyvcf2", |
| 35 |
["cyvcf2/cyvcf2.pyx"] + sources, |
| 36 |
- libraries=['z', 'bz2', 'lzma', 'curl', 'ssl'] + extra_libs, |
| 37 |
+ libraries=['z', 'bz2', 'lzma', 'curl', 'ssl', 'hts'] + extra_libs, |
| 38 |
extra_compile_args=["-Wno-sign-compare", "-Wno-unused-function", |
| 39 |
"-Wno-strict-prototypes", |
| 40 |
"-Wno-unused-result", "-Wno-discarded-qualifiers"], |
| 41 |
- include_dirs=['htslib', 'cyvcf2', np.get_include()])] |
| 42 |
+ include_dirs=['cyvcf2', np.get_include()])] |
| 43 |
|
| 44 |
|
| 45 |
CYTHONIZE = bool(int(os.getenv("CYTHONIZE", 0))) |
| 46 |
@@ -80,8 +74,6 @@ |
| 47 |
sys.exit(1) |
| 48 |
compiler_directives = {"language_level": 2, "embedsignature": True} |
| 49 |
extensions = cythonize(extensions, compiler_directives=compiler_directives) |
| 50 |
-else: |
| 51 |
- extensions = no_cythonize(extensions) |
| 52 |
|
| 53 |
|
| 54 |
setup( |