Skip to content

Commit

Permalink
Is numpy already mocked when setup.py is running?
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVinyard committed Sep 7, 2017
1 parent fa2374c commit b679dd4
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@
import numpy as np
from distutils.extension import Extension

include = np.get_include()
if not isinstance(include, str):
raise ImportError('numpy is mocked')

countbits = Extension(
name='countbits',
sources=['zounds/nputil/countbits.pyx'],
include_dirs=[np.get_include()],
include_dirs=[include],
extra_compile_args=[
'-shared',
'-pthread',
Expand All @@ -36,7 +40,7 @@
'-fno-strict-aliasing'
])
extension_modules = [countbits]
except:
except ImportError:
extension_modules = []


Expand Down

0 comments on commit b679dd4

Please sign in to comment.