Skip to content

Commit

Permalink
Guard against missing numpy in setup.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnVinyard committed Sep 1, 2017
1 parent b73ff75 commit fb06d26
Showing 1 changed file with 22 additions and 16 deletions.
38 changes: 22 additions & 16 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from setuptools import setup
import re
import numpy as np
from distutils.extension import Extension



try:
Expand All @@ -19,20 +18,27 @@
download_url = 'https://github.com/jvinyard/zounds/tarball/{version}'\
.format(**locals())

try:
import numpy as np
from distutils.extension import Extension

countbits = Extension(
name='countbits',
sources=['zounds/nputil/countbits.pyx'],
include_dirs=[np.get_include()],
extra_compile_args=[
'-shared',
'-pthread',
'-fPIC',
'-fwrapv',
'-O2',
'-Wall',
'-fno-strict-aliasing'
])
extension_modules = [countbits]
except ImportError:
extension_modules = []

countbits = Extension(
name='countbits',
sources=['zounds/nputil/countbits.pyx'],
include_dirs=[np.get_include()],
extra_compile_args=[
'-shared',
'-pthread',
'-fPIC',
'-fwrapv',
'-O2',
'-Wall',
'-fno-strict-aliasing'
])

setup(
name='zounds',
Expand All @@ -42,7 +48,7 @@
author_email='john.vinyard@gmail.com',
long_description=long_description,
download_url=download_url,
ext_modules=[countbits],
ext_modules=extension_modules,
packages=[
'zounds',
'zounds.basic',
Expand Down

0 comments on commit fb06d26

Please sign in to comment.