Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
richafrank committed Nov 29, 2017
1 parent 25e2150 commit 128b678
Showing 1 changed file with 53 additions and 46 deletions.
99 changes: 53 additions & 46 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")

Expand All @@ -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 = {
Expand Down

0 comments on commit 128b678

Please sign in to comment.