[med-svn] [Git][med-team/cyvcf2][master] Do not import numpy during clean

Nilesh Patra gitlab at salsa.debian.org
Thu Jul 9 18:45:40 BST 2020



Nilesh Patra pushed to branch master at Debian Med / cyvcf2


Commits:
66350013 by Nilesh Patra at 2020-07-09T23:15:12+05:30
Do not import numpy during clean

- - - - -


1 changed file:

- debian/patches/add_htslib_link_dependency.patch


Changes:

=====================================
debian/patches/add_htslib_link_dependency.patch
=====================================
@@ -5,9 +5,46 @@ Description: Add missing link dependency on htslib, cythonize modules
 
 --- a/setup.py
 +++ b/setup.py
-@@ -56,15 +56,14 @@
+@@ -11,11 +11,6 @@
+     sys.stderr.write("ERROR: cyvcf2 is only for python 2.7 or greater you are running %d.%d\n", (sys.version_info.major, sys.version_info.minor))
+     sys.exit(1)
  
- extensions = [Extension("cyvcf2.cyvcf2",
+-# Install numpy right now
+-dist.Distribution().fetch_build_eggs(['numpy'])
+-import numpy as np
+-
+-
+ def get_version():
+     """Get the version info from the mpld3 package without importing it"""
+     import ast
+@@ -44,27 +39,27 @@
+     return extensions
+ 
+ 
+-# Build the Cython extension by statically linking to the bundled htslib
+-sources = [
+-    x for x in glob.glob('htslib/*.c') 
+-    if not any(e in x for e in ['irods', 'plugin'])
+-]
+-sources += glob.glob('htslib/cram/*.c')
+-# Exclude the htslib sources containing main()'s
+-sources = [x for x in sources if not x.endswith(('htsfile.c', 'tabix.c', 'bgzip.c'))]
+-sources.append('cyvcf2/helpers.c')
++extensions = []
++if "clean" not in sys.argv:
++    import numpy as np
++    # Build the Cython extension by statically linking to the bundled htslib
++    sources = [
++        x for x in glob.glob('htslib/*.c') 
++        if not any(e in x for e in ['irods', 'plugin'])
++    ]
++    sources += glob.glob('htslib/cram/*.c')
++    # Exclude the htslib sources containing main()'s
++    sources = [x for x in sources if not x.endswith(('htsfile.c', 'tabix.c', 'bgzip.c'))]
++    sources.append('cyvcf2/helpers.c')
+ 
+-extensions = [Extension("cyvcf2.cyvcf2",
++    extensions = [Extension("cyvcf2.cyvcf2",
                          ["cyvcf2/cyvcf2.pyx"] + sources,
 -                        libraries=['z', 'bz2', 'lzma', 'curl', 'ssl'] + (['crypt'] if platform.system() != 'Darwin' else []),
 +                        libraries=['z', 'bz2', 'lzma', 'curl', 'ssl', 'hts'] + (['crypt'] if platform.system() != 'Darwin' else []),
@@ -16,14 +53,13 @@ Description: Add missing link dependency on htslib, cythonize modules
                              "-Wno-unused-result", "-Wno-discarded-qualifiers"],
                          include_dirs=['htslib', 'cyvcf2', np.get_include()])]
  
- 
+-
 -CYTHONIZE = bool(int(os.getenv("CYTHONIZE", 0)))
 -if CYTHONIZE:
-+if "clean" not in sys.argv:
      try:
          from Cython.Build import cythonize
      except ImportError:
-@@ -75,8 +74,6 @@
+@@ -75,8 +70,6 @@
          sys.exit(1)
      compiler_directives = {"language_level": 2, "embedsignature": True}
      extensions = cythonize(extensions, compiler_directives=compiler_directives)



View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/6635001399760fde56e134d40e356041d8b6a204

-- 
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/6635001399760fde56e134d40e356041d8b6a204
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20200709/af74693c/attachment-0001.html>


More information about the debian-med-commit mailing list