Skip to content

Commit

Permalink
handle conda build
Browse files Browse the repository at this point in the history
  • Loading branch information
richafrank committed Nov 22, 2017
1 parent 4368c5e commit 25e2150
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,24 @@

import versioneer

try:
import Cython
except ImportError:
raise Exception("Install Cython before zipline.")

try:
import numpy as np
except ImportError:
raise Exception("Install numpy before zipline.")
conda_build = os.path.basename(sys.argv[0]) in ('conda-build', # unix
'conda-build-script.py') # win

if conda_build:
NumpyExtension = Extension
else:
try:
import Cython
except ImportError:
raise Exception("Install Cython before zipline.")

try:
import numpy as np
except ImportError:
raise Exception("Install numpy before zipline.")

NumpyExtension = partial(Extension, include_dirs=[np.get_include()])
NumpyExtension = partial(Extension, include_dirs=[np.get_include()])


def window_specialization(typename):
Expand Down Expand Up @@ -240,9 +246,6 @@ def setup_requirements(requirements_path, module_names, strict_bounds,
return module_lines


conda_build = os.path.basename(sys.argv[0]) in ('conda-build', # unix
'conda-build-script.py') # win

setup_requires = setup_requirements(
'etc/requirements.txt',
('Cython', 'numpy'),
Expand Down

0 comments on commit 25e2150

Please sign in to comment.