Commits

Nate Coraor  committed 2d7f615

Per James, make the build-time numpy dependency conditional (this is so
people building for their own platforms need not have numpy).

  • Participants
  • Parent commits c39a398

Comments (0)

Files changed (1)

 from setuptools import *
 from glob import glob
 
-import numpy
+try:
+    import numpy
+    have_numpy = True
+except:
+    have_numpy = False
        
 def main():                       
     setup(  name = "bx-python",
     extensions.append( Extension( "bx.pwm._position_weight_matrix",
                                   [ "lib/bx/pwm/_position_weight_matrix.pyx", "src/pwm_utils.c" ],
                                   include_dirs=["src"]  ) )
-    extensions.append( Extension( "bx.motif._pwm", [ "lib/bx/motif/_pwm.pyx" ], 
-                                  include_dirs=[numpy.get_include()] ) )
+    if have_numpy:
+        extensions.append( Extension( "bx.motif._pwm", [ "lib/bx/motif/_pwm.pyx" ], 
+                                      include_dirs=[numpy.get_include()] ) )
     # CpG masking
     extensions.append( Extension( "bx.align.sitemask._cpg", \
                                   [ "lib/bx/align/sitemask/_cpg.pyx", 
         
 if __name__ == "__main__":
     monkey_patch_doctest()
-    monkey_patch_numpy()
+    if have_numpy:
+        monkey_patch_numpy()
     main()