From 128b67802740e3a0108be95c96b45ba521262012 Mon Sep 17 00:00:00 2001 From: Richard Frank Date: Wed, 29 Nov 2017 15:56:35 -0500 Subject: [PATCH] cleanup --- setup.py | 99 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 53 insertions(+), 46 deletions(-) diff --git a/setup.py b/setup.py index d3e843179c..97ad943f72 100644 --- a/setup.py +++ b/setup.py @@ -38,10 +38,14 @@ 'conda-build-script.py') # win if conda_build: - NumpyExtension = Extension + # If conda-build is running this, then we're currently expanding the jinja + # template in conda/zipline/meta.yaml, not actually installing. We don't + # have numpy or Cython yet, but luckily we only need the names from + # install_requires and build_requires. + ext_modules = [] else: try: - import Cython + import Cython # noqa except ImportError: raise Exception("Install Cython before zipline.") @@ -52,51 +56,54 @@ NumpyExtension = partial(Extension, include_dirs=[np.get_include()]) + def window_specialization(typename): + """Make an extension for an AdjustedArrayWindow specialization.""" + return NumpyExtension( + 'zipline.lib._{name}window'.format(name=typename), + ['zipline/lib/_{name}window.pyx'.format(name=typename)], + depends=['zipline/lib/_windowtemplate.pxi'], + ) -def window_specialization(typename): - """Make an extension for an AdjustedArrayWindow specialization.""" - return NumpyExtension( - 'zipline.lib._{name}window'.format(name=typename), - ['zipline/lib/_{name}window.pyx'.format(name=typename)], - depends=['zipline/lib/_windowtemplate.pxi'], - ) - - -ext_modules = [ - NumpyExtension('zipline.assets._assets', ['zipline/assets/_assets.pyx']), - NumpyExtension('zipline.assets.continuous_futures', - ['zipline/assets/continuous_futures.pyx']), - NumpyExtension('zipline.lib.adjustment', ['zipline/lib/adjustment.pyx']), - NumpyExtension('zipline.lib._factorize', ['zipline/lib/_factorize.pyx']), - window_specialization('float64'), - window_specialization('int64'), - window_specialization('int64'), - window_specialization('uint8'), - window_specialization('label'), - NumpyExtension('zipline.lib.rank', ['zipline/lib/rank.pyx']), - NumpyExtension('zipline.data._equities', ['zipline/data/_equities.pyx']), - NumpyExtension('zipline.data._adjustments', - ['zipline/data/_adjustments.pyx']), - Extension('zipline._protocol', ['zipline/_protocol.pyx']), - NumpyExtension('zipline.gens.sim_engine', ['zipline/gens/sim_engine.pyx']), - NumpyExtension( - 'zipline.data._minute_bar_internal', - ['zipline/data/_minute_bar_internal.pyx'] - ), - NumpyExtension( - 'zipline.utils.calendars._calendar_helpers', - ['zipline/utils/calendars/_calendar_helpers.pyx'] - ), - NumpyExtension( - 'zipline.data._resample', - ['zipline/data/_resample.pyx'] - ), - NumpyExtension( - 'zipline.pipeline.loaders.blaze._core', - ['zipline/pipeline/loaders/blaze/_core.pyx'], - depends=['zipline/lib/adjustment.pxd'], - ), -] + ext_modules = [ + NumpyExtension('zipline.assets._assets', + ['zipline/assets/_assets.pyx']), + NumpyExtension('zipline.assets.continuous_futures', + ['zipline/assets/continuous_futures.pyx']), + NumpyExtension('zipline.lib.adjustment', + ['zipline/lib/adjustment.pyx']), + NumpyExtension('zipline.lib._factorize', + ['zipline/lib/_factorize.pyx']), + window_specialization('float64'), + window_specialization('int64'), + window_specialization('int64'), + window_specialization('uint8'), + window_specialization('label'), + NumpyExtension('zipline.lib.rank', ['zipline/lib/rank.pyx']), + NumpyExtension('zipline.data._equities', + ['zipline/data/_equities.pyx']), + NumpyExtension('zipline.data._adjustments', + ['zipline/data/_adjustments.pyx']), + Extension('zipline._protocol', ['zipline/_protocol.pyx']), + NumpyExtension('zipline.gens.sim_engine', + ['zipline/gens/sim_engine.pyx']), + NumpyExtension( + 'zipline.data._minute_bar_internal', + ['zipline/data/_minute_bar_internal.pyx'] + ), + NumpyExtension( + 'zipline.utils.calendars._calendar_helpers', + ['zipline/utils/calendars/_calendar_helpers.pyx'] + ), + NumpyExtension( + 'zipline.data._resample', + ['zipline/data/_resample.pyx'] + ), + NumpyExtension( + 'zipline.pipeline.loaders.blaze._core', + ['zipline/pipeline/loaders/blaze/_core.pyx'], + depends=['zipline/lib/adjustment.pxd'], + ), + ] STR_TO_CMP = {