mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00

* Add basic functionality for Cython functions and actors * Fix up per @pcmoritz comments * Fixes per @richardliaw comments * Fixes per @robertnishihara comments * Forgot double quotes when updating masked_log * Remove import typing for Python 2 compatibility
35 lines
915 B
Python
35 lines
915 B
Python
from __future__ import absolute_import
|
|
from __future__ import division
|
|
from __future__ import print_function
|
|
|
|
import os
|
|
from setuptools import setup
|
|
from Cython.Build import cythonize
|
|
|
|
import numpy
|
|
|
|
pkg_dir = "cython_examples"
|
|
modules = ["cython_simple.pyx", "masked_log.pyx"]
|
|
install_requires = ["cython", "numpy"]
|
|
include_dirs = [numpy.get_include()]
|
|
|
|
# TODO: Need scipy to run BrainIAK example, but don't want to add additional
|
|
# dependencies
|
|
try:
|
|
import scipy # noqa
|
|
modules.append("cython_blas.pyx")
|
|
install_requires.append("scipy")
|
|
except ImportError as e: # noqa
|
|
pass
|
|
|
|
modules = [os.path.join(pkg_dir, module) for module in modules]
|
|
|
|
setup(
|
|
name=pkg_dir,
|
|
version="0.0.1",
|
|
description="Cython examples for Ray",
|
|
packages=[pkg_dir],
|
|
ext_modules=cythonize(modules),
|
|
install_requires=install_requires,
|
|
include_dirs=include_dirs
|
|
)
|